コード例 #1
0
        /// <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);
            }
        }
コード例 #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);
            }
        }