예제 #1
0
        public Vector2 GetRawVelocity()
        {
            LZFighterFrame     frame     = CurrentFrame;
            LZFighterStateData state     = CurrentStateData;
            StateMachineNode   stateNode = stateMachine.CurrentState;

            return(frame.velocity + state.velocity + stateNode.velocity);
        }
예제 #2
0
        public Vector2 GetVelocity()
        {
            LZFighterFrame     frame     = CurrentFrame;
            LZFighterStateData state     = CurrentStateData;
            StateMachineNode   stateNode = stateMachine.CurrentState;
            Vector2            velocity  = frame.velocity + state.velocity + stateNode.velocity;

            velocity *= internalVelocityStrength;

            if (velocityModifier != null)
            {
                foreach (var modifier in velocityModifier.GetInvocationList())
                {
                    velocity = (Vector2)modifier.DynamicInvoke(velocity);
                }
                //velocity /= velocityModifier.GetInvocationList().Length + 1f;
            }

            if (invertHorizontal)
            {
                velocity = new Vector2(-velocity.x, velocity.y);
            }
            return(velocity);
        }
예제 #3
0
        public void RemoveState(StateMachineNode state)
        {
            int index = states.FindIndex((s) => s == state);

            RemoveState(index);
        }