// Update is called once per frame void Update() { if (!monster.Alive()) { monster.player.EndMode(); } }
private void OnTriggerStay(Collider other) { if (other.CompareTag("Player") && ((monsterToKill == null || !monsterToKill.Alive()) && (monsterToBlock == null || monsterToBlock.GetMonsterIn()))) { other.gameObject.GetComponentInParent <ScriptPerson>().DisplayInfo("Press E"); if (Input.GetKey(KeyCode.E)) { doorToUse.Use(); if (loadNewScene) { other.GetComponent <LoadManager>().LoadNextScene(); loadNewScene = false; } } } }