private void Init() { _sight = this.transform.GetComponentInChildren<npcSight>(); _spawnBullets = this.transform.GetComponentInChildren<SpawnBullets>(); _feels = this.transform.GetComponentInChildren<npcFeels>(); _isWaiting = false; _state = State.Wait; }
void Awake() { //See line 18,19 // all good now npcSight = GetComponent<npcSight>(); nav = GetComponent<NavMeshAgent>(); // abstract all tags into a class and call it Tags so Tags.OVR = "MainCamera" player = GameObject.FindGameObjectWithTag("MainCamera"); playerTransform = player.transform; // see line 22,23 // all good now lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<lastPlayerSighting>(); //f**k still need player blackboard //see line 29,30 //made but needs work playerBlackboard = player.GetComponent<PlayerBlackboard>(); }