//End Misc /** Enables editor stuff. Loads graphs, reads settings and sets everything up */ public void OnEnable () { script = target as AstarPath; GUILayoutx = new EditorGUILayoutx (); EditorGUILayoutx.editor = this; AstarSerializer.readUnityReference_Editor = ReadUnityReference; AstarSerializer.writeUnityReference_Editor = WriteUnityReference; //Enables the editor to get a callback on OnDrawGizmos to enable graph editors to draw gizmos script.OnDrawGizmosCallback = OnDrawGizmos; // Make sure all references are set up to avoid NullReferenceExceptions script.SetUpReferences (); //Search the assembly for graph types and graph editors FindGraphTypes (); GetAstarEditorSettings (); LoadStyles (); //Load graphs only when not playing, or in extreme cases, when astarData.graphs is null if ((!Application.isPlaying && (script.astarData == null || script.astarData.graphs == null || script.astarData.graphs.Length == 0)) || script.astarData.graphs == null) { LoadGraphs (); } }
//End Misc /** Enables editor stuff. Loads graphs, reads settings and sets everything up */ public void OnEnable () { script = target as AstarPath; GUILayoutx = new EditorGUILayoutx (); EditorGUILayoutx.editor = this; //Enables the editor to get a callback on OnDrawGizmos to enable graph editors to draw gizmos script.OnDrawGizmosCallback = OnDrawGizmos; // Make sure all references are set up to avoid NullReferenceExceptions script.SetUpReferences (); //Search the assembly for graph types and graph editors if ( graphEditorTypes == null || graphEditorTypes.Count == 0 ) FindGraphTypes (); try { GetAstarEditorSettings (); } catch (System.Exception e) { Debug.LogException ( e ); } LoadStyles (); //Load graphs only when not playing, or in extreme cases, when astarData.graphs is null if ((!Application.isPlaying && (script.astarData == null || script.astarData.graphs == null || script.astarData.graphs.Length == 0)) || script.astarData.graphs == null) { LoadGraphs (); } }
//End Misc /** Enables editor stuff. Loads graphs, reads settings and sets everything up */ public void OnEnable() { script = target as AstarPath; GUILayoutx = new EditorGUILayoutx (); EditorGUILayoutx.editor = this; AstarSerializer.readUnityReference_Editor = ReadUnityReference; AstarSerializer.writeUnityReference_Editor = WriteUnityReference; //Enables the editor to get a callback on OnDrawGizmos to enable graph editors to draw gizmos script.OnDrawGizmosCallback = OnDrawGizmos; // Make sure all references are set up to avoid NullReferenceExceptions script.SetUpReferences (); //Search the assembly for graph types and graph editors FindGraphTypes (); GetAstarEditorSettings (); LoadStyles (); LoadGraphs (); }