Example #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);
        }
Example #2
0
 public static void Disable()
 {
     GetInstance()._isActive = false;
     EditorUtility.SetDirty(GetInstance());
     WaypointEditorWindow.Disable();
 }
Example #3
0
 public static void Enable()
 {
     GetInstance()._isActive = true;
     EditorUtility.SetDirty(GetInstance());
     WaypointEditorWindow.Enable();
 }