Пример #1
0
        private void CollisionExit(Collision collision, BodyColliderProperty bodyCollider)
        {
            if (collision.transform.root == bodyCollider.BaseTransform)
            {
                return;
            }

            bodyCollider.m_onGround = false;
        }
Пример #2
0
        private void CollisionStay(Collision collision, BodyColliderProperty bodyCollider)
        {
            if (collision.transform.root == bodyCollider.BaseTransform)
            {
                return;
            }

            CheckIsGround(collision, bodyCollider);
        }
Пример #3
0
        private void CheckIsGround(Collision collision, BodyColliderProperty bodyCollider)
        {
            foreach (var contact in collision.contacts)
            {
                if (SurfaceWithinAngle(contact, Vector3.up, 50f))
                {
                    bodyCollider.m_onGround = true;
                    return;
                }
            }

            bodyCollider.m_onGround = false;
        }
Пример #4
0
 private void TriggerExit(Collider collider, BodyColliderProperty bodyCollider)
 {
 }
Пример #5
0
 private void TriggerStay(Collider collider, BodyColliderProperty bodyCollider)
 {
 }