public override void OnInspectorGUI() { if (GUILayout.Button("Edit Settings")) { AdsMasterEditor.OpenSettings(); } }
public override void OnInspectorGUI() { GUI.changed = false; EditorGUI.BeginChangeCheck(); Loader.settings = EditorGUILayout.ObjectField("Settings", Loader.settings, typeof(AdsMasterSetting), false) as AdsMasterSetting; if (Loader.settings == null) { Loader.settings = LibResourceUtil.LoadAndCreateSetting <AdsMasterSetting>(); GUI.changed = true; } if (GUILayout.Button("Edit Settings")) { AdsMasterEditor.OpenSettings(); } EditorGUI.EndChangeCheck(); if (GUI.changed) { EditorSceneManager.MarkAllScenesDirty(); } }
static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) { bool isChanged = false; if (admobDetector.Contain(importedAssets) && admobDetector.IsValid && !AdsMasterEditor.Settings.IsAdmobActived) { AdsMasterEditor.Settings.IsAdmobActived = true; isChanged = true; } if (admobDetector.Contain(deletedAssets) && !admobDetector.IsValid && AdsMasterEditor.Settings.IsAdmobActived) { AdsMasterEditor.Settings.IsAdmobActived = false; isChanged = true; } if (vungleDetector.Contain(importedAssets) && vungleDetector.IsValid && !AdsMasterEditor.Settings.IsVungleActived) { AdsMasterEditor.Settings.IsVungleActived = true; isChanged = true; } if (vungleDetector.Contain(deletedAssets) && !vungleDetector.IsValid && AdsMasterEditor.Settings.IsVungleActived) { AdsMasterEditor.Settings.IsVungleActived = false; isChanged = true; } if (fbadsDetector.Contain(importedAssets) && fbadsDetector.IsValid && !AdsMasterEditor.Settings.IsFbAdActived) { AdsMasterEditor.Settings.IsFbAdActived = true; isChanged = true; } if (fbadsDetector.Contain(deletedAssets) && !fbadsDetector.IsValid && AdsMasterEditor.Settings.IsFbAdActived) { AdsMasterEditor.Settings.IsFbAdActived = false; isChanged = true; } if (chartboostDetector.Contain(importedAssets) && chartboostDetector.IsValid && !AdsMasterEditor.Settings.IsChartBoostActived) { AdsMasterEditor.Settings.IsChartBoostActived = true; isChanged = true; } if (chartboostDetector.Contain(deletedAssets) && !chartboostDetector.IsValid && AdsMasterEditor.Settings.IsChartBoostActived) { AdsMasterEditor.Settings.IsChartBoostActived = false; isChanged = true; } if (isChanged) { AdsMasterEditor.UpdateDefineSympols(); } }