////////////////////////////////////////////////////////////////////////// // AWAKE private void Awake() { Instance = this; // Find all nodes m_Nodes = FindObjectsOfType <AINode>(); }
void Start() { graphMaker = FindObjectOfType <GraphMaker>(); var nodes = graphMaker.nodes; var edges = graphMaker.edges; StartCoroutine(Search(nodes, edges, startNode, endNode)); }
void Start() { graphMaker = FindObjectOfType <GraphMaker>(); var nodes = graphMaker.nodes; var edges = graphMaker.edges; List <Node> bestPath = new List <Node>(); StartCoroutine(Search(nodes, edges, startNode, endNode, bestPath)); }
void Start() { graphMaker = FindObjectOfType <GraphMaker>(); var nodes = graphMaker.nodes; var edges = graphMaker.edges; startNode.transform.localScale = Vector3.one * 2; endNode.transform.localScale = Vector3.one * 2; StartCoroutine(Search(nodes, edges, startNode, endNode)); }
public override void OnInspectorGUI() { DrawDefaultInspector(); IGrapMakerEditor graphInterface = ( IGrapMakerEditor )target; GraphMaker graphMaker = ( GraphMaker )target; if (GUILayout.Button("Node Count")) { Debug.Log("Node Count: " + FindObjectsOfType <AINode>().Length); } if (GUILayout.Button("Build")) { graphInterface.Nodes = FindObjectsOfType <AINode>(); foreach (IAINode node in graphInterface.Nodes) { UpdateNeighbours(node, false); EditorUtility.SetDirty(node as AINode); } Debug.Log("Build done, node count: " + graphInterface.Nodes.Length); EditorUtility.SetDirty(graphMaker); } }