/// <summary>
        /// Handles the event when the character triggers the ground
        /// </summary>
        public void Handle(OnGrounded @event)
        {
            _locomotionHandler.ChangeDetectionCollisionMode(CollisionDetectionMode2D.Discrete);
            _locomotionHandler.SetGroundGravityScale();
            _locomotionHandler.Stop();

            if (isJustEntered)
            {
                isJustEntered = false;
                ToggleStateMachineContexts(true);
                ToggleControls(true);
            }
        }
Esempio n. 2
0
        void OnTriggerEnter2D(Collider2D collision)
        {
            if (collision.CompareTag(Tags.CharactersTrigger))
            {
                _locomotionHandler.Stop();
            }

            if (collision.CompareTag(Tags.Hitbox))
            {
                if (GetInjured(collision))
                {
                    return;
                }
            }

            if (_throwingObjectBehavior != null)
            {
                _throwingObjectBehavior.OnTriggerEnter2D(collision);
            }
        }