private void OnTriggerEnter(Collider other) { if (other.tag == "Player" && !meshesEnabled) { TurnOnMesh(); meshesEnabled = true; other.GetComponent <Player>().currentRoom = this.transform; } //Temporary solution, should probably have something to call in Gregg instead of setting directly //Really need to update the logic better so that its not dependant on the room, but positioning if (other.tag == "Killer") { Gregg killer = other.GetComponent <Gregg>(); killer.currentRoom = this; if (meshesEnabled || (litByFlashlight && Player.flashlightOn)) { killer.TurnOnMesh(); } else { killer.TurnOffMesh(); } //if (hasActiveInteracts) //{ // foreach (InteractSetTrigger trigger in interacts) // { // trigger.state = InteractParent.State.Disabled; // hasActiveInteracts = false; // } //} } }
private void OnTriggerEnter(Collider other) { if (other.tag == "Killer") { Gregg killer = other.GetComponent <Gregg>(); //Debug.Log("Hit the killer"); if (!killer.stunned) { killer.StartStunTimer(); } if (isMachette) { killer.health--; } } }
public override void Interact() { if (!killerTeleported) { if (GameManager.step != 6) { killer = GameObject.FindObjectOfType <Gregg>(); player.weaponPrefab = weapon; //GameManager.UpdateStep(); } base.Interact(); //TO DO: killer fight logic here Debug.Log("Do secret ending here"); killerTeleported = true; StartCoroutine(TeleportKiller(killerSpawnTime)); } }