private void OnTriggerEnter2D(Collider2D collision) { Debug.Log("Enter Room:" + collision.gameObject.name); var h = collision.gameObject.GetComponent <HealthState>(); if (h != null) { PlayersInRoom.Add(h); } SetHealthDescreaseForAllInmates(); }
private void OnTriggerExit2D(Collider2D collision) { Debug.Log("Exit Room:" + collision.gameObject.name); var h = collision.gameObject.GetComponent <HealthState>(); if (h != null) { h.HealthDecreasePerSecond = HealthState.BaseHealthDecreasePerSecond; PlayersInRoom.Remove(h); } SetHealthDescreaseForAllInmates(); }