public void DoAction(PlatformerMotor2D motor, TriggerAction action, bool exitFreeMode)
        {
            switch (action)
            {
            case TriggerAction.EnableRestrictedAreaIfFreemode:
                if (motor.motorState == PlatformerMotor2D.MotorState.FreedomState)
                {
                    motor.EnableRestrictedArea();
                }
                break;

            case TriggerAction.EnableRestrictedArea:
                motor.EnableRestrictedArea();
                break;

            case TriggerAction.DisableRestrictedAreaIfFreemode:
                if (motor.motorState == PlatformerMotor2D.MotorState.FreedomState)
                {
                    motor.DisableRestrictedArea();
                }
                break;

            case TriggerAction.DisableRestrictedArea:
                motor.DisableRestrictedArea();
                break;
            }

            if (exitFreeMode)
            {
                if (motor.motorState == PlatformerMotor2D.MotorState.FreedomState)
                {
                    motor.FreedomStateExit();
                }
            }
        }
        public void DoAction(PlatformerMotor2D motor, TriggerAction action, bool exitFreeMode)
        {
            switch(action) {
            case TriggerAction.EnableRestrictedAreaIfFreemode:
                if (motor.motorState == PlatformerMotor2D.MotorState.FreedomState) {
                    motor.EnableRestrictedArea();
                }
                break;
            case TriggerAction.EnableRestrictedArea:
                motor.EnableRestrictedArea();
                break;
            case TriggerAction.DisableRestrictedAreaIfFreemode:
                if (motor.motorState == PlatformerMotor2D.MotorState.FreedomState) {
                    motor.DisableRestrictedArea();
                }
                break;
            case TriggerAction.DisableRestrictedArea:
                motor.DisableRestrictedArea();
                break;
            }

            if (exitFreeMode)
            {
                if (motor.motorState == PlatformerMotor2D.MotorState.FreedomState)
                {
                    motor.FreedomStateExit();
                }
            }
        }