Esempio n. 1
0
        public void SwitchActionType(ActionType actionType, object sender)
        {
            // There is no point to change the action with itself
            if (_currentAction == Update2DModifier.CreateModifier(actionType))
            {
                return;
            }

            // The EditDetectionPipe is enabled only when the action is Action2d_Nothing
            if ((actionType != ActionType.Action2d_Nothing) && (actionType != ActionType.Action2d_EditShape))
            {
                _editDetectionPipe.OnNotification(PipeConstants.DisableDetectionPipe);
            }
            else
            {
                _editDetectionPipe.OnNotification(PipeConstants.EnableDetectionPipe);
            }

            log.DebugFormat("Switching action to {0}", actionType);
            if (_currentAction != null)
            {
                _currentAction.OnDeactivate();
            }
            _currentAction = Update2DModifier.CreateModifier(actionType);

            _currentAction.Setup(inputFactory);
            _currentAction.OnActivate();
        }
Esempio n. 2
0
 public static void RegisterAction(ActionType actionType, Action3d action)
 {
     _actions[actionType] = action;
 }