Beispiel #1
0
        //----------------------------------------------------------
        #region 内部関数
        //----------------------------------------------------------

        static GcEditorEventManager()
        {
            if (EditorApplication.isCompiling)
            {
                return;
            }

            EditorApplication.playModeStateChanged    += OnPlayModeStateChanged;
            AssemblyReloadEvents.beforeAssemblyReload += OnPreCompile;
            EditorApplication.delayCall += OnReload;

            void OnReload()
            {
                GcEditorSettings.Load();

                if (File.Exists(k_LaunchFlagPath))
                {
                    // script reload event
                    OnPostCompile();
                }
                else
                {
                    File.Create(k_LaunchFlagPath);

                    // editor launch event
                    OnLaunch();
                }

                GcEditorMenu.OnReload();
            };
        }
            static void OnReload()
            {
                GcEditorSettings.Load();

                if (File.Exists(k_LaunchFlagPath))
                {
                    // script reload event
                    OnPostCompile();
                }
                else
                {
                    File.Create(k_LaunchFlagPath);

                    // editor launch event
                    OnLaunch();
                }

                GcEditorMenu.OnReload();
            };
Beispiel #3
0
        //----------------------------------------------------------
        #region 内部関数
        //----------------------------------------------------------

        internal static void Load()
        {
            if (File.Exists(k_Path))
            {
                var json = File.ReadAllText(k_Path);
                s_Instance = JsonUtility.FromJson <GcEditorSettings>(json);
                if (s_Instance != null)
                {
                    if (s_Instance.SerializeVersion == k_SerializeVersion)
                    {
                        return;
                    }

                    Debug.LogWarning("[GameCanvas] バージョン更新により、エディタ設定が初期化されました\n");
                }
            }

            s_Instance = new GcEditorSettings();
            s_Instance.Save();
        }