// 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); }
// 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(); }
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(); }