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); }
public static void Enable() { GetInstance()._isActive = true; EditorUtility.SetDirty(GetInstance()); WaypointEditorWindow.Enable(); }