public static void MenuOpenSettings() { // Open EM_Settings in Inspector window. EM_Settings instance = EM_Settings.LoadSettingsAsset(); if (instance == null) { instance = EM_BuiltinObjectCreator.CreateEMSettingsAsset(); } Selection.activeObject = instance; // Focus on Inspector window if needed. if (EditorWindow.focusedWindow == null || EditorWindow.focusedWindow.GetType().Name != InspectorWindowType) { var allWindows = Resources.FindObjectsOfTypeAll <EditorWindow>(); if (allWindows != null) { foreach (var a in allWindows) { string windowType = a.GetType().Name; if (windowType == InspectorWindowType) { a.Focus(); break; } } } } }
public static void MenuOpenSettings() { EM_Settings instance = EM_Settings.LoadSettingsAsset(); if (instance == null) { instance = EM_BuiltinObjectCreator.CreateEMSettingsAsset(); } Selection.activeObject = instance; }
public static void MenuOpenSettings() { // Load settings object or create a new one if it doesn't exist. EM_Settings instance = EM_Settings.LoadSettingsAsset(); if (instance == null) { instance = EM_BuiltinObjectCreator.CreateEMSettingsAsset(); } EM_SettingsWindow.ShowWindow(); }
private static void Initialize() { EditorApplication.update -= Initialize; // Check if a new version has been imported and perform necessary updating jobs. VersionCheck(); // Define a global symbol indicating the existence of EasyMobile. GlobalDefineManager.SDS_AddDefinesOnAllPlatforms(EM_ScriptingSymbols.EasyMobile.Split(';')); // Create the EM_Settings scriptable object if it doesn't exist. EM_BuiltinObjectCreator.CreateEMSettingsAsset(); // Regularly check for module prerequisites to avoid issues caused // by inadvertent changes, e.g removal of required scripting symbols. CheckModules(); }
private static void Initialize() { EditorApplication.update -= Initialize; // Check if a new version has been imported and perform necessary updating jobs. VersionCheck(); // Define a global symbol indicating the existence of EasyMobile GlobalDefineManager.SDS_AddDefines(EM_ScriptingSymbols.EasyMobile.Split(';'), EditorUserBuildSettings.selectedBuildTargetGroup); // Create the EM_Settings scriptable object if it doesn't exist. EM_BuiltinObjectCreator.CreateEMSettingsAsset(); // Create the EasyMobile prefab if it doesn't exist. EM_BuiltinObjectCreator.CreateEasyMobilePrefab(); // Regularly check for module prerequisites to avoid issues caused // by inadvertent changes, e.g remove components from prefab or delete scripting symbol. CheckModules(); }