Beispiel #1
0
        public void AddVariableOnContextMenuItem(MenuButton sender)
        {
            switch (_addVariableStep)
            {
            case AddVariableSteps.SetType:
            {
                if (!_addVariableTypeMenuButtons.ContainsKey(sender))
                {
                    return;
                }

                _addVariableType = _addVariableTypeMenuButtons[sender];
                _contextMenu.gameObject.SetActive(false);

                IVariable newVariable = null;

                if (_addVariableType == ValueType.Bool)
                {
                    newVariable = new BoolVariable();
                }
                else
                {
                    newVariable = new FloatVariable();
                }

                _addVariableStep = AddVariableSteps.SetName;
                _mainController.SetVariableNameFromDialog(newVariable);
            }
            break;
            }
        }
Beispiel #2
0
        public void AddOnVariablesPanel()
        {
            switch (_addBlockStep)
            {
            case AddBlockSteps.SetTarget:
            {
                _isAddBlock = false;

                _contextMenu.ClearContextMenu();
                SetAddVariableTypeMenuItems();
                _contextMenu.gameObject.SetActive(true);

                _addVariableStep = AddVariableSteps.SetType;
            }
            break;
            }
        }
Beispiel #3
0
 public void AddInit()
 {
     _addBlockStep    = AddBlockSteps.SetTarget;
     _addVariableStep = AddVariableSteps.SetType;
 }