private void Start() { playerEntity = FindObjectOfType <Player>(); playerT = playerEntity.transform; playerEntity.OnDeath += OnPlayerDied; nextCampingCheckTime = timeBetweencampingChecks + Time.time; campPositionOld = playerT.position; map = GameObject.FindObjectOfType <MapGenerator>(); NextWave(); }
private void Awake() { pathFinder = GetComponent <NavMeshAgent>(); if (GameObject.FindGameObjectWithTag("Player") != null) { hasTarget = true; target = GameObject.FindGameObjectWithTag("Player").transform; targetEntity = target.GetComponent <LeavingEntity>(); myCollisionRadius = GetComponent <CapsuleCollider>().radius; targetCollisionRadius = target.GetComponent <CapsuleCollider>().radius; } }