public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        TestDijkstra testDijkstraV2 = (TestDijkstra)target;

        GUILayout.Space(10);
        if (GUILayout.Button("Calcular Dijkstra (V2)"))
        {
            testDijkstraV2.CallDijkstra();
        }
    }
Example #2
0
    /// <summary>
    /// Create the dijkstra agents
    /// </summary>
    public void CreateAgents()
    {
        for (int i = 0; i < AgentUtility.agentCount; i++)
        {
            GameObject testDijkstraInstance = Instantiate(testDijkstra, parentDijkstra.transform);
            GameObject lineDrawerInstance   = Instantiate(lineDrawer, parentLineDrawers.transform);

            TestDijkstra testDijkstraScript = testDijkstraInstance.GetComponent <TestDijkstra>();
            testDijkstraScript.lineDrawer = lineDrawerInstance.GetComponent <LineDrawer>();
            testDijkstraScript.lineDrawer.SetLineRendererParent(parentLineRenderer);

            testDijkstraScript.graphView = this.graphView;

            testDijkstraScript.startNode   = graphView.NodeViewCollection[graphView.startNodesIndex[i]];
            testDijkstraScript.destinyNode = graphView.NodeViewCollection[graphView.destinyNodesIndex[i]];

            agents.Add(testDijkstraScript);
        }
    }