示例#1
0
    public void OnButtonSelect(SelectableButton _button)
    {
        if (SolutionState != PuzzleState.Unsolved)
        {
            return;
        }

        // Labled Button;
        foreach (var button in LabledButtons)
        {
            if (button == _button)
            {
                buttonHits++;
                TurbineButtonData data = button.InputData as TurbineButtonData;
                SetEValues(data.E1Modifier, data.E2Modifier, data.E3Modifier, data.E4Modifier);
            }
        }

        // Reset Button
        if (_button == resetButton)
        {
            CheckIfSolved();
        }
        if (SolutionState == PuzzleState.Unsolved)
        {
            selectable.Select();
        }
    }
示例#2
0
    public void OnButtonSelect(SelectableButton _button)
    {
        InputValue value = (_button.InputData as PuzzleAutopilotInputData).Actualvalue;

        selectable.Select();
        CompareInputWithSolution(value);
    }
示例#3
0
    public void OnButtonSelect(SelectableButton _button)
    {
        if (SolutionState != PuzzleState.Unsolved)
        {
            selectable.Select();
            return;
        }

        if (!Interactables.OutputMonitor.isInteractionTime)
        {
            ApplyError();
        }
        else
        {
            if ((_button.InputData as ButtonData).Type != currentSetup.ButtonToPress)
            {
                ApplyError();
            }
            else
            {
                ApplySucces();
            }
        }

        if (SolutionState == PuzzleState.Unsolved)
        {
            selectable.Select();
        }
    }
示例#4
0
    public void OnButtonSelect(SelectableButton _button)
    {
        if (SolutionState != PuzzleState.Unsolved)
        {
            selectable.Select();
            return;
        }

        PuzzleGPSNumericData data           = _button.InputData as PuzzleGPSNumericData;
        PuzzleGPSMonitorData coordinateData = currentSelectedMonitor.InputData as PuzzleGPSMonitorData;

        selectable.Select();
        if (data.ActualValue < 10)
        {
            if (coordinateData.coordinateValue < 10)
            {
                coordinateData.coordinateValue *= 10;
                coordinateData.coordinateValue += data.ActualValue;
                currentSelectedMonitor.TypeOn(coordinateData.coordinateValue.ToString());
            }
        }
        else if (data.ActualValue == 10)
        {
            coordinateData.coordinateValue /= 10;
            currentSelectedMonitor.TypeOn(coordinateData.coordinateValue.ToString());
        }
        else if (data.ActualValue == 11)
        {
            CheckIfSolved();
        }
    }
示例#5
0
    public void ShowAccessoryList(CharacterData character)
    {
        MenuWindow.instance.focusWindow = this;
        MenuWindow.instance.menuGuide.Show("どの装飾を装備しますか");
        ClearEquipList();
        List <Accessory> accessorys = InventorySystem.GetEquipments().Where(x => x is Accessory).Select(x => x as Accessory).ToList();

        if (accessorys.Count == 0)
        {
            return;
        }
        foreach (var accessory in accessorys)
        {
            SelectableButton _selectableButton = Instantiate(selectableButton, list.transform);
            TextMeshProUGUI  buttonText        = _selectableButton.GetComponentInChildren <TextMeshProUGUI>();
            buttonText.text = accessory.name;
            _selectableButton.onClick.AddListener(() =>
            {
                character.equip.accessory = accessory;
                equipSlot.ShowEqipSlot(character);
                equipParameter.ShowParameter(character);
                buttonText.text = "E " + accessory.name;
            });

            _selectableButton.onHover = (() =>
            {
                equipParameter.ShowParameter(character, accessory);
                description.text = accessory.description;
            });
            _selectableButton.transform.SetParent(list.transform);
            selectableButtons.Add(_selectableButton);
        }
        selectableButtons[0].Select();
    }
示例#6
0
    public void OnButtonSelect(SelectableButton _button)
    {
        ClusterButtonData btn = _button.InputData as ClusterButtonData;

        if (!checkPressed && btn.BtnType == ClusterButton.Check)
        {
            StartSequences();
        }
        else
        {
            if (buttonToSolve.Contains(btn.BtnType))
            {
                buttonToSolve.Remove(btn.BtnType);
                switch (btn.BtnType)
                {
                case ClusterButton.A1:
                    Interactables.A1_Screen.material = data.ScreenOffMat;
                    break;

                case ClusterButton.A2:
                    Interactables.A2_Screen.material = data.ScreenOffMat;
                    break;

                case ClusterButton.A3:
                    Interactables.A3_Screen.material = data.ScreenOffMat;
                    break;

                case ClusterButton.B4:
                    Interactables.B4_Screen.material = data.ScreenOffMat;
                    break;

                case ClusterButton.B5:
                    Interactables.B5_Screen.material = data.ScreenOffMat;
                    break;

                case ClusterButton.B6:
                    Interactables.B6_Screen.material = data.ScreenOffMat;
                    break;

                case ClusterButton.Check:
                    break;
                }
                if (buttonToSolve.Count == 0)
                {
                    DoWin();
                }
            }
            else
            {
                misstakes++;
                SetNewSequence();
            }
        }

        if (SolutionState != PuzzleState.Solved)
        {
            selectable.Select();
        }
    }
示例#7
0
 public void BindSelectable(SelectableButton selectable)
 {
     if (_selectableButtons == null)
     {
         _selectableButtons = new List <SelectableButton>();
     }
     _selectableButtons.Add(selectable);
 }
示例#8
0
    public void OnButtonSelect(SelectableButton _button)
    {
        if (!IsAlarmActive)
        {
            selectable.Select();
            return;
        }

        switch (solutionIndex)
        {
        case 0:
            if (chosenSetup.Seq1_First == (_button.InputData as PuzzleALARM_inputData).value)
            {
                solutionIndex++;
            }
            break;

        case 1:
            if (chosenSetup.Seq1_Second == (_button.InputData as PuzzleALARM_inputData).value)
            {
                solutionIndex++;
            }
            break;

        case 2:
            if (chosenSetup.Seq2_First == (_button.InputData as PuzzleALARM_inputData).value)
            {
                solutionIndex++;
            }
            break;

        case 3:
            if (chosenSetup.Seq2_Second == (_button.InputData as PuzzleALARM_inputData).value)
            {
                solutionIndex++;
            }
            break;

        case 4:
            if (chosenSetup.Button_Last == (_button.InputData as PuzzleALARM_inputData).value)
            {
                solutionIndex++;
            }
            CheckIfSolved();
            break;

        default:
            CheckIfSolved();
            break;
        }

        if (SolutionState != PuzzleState.Solved)
        {
            selectable.Select();
        }
    }
示例#9
0
 public void OnButtonEnter(SelectableButton selectable)
 {
     ResetButtons();
     if (_selectedButton != null && _selectedButton == selectable)
     {
         return;
     }
     selectable.ButtonImage.color = _hoverColor;
     selectable.ChangeInImageColor(_spriteHoverColor);
 }
示例#10
0
 public void OnButtonSelect(SelectableButton _button)
 {
     if (CheckIfSolved())
     {
         DoWin();
     }
     else
     {
         DoLoose();
     }
 }
示例#11
0
 public void OnButtonDeselected(SelectableButton selectable)
 {
     if (_cantBeUnselected && _selectedButton == selectable)
     {
         return;
     }
     selectable.Deselect();
     DeselectFunction(selectable);
     _selectedButton = null;
     ResetButtons();
 }
示例#12
0
 private void FixColor(SelectableButton sb)
 {
     if (sb.IsSelected)
     {
         sb.Button.GetComponent <Image>().color = this.selectedColor;
     }
     else
     {
         sb.Button.GetComponent <Image>().color = this.notSelectedColor;
     }
 }
示例#13
0
    public void RegisterButton(Button button, Func <bool, bool> func)
    {
        SelectableButton sb = new SelectableButton(button);

        button.onClick.AddListener(() =>
        {
            bool isSelected = func(sb.IsSelected);
            sb.IsSelected   = isSelected;
            this.FixColor(sb);
        });
    }
示例#14
0
    public void selectButton(SelectableButton button)
    {
        if (!button.Equals(selectedButton))
        {
            button.Selected         = true;
            selectedButton.Selected = false;
            selectedButton          = button;

            creatureBuilder.SelectedPart = buttonMap[button];
        }
    }
        private void OnButtonSelected(SelectableButton selectedButton)
        {
            if (selectedButton != null)
            {
                SelectedState = selectedButton.State;

                foreach (SelectableButton button in ButtonList)
                {
                    button.IsSelected = false;
                }

                selectedButton.IsSelected = true;
            }
        }
示例#16
0
    private void DestroyButton(SelectableButton button)
    {
        int index = button.index;

        Destroy(button.gameObject);
        productButtons.RemoveAt(button.index);
        if (productButtons.Count == 0)
        {
            productDescription.text = string.Empty;
            return;
        }
        for (int i = 0; i < productButtons.Count; i++)
        {
            productButtons[i].button.index = i;
        }
        int selectIndex = Mathf.Clamp(index - 1, 0, int.MaxValue);

        productButtons[selectIndex].button.Select();
    }
        private void InitGUI()
        {
            //Character Select
            List <ParamCharaController> controllers = DBControllerManager.GetAllController();

            charaSelect = new CharaSelect(DBControllerManager._controllers, "No character loaded", 0, 25);

            //Enbale Checkbox
            controllEnable = new ToggleEnabled("Enable controller", false);

            //Coordinate Select
            ChaFileDefine.CoordinateType[] coordinateList = new ChaFileDefine.CoordinateType[]
            {
                ChaFileDefine.CoordinateType.School01,
                ChaFileDefine.CoordinateType.School02,
                ChaFileDefine.CoordinateType.Gym,
                ChaFileDefine.CoordinateType.Swim,
                ChaFileDefine.CoordinateType.Club,
                ChaFileDefine.CoordinateType.Plain,
                ChaFileDefine.CoordinateType.Pajamas,
            };
            List <string> coordinateStringList = new List <string>();

            for (int i = 0; i < coordinateList.Count(); i++)
            {
                coordinateStringList.Add(coordinateList[i].ToString());
            }
            coordinateSelect = new CoordinateSelect(coordinateStringList.ToArray(), coordinateList, "", 175, 25);

            //State Select
            kindSelect = new SelectableButton <ParamCharaController.ParamsKind>(Color.cyan);

            //Parameter editors
            editorBust = new EditorBust();
            editorHip  = new EditorHip();

            //Tools Window
            tools = new ToolsWindow(_toolsWindowId, _s_dialogID, this);

            //GUI Style
            styleMatchState             = new GUIStyle(Skin.defaultSkin.button);
            styleMatchState.fixedHeight = 25;
        }
示例#18
0
    public void OnButtonSelected(SelectableButton selectable)
    {
        //if (selectable.InteractableWhenSelected)

        if (_selectedButton != null)
        {
            _selectedButton.Deselect();
            DeselectFunction(_selectedButton);
            _selectedButton = null;
        }

        ResetButtons();

        _selectedButton = selectable;
        selectable.ButtonImage.color = _selectedColor;
        selectable.ChangeInImageColor(_spriteSelectedColor);
        selectable.Select();
        SelectFunction(selectable);
    }
示例#19
0
    public void ShowWeaponList(CharacterData character)
    {
        //クリック 武器を装備 パラメータを更新 スロットを更新 リストアイテムを更新(E)
        //ホバー  説明を表示 パラメータを変更
        //外す   武器を外す パラメータを更新 スロットを更新 リストアイテムを更新(E)
        MenuWindow.instance.focusWindow = this;
        MenuWindow.instance.menuGuide.Show("どの武器を装備しますか");
        ClearEquipList();
        List <Weapon> weapons = InventorySystem.GetEquipments().Where(x => x is Weapon).Select(x => x as Weapon).ToList();

        if (weapons.Count == 0)
        {
            return;
        }
        foreach (var weapon in weapons)
        {
            SelectableButton _selectableButton = Instantiate(selectableButton, list.transform);
            TextMeshProUGUI  buttonText        = _selectableButton.GetComponentInChildren <TextMeshProUGUI>();
            buttonText.text = weapon.name;
            _selectableButton.onClick.AddListener(() =>
            {
                character.equip.weapon = weapon;
                equipSlot.ShowEqipSlot(character);
                equipParameter.ShowParameter(character);
                buttonText.text = "E " + weapon.name;
            });

            _selectableButton.onHover = (() =>
            {
                equipParameter.ShowParameter(character, weapon);
                description.text = weapon.description;
            });
            //_selectableButton.transform.SetParent(list.transform);
            selectableButtons.Add(_selectableButton);
        }
        selectableButtons[0].Select();
    }
示例#20
0
    public void Show()
    {
        CloseWindow();

        member = Party.GetMember();

        for (int i = 0; i < member.Count; i++)
        {
            CharacterSlot characterSlot = Instantiate(characterSlotPrefab, list.gameObject.transform);
            characterSlot.playerCharacter = member[i];
            characterSlot.Show();

            SelectableButton selectItem = characterSlot.selectableButton;
            selectItem.index = i;

            //characterSlot.transform.SetParent(list.transform);

            characterSlots.Add(characterSlot);

            selectItems.Add(characterSlot.selectableButton);
        }

        RegisterNavigation();
    }
示例#21
0
 public void OnButtonSelect(SelectableButton _button)
 {
     throw new System.NotImplementedException();
 }
示例#22
0
 public void SelectButton(SelectableButton button)
 {
     editor.SelectedTool = buttonMap[button];
 }
示例#23
0
 private void Start()
 {
     selectable = GetComponent <SelectableButton>();
 }
示例#24
0
 private void DeselectFunction(SelectableButton selectable)
 {
 }
示例#25
0
 public void OnButtonExit(SelectableButton selectable)
 {
     ResetButtons();
 }