Example #1
0
    void OnTriggerExit2D(Collider2D other)
    {
        Floatable fl = other.GetComponent <Floatable>();

        if (fl != null)
        {
            fl.ActivateFloating(false, GetTransform.position.y);
        }
    }
    private void OnTriggerExit2D(Collider2D other)
    {
        Floatable fl = other.GetComponent <Floatable>();

        if (fl != null)
        {
            fl.ActivateFloating(false, transform.position.y);
        }

        var characterRef = other.gameObject.GetComponent <ICharacterReference>();

        if (characterRef != null)
        {
            OnTriggerExited(characterRef.Character);
        }
    }
Example #3
0
    void OnTriggerStay2D(Collider2D other)
    {
        Floatable fl = other.GetComponent <Floatable>();

        if (fl != null)
        {
            fl.ActivateFloating(true, GetTransform.position.y);
        }

        var characterRef = other.gameObject.GetComponent <ICharacterReference>();

        if (characterRef != null)
        {
            KillCharacter(characterRef.Character);
        }
    }