Пример #1
0
        /************************************************************************************************************************/

        public override bool CanExitState(PlatformerCreatureState nextState)
        {
            return(Creature.Health.CurrentHealth > 0);
        }
Пример #2
0
        /************************************************************************************************************************/

        /// <summary>
        /// Returns false so that nothing can interript an attack until it is done.
        /// </summary>
        /// <remarks>
        /// If we had a Flinch state that gets triggered when the creature gets hit by an enemy, we would probably want
        /// it to be able to interrupt an attack. To do this, we could use an int or an enum like in the
        /// <see cref="InterruptableCreatureState.Priority"/> example.
        /// <para></para>
        /// We could just enter the Flinch state using <see cref="FSM.StateMachine{TState}.ForceSetState(TState)"/>,
        /// but then we would never be able to prevent it from triggering. For example, interacting with an object or
        /// doing something in a cutscene might use a state that should never be interrupted.
        /// </remarks>
        public override bool CanExitState(PlatformerCreatureState nextState)
        {
            return(false);
        }
Пример #3
0
        /************************************************************************************************************************/

        public override bool CanEnterState(PlatformerCreatureState previousState)
        {
            return(Creature.GroundDetector.IsGrounded);
        }