protected void OnCollisionEnter(Collision collision) { KillableInterface ki = collision.gameObject.GetComponent <KillableInterface>(); if (ki != null) { ki.Damage(damageOnTouch * Time.fixedDeltaTime); } }
private void OnCollisionStay(Collision collision) { KillableInterface ki = collision.gameObject.GetComponent<KillableInterface>(); simpleAIMoveTo ai = collision.gameObject.GetComponent<simpleAIMoveTo>(); if (ki != null && ai == null) { ki.Damage(damageOnTouch * Time.fixedDeltaTime); } if (collision.contacts[0].normal.y > 0) { onGround = true; } }