Skip to content

Commit

Permalink
Fix: Code formatting and optimize code in HMSPluginUpdaterInit.cs and…
Browse files Browse the repository at this point in the history
… HMSAdsSettingsDrawer.cs
  • Loading branch information
Andronovo-bit authored and alihan98ersoy committed Mar 20, 2024
1 parent d79863f commit a24da05
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Assets/Huawei/Editor/Utils/HMSPluginUpdaterInit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ static HMSPluginUpdaterInit()
};
}
}
#endif
}
#endif
23 changes: 11 additions & 12 deletions Assets/Huawei/Editor/View/AdsTab/HMSAdsSettingsDrawer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,19 +208,14 @@ private void _splashAdOrientation_OnChangedSelection(Enum returnedEnum)
private void OnSplashSubTextSaveButtonClick()
{
_settings.Set(HMSAdsKitSettings.SplashSubText, _splashAdsSubTextField.GetCurrentText());
if (_splashAdPreviewObj != null)
{
_splashAdPreviewObj.RefreshContent();
}
RefreshSplashAdPreview();

}

private void OnSplashTitleSaveButtonClick()
{
_settings.Set(HMSAdsKitSettings.SplashTitle, _splashAdsTitleTextField.GetCurrentText());
if (_splashAdPreviewObj != null)
{
_splashAdPreviewObj.RefreshContent();
}
RefreshSplashAdPreview();
}

private void OnSplashAdIDSaveButtonClick()
Expand Down Expand Up @@ -347,10 +342,7 @@ private void OnSpriteImageChanged(Sprite image)
}
_settings.Set(HMSAdsKitSettings.SplashImagePath, image != null ? AssetDatabase.GetAssetPath(image.GetInstanceID()) : "");
_settings.Set(HMSAdsKitSettings.SplashImageBytes, image != null ? imageAsString : "");
if (_splashAdPreviewObj != null)
{
_splashAdPreviewObj.RefreshContent();
}
RefreshSplashAdPreview();
}
catch (Exception ex)
{
Expand Down Expand Up @@ -424,5 +416,12 @@ private bool CheckTextureFormat(TextureImporterPlatformSettings settings)
return false;
}
}
private void RefreshSplashAdPreview()
{
if (_splashAdPreviewObj != null)
{
_splashAdPreviewObj.RefreshContent();
}
}
}
}

0 comments on commit a24da05

Please sign in to comment.