예제 #1
0
파일: EnemyMove.cs 프로젝트: NKCVRs/VRtest2
    // Use this for initialization
    void Start()
    {
        // 最初の位置を覚えておく
        start = transform.position;

        agent.enabled = true;
        // NavMeshAgentを取得して
        //agent = GetComponent<NavMeshAgent>();


        Maze_obj = GameObject.FindGameObjectWithTag("Maze");

        Maze_scr   = Maze_obj.GetComponent <Maze_Create>();
        maze_arrey = Maze_scr.maze_arrey;

        //agent_pos[0] = new Vector2(8,1);
        //agent_pos[1] = new Vector2(8, 4);
        //agent_pos[2] = new Vector2(1, 4);
        //agent_pos[3] = new Vector2(1, 1);
        Rand_agent();

        // ゴールを設定。
        AgentPositon = new Vector3(agent_pos[0].x, 1.5f, agent_pos[0].y);

        //Debug.Log("X" + agent_pos[0].x + " Y" + agent_pos[0].y);
    }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        // 最初の位置を覚えておく
        start = transform.position;

        agent.enabled = true;
        // NavMeshAgentを取得して
        //agent = GetComponent<NavMeshAgent>();

        Maze_obj = GameObject.FindGameObjectWithTag("Maze");

        Maze_scr   = Maze_obj.GetComponent <Maze_Create>();
        maze_arrey = Maze_scr.maze_arrey;

        //transform.position = new Vector3(35.0f, 0.0f, 1.0f);

        Debug.Log("X" + transform.position.x + " Z" + transform.position.z);

        //Rand_agent();
    }
예제 #3
0
    Vector3 AgentPositon;   //目標の座標


    // Use this for initialization
    void Start()
    {
        // 最初の位置を覚えておく
        start = transform.position;

        agent.enabled = true;
        // NavMeshAgentを取得して
        //agent = GetComponent<NavMeshAgent>();

        // ゴールを設定。
        AgentPositon = new Vector3(8.0f, 1.5f, 1.0f);

        Maze_obj = GameObject.FindGameObjectWithTag("Maze");

        Maze_scr   = Maze_obj.GetComponent <Maze_Create>();
        maze_arrey = Maze_scr.maze_arrey;

        Rand_agent();

        //setNavMesh();
    }