コード例 #1
0
ファイル: GraphMaker.cs プロジェクト: boris47/Distance3D
        //////////////////////////////////////////////////////////////////////////
        // AWAKE
        private void    Awake()
        {
            Instance = this;

            // Find all nodes
            m_Nodes = FindObjectsOfType <AINode>();
        }
コード例 #2
0
        void Start()
        {
            graphMaker = FindObjectOfType <GraphMaker>();

            var nodes = graphMaker.nodes;
            var edges = graphMaker.edges;

            StartCoroutine(Search(nodes, edges, startNode, endNode));
        }
コード例 #3
0
        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));
        }
コード例 #4
0
        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));
        }
コード例 #5
0
        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);
            }
        }