예제 #1
0
        private static WaypointEditorState GetInstance()
        {
            if (!_instance)
            {
                try
                {
                    //gets the Scriptable object instance asset in the Assets folder.
                    _instance = Resources.LoadAll <WaypointEditorState>("").First();
                }
                catch (Exception)
                {
                    Debug.LogError("No WaypointEditorState !");
                }
            }

            if (_instance._isActive)
            {
                WaypointEditorWindow.Enable();
            }

            return(_instance);
        }
예제 #2
0
 public static void Disable()
 {
     GetInstance()._isActive = false;
     EditorUtility.SetDirty(GetInstance());
     WaypointEditorWindow.Disable();
 }
예제 #3
0
 public static void Enable()
 {
     GetInstance()._isActive = true;
     EditorUtility.SetDirty(GetInstance());
     WaypointEditorWindow.Enable();
 }