void Start() { controller = GetComponent <CharacterController>(); obj = GameObject.FindGameObjectWithTag("NPC"); aa = obj.GetComponent <AI_Agent>(); moveNpc = obj.GetComponent <MoveNPC>(); }
void Start() { obj = GameObject.FindGameObjectWithTag("NPC"); ai = obj.GetComponent <AI_Agent>(); moveNpc = obj.GetComponent <MoveNPC>(); // 플레이어 위치 찾기 playerTrans = GameObject.FindGameObjectWithTag("Player").transform; }
void Start() { moveNpc = GetComponent <MoveNPC>(); anim = GetComponent <Animator>(); //wpMasterList = thePaths.GetComponent<WaypointMaster>(); playerTransform = GameObject.FindGameObjectWithTag("Player").transform; playerLocation = playerTransform.position; // 정찰다닐 노드 리스트 생성 patrolNodes = GameObject.FindGameObjectsWithTag("PatrolNode"); foreach (GameObject obj in patrolNodes) { Vector3 pl = obj.transform.position; patrolList.Add(pl); } randomNum = Random.Range(0, patrolList.Count - 1); }
void Start() { npc = GameObject.FindGameObjectWithTag("NPC"); ai = npc.GetComponent <AI_Agent>(); moveNpc = npc.GetComponent <MoveNPC>(); }