Ejemplo n.º 1
0
    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();
    }
Ejemplo n.º 2
0
    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();
    }