private void Start() { // get the drone controller m_Drone = GetComponent <DroneController>(); friends = GameObject.FindGameObjectsWithTag("Drone"); myIndex = -1; for (int idx = 0; idx < friends.Length; idx++) { if (friends[idx].transform == m_Drone.transform) { myIndex = idx; break; } } terrain_manager = terrain_manager_game_object.GetComponent <TerrainManager>(); tInfo = terrain_manager.myInfo; Vector3 start_pos = m_Drone.transform.position; Vector3 goal_pos = my_goal_object.transform.position; mHighResMap = new HighResMap(ref tInfo, 1); AStar aster = new AStar(ref mHighResMap); int i = mHighResMap.get_i_index(transform.position.x); int j = mHighResMap.get_j_index(transform.position.z); int iEnd = mHighResMap.get_i_index(goal_pos.x); int jEnd = mHighResMap.get_j_index(goal_pos.z); tPath = aster.ComputePath(i, j, iEnd, jEnd); mDecision = new DroneDecisionSimple(ref m_Drone, ref friends, ref mHighResMap, tPath); //status init ifMoveable = false; ifFinished = false; }