コード例 #1
0
    private void GetPath()
    {
        if (aStar == null)
        {
            Init();
        }
        else
        {
            StoreNode(aStar.GetCurrentNode(transform.position));
            currentNodeTimeSpent = maximumTimeSpentByNode;
            MindMap mindMap = GetComponent <MindMap> ();
            targetRoomPoint = mindMap.GetRoomPoint(roomToGo);
            if (targetRoomPoint != null)
            {
                path = aStar.FindPath(transform.position, targetRoomPoint.transform.position);
                if (path != null)
                {
                    isFinalTargetRoomPoint = true;
                    aStar.SetPath(path);
//					Debug.Log ("Path OK");
                }
                else
                {
                    Debug.Log("Cannot move");
                }
            }
            else
            {
                Debug.Log("The room for " + roomToGo + "does not exist");
            }
        }
    }
コード例 #2
0
    private GameObject GetTargetRoomPoint()
    {
        MindMap mindMap = GetComponent <MindMap> ();

        targetRoomPoint = mindMap.GetRoomPoint(roomToGo);
        return(targetRoomPoint);
    }