public static void OnGUI() { EditorGUILayout.HelpBox("Unity Monetization SDK Installed.", MessageType.Info); using (new SA_GuiBeginHorizontal()) { GUILayout.FlexibleSpace(); var example = GUILayout.Button("Example", EditorStyles.miniButton, GUILayout.Width(80)); if (example) { FillExampleSettings(); } var click = GUILayout.Button("Dashboard", EditorStyles.miniButton, GUILayout.Width(80)); if (click) { Application.OpenURL("https://operate.dashboard.unity3d.com/"); } } var settins = UM_UnityAdsSettings.Instance; using (new SA_H2WindowBlockWithSpace(new GUIContent("IOS"))) { UM_AdvertisementUI.DrawPlatfromIds(settins.IOSIds); } using (new SA_H2WindowBlockWithSpace(new GUIContent("ANDROID"))) { UM_AdvertisementUI.DrawPlatfromIds(settins.AndroidIds); } using (new SA_H2WindowBlockWithSpace(new GUIContent("SETTINGS"))) { settins.TestMode = SA_EditorGUILayout.ToggleFiled("Test Mode", settins.TestMode, SA_StyledToggle.ToggleType.YesNo); } }
public void OnGUI() { var settins = UM_GoogleAdsSettings.Instance; using (new SA_GuiBeginHorizontal()) { GUILayout.FlexibleSpace(); var example = GUILayout.Button("Example", EditorStyles.miniButton, GUILayout.Width(80)); if (example) { FillExampleSettings(); } var click = GUILayout.Button("Dashboard", EditorStyles.miniButton, GUILayout.Width(80)); if (click) { Application.OpenURL("https://apps.admob.com/"); } } using (new SA_H2WindowBlockWithSpace(new GUIContent("IOS"))) { UM_AdvertisementUI.DrawPlatformIds(settins.IOSIds); } using (new SA_H2WindowBlockWithSpace(new GUIContent("ANDROID"))) { if (string.IsNullOrEmpty(settins.AndroidIds.AppId)) { EditorGUILayout.HelpBox("Application id MUST be provided on Android platform before you make a build. " + "Empty Application id may result in app crash on launch.", MessageType.Error); } UM_AdvertisementUI.DrawPlatformIds(settins.AndroidIds); } using (new SA_H2WindowBlockWithSpace(new GUIContent("SETTINGS"))) { #if SA_ADMOB_INSTALLED settins.BannerSize = (UM_GoogleBannerSize)SA_EditorGUILayout.EnumPopup("Banner Size", settins.BannerSize); settins.BannerPosition = (AdPosition)SA_EditorGUILayout.EnumPopup("Banner Position", settins.BannerPosition); #endif settins.NPA = SA_EditorGUILayout.ToggleFiled("Non-Personalized Ads", settins.TagForChildDirectedTreatment, SA_StyledToggle.ToggleType.YesNo); settins.TagForChildDirectedTreatment = SA_EditorGUILayout.ToggleFiled("Tag For Child Directed Treatment", settins.TagForChildDirectedTreatment, SA_StyledToggle.ToggleType.YesNo); ReorderableListGUI.Title("Test Devices"); ReorderableListGUI.ListField(settins.TestDevices, DrawTextFiled, () => { EditorGUILayout.LabelField("Configure your device as a test device."); }); EditorGUILayout.Space(); ReorderableListGUI.Title("Keywords"); ReorderableListGUI.ListField(settins.Keywords, DrawTextFiled, () => { EditorGUILayout.LabelField("Provide keywords to admob so the ads can be targeted."); }); EditorGUILayout.Space(); } if (GUI.changed) { UM_GoogleAdsSettings.Save(); } }