Exemplo n.º 1
0
        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;
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        public static void MenuOpenSettings()
        {
            EM_Settings instance = EM_Settings.LoadSettingsAsset();

            if (instance == null)
            {
                instance = EM_BuiltinObjectCreator.CreateEMSettingsAsset();
            }

            Selection.activeObject = instance;
        }
Exemplo n.º 3
0
        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();
        }
Exemplo n.º 4
0
        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();
        }
Exemplo n.º 5
0
        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();
        }
Exemplo n.º 6
0
        public static void CreateEasyMobilePrefabInstance(MenuCommand menuCommand)
        {
            GameObject prefab = EM_EditorUtil.GetMainPrefab();

            if (prefab == null)
            {
                prefab = EM_BuiltinObjectCreator.CreateEasyMobilePrefab();
            }

            // Stop if another instance already exists as a root object in this scene
            GameObject existingInstance = EM_EditorUtil.FindPrefabInstanceInScene(prefab, EditorSceneManager.GetActiveScene());

            if (existingInstance != null)
            {
                Selection.activeObject = existingInstance;
                return;
            }

            // Instantiate an EasyMobile prefab at scene root (parentless) because it's a singleton
            GameObject go = PrefabUtility.InstantiatePrefab(prefab) as GameObject;

            AddGameObjectToScene(go);
        }
Exemplo n.º 7
0
        public static void CreateClipPlayerUI(MenuCommand menuCommand)
        {
            GameObject go = EM_BuiltinObjectCreator.CreateClipPlayerUI(menuCommand.context as GameObject);

            AddGameObjectToScene(go);
        }
Exemplo n.º 8
0
 public static void MenuCreateMainPrefab()
 {
     EM_BuiltinObjectCreator.CreateEasyMobilePrefab(true);
     EM_PluginManager.CheckModules();
 }