Ejemplo n.º 1
0
        private void OnTriggerExit(Collider other)
        {
            var colInfo = new TreeCollider.CollisionInfo
            {
                collidedWith   = other.gameObject,
                collisionState = TreeCollider.CollisionInfo.CollisionState.stay,
                isTrigger      = true,
                otherCollider  = other,
                sender         = gameObject
            };

            onTriggerExit?.Invoke(colInfo);
            OnTriggerExitEvent?.Invoke(colInfo);
        }
Ejemplo n.º 2
0
        private void OnCollisionStay(Collision collision)
        {
            var colInfo = new TreeCollider.CollisionInfo
            {
                collidedWith   = collision.gameObject,
                collision      = collision,
                collisionState = TreeCollider.CollisionInfo.CollisionState.stay,
                isTrigger      = false,
                otherCollider  = collision.collider,
                sender         = gameObject
            };

            onCollisionStay?.Invoke(colInfo);
            OnCollisionStayEvent?.Invoke(colInfo);
        }