Exemplo n.º 1
0
 public void RegisterAction(DrawableAction action)
 {
     if (_actions.Contains(action) == false)
     {
         action.OnClick.AddListener(() => OnActionClicked(action));
         _actions.Add(action);
     }
 }
Exemplo n.º 2
0
        private void OnActionClicked(DrawableAction action)
        {
            var selectionController = ApplicationController.Instance.SelectionController;

            switch (action.Type)
            {
            case DrawableAction.ActionType.RotateLeft:
                selectionController.RotateSelection(true);
                UpdatePos();
                break;

            case DrawableAction.ActionType.RotateRight:
                selectionController.RotateSelection(false);
                UpdatePos();
                break;

            case DrawableAction.ActionType.Delete:
                selectionController.DeleteSelectedObjects();
                TogglePopup(false);
                break;
            }
        }