void Update() { total = count.getTotalItem(); NavMeshAgent agent = GetComponent <NavMeshAgent>(); agent.destination = player.position; speed = ((100 - battery.getBattery()) / 100) * 5 + baseSpeed; agent.speed = speed; }
void Update() { total = count.getTotalItem(); if (buttonInRanged == true) { if (Input.GetKey("e")) { if (total >= 4) { SceneManager.LoadScene("basement"); } } } }