Beispiel #1
0
        protected override void _StartAction(RPGCharacterController controller, HitContext context)
        {
            int     hitNumber     = context.number;
            Vector3 direction     = context.direction;
            float   force         = context.force;
            float   variableForce = context.variableForce;

            if (hitNumber == -1)
            {
                hitNumber = AnimationData.RandomHitNumber("Knockback");
                direction = AnimationData.HitDirection("Knockback", hitNumber);
                direction = controller.transform.rotation * direction;
            }
            else
            {
                if (context.relative)
                {
                    direction = controller.transform.rotation * direction;
                }
            }

            controller.GetAngry();
            controller.Knockback(hitNumber);
            movement.KnockbackForce(direction, force, variableForce);
            movement.currentState = RPGCharacterState.Knockback;
        }