public virtual void OnTriggerExit2D(Collider2D collision) { Debug.Log(collision.gameObject.name + exitMessage); IFieldAffected fieldAffected = collision.GetComponent <IFieldAffected>(); if (fieldAffected != null) { fieldAffected.OnFieldExit(this); } }
public override void OnTriggerExit2D(Collider2D collision) { Debug.Log(collision.gameObject.name + exitMessage); IFieldAffected fieldAffected = collision.GetComponent <IFieldAffected>(); IDamageable damageable = collision.GetComponent <IDamageable>(); if (fieldAffected != null && damageable != null) { fieldAffected.OnFieldExit(this); } }
public override void OnTriggerExit2D(Collider2D collision) { Debug.Log(collision.gameObject.name + exitMessage); IFieldAffected fieldAffected = collision.GetComponent <IFieldAffected>(); MovementModel movementModel = collision.GetComponent <MovementModel>(); if (fieldAffected != null && movementModel != null) { fieldAffected.OnFieldExit(this); movementModel.ResetGravity(); } }