private void OnTriggerEnter2D(Collider2D other) { EntityStats es = other.GetComponent <EntityStats>(); if (es) { es.Fall(); } }
private void OnTriggerStay2D(Collider2D other) { if (other.CompareTag("Hole") && !entityStats.falling) { BoxCollider2D otherCol = other.GetComponent <BoxCollider2D>(); if (otherCol.bounds.Contains(boxCol.bounds.max) && otherCol.bounds.Contains(boxCol.bounds.max)) { entityStats.Fall(); } } }