Exemplo n.º 1
0
    public void Click()
    {
        if (type == TypeButton.HideInfo1 || type == TypeButton.HideInfo2 || type == TypeButton.HideHelper)
        {
            gameObject.transform.Rotate(0, 0, 180);
            switch (type)
            {
            case TypeButton.HideInfo1:
                AppRootStatic.SetActiveLabel(TypeLabel.AppMenuInfo1, !AppRootStatic.isActive(TypeLabel.AppMenuInfo1));
                break;

            case TypeButton.HideInfo2:
                AppRootStatic.SetActiveLabel(TypeLabel.AppMenuInfo2, !AppRootStatic.isActive(TypeLabel.AppMenuInfo2));
                break;

            case TypeButton.HideHelper:
                AppRootStatic.SetActiveLabel(TypeLabel.AppMenuHelp, !AppRootStatic.isActive(TypeLabel.AppMenuHelp));
                break;
            }
            return;
        }
        if (type == TypeButton.Task)
        {
            GetComponentInChildren <RawImage>().transform.Rotate(0, 0, 180);
        }
        AppRootStatic.OnButtonClick(type, type == TypeButton.Viewer ? NumberModel:0);
    }
Exemplo n.º 2
0
    private void ButtonInstrument()
    {
        if (AppRootStatic.isActive(TypeButton.PrevInstr) && AppRootStatic.isActive(TypeButton.NextInstr))
        {
            switch (UnityEngine.Mathf.Abs(Instrument))
            {
            case 0:
                AppRootStatic.SetButtonText(TypeButton.NextInstr, "Анемометр");
                AppRootStatic.SetButtonText(TypeButton.PrevInstr, "Гигрометр");
                break;

            case 1:
                AppRootStatic.SetButtonText(TypeButton.NextInstr, "Гигрометр");
                AppRootStatic.SetButtonText(TypeButton.PrevInstr, "Термометр");
                break;

            case 2:
                AppRootStatic.SetButtonText(TypeButton.NextInstr, "Термометр");
                AppRootStatic.SetButtonText(TypeButton.PrevInstr, "Анемометр");
                break;
            }
        }
    }
Exemplo n.º 3
0
    public void OnButtonClick(TypeButton _tb, int num_but = 0)
    {
        switch (_tb)
        {
        case TypeButton.Next:
            if (NumberRoom != 0 && NumberRoom != 5)
            {
                AppRootStatic.NextRoomNavigation();
            }
            NumberRoom++;
            ViewerActivWindow();
            break;

        case TypeButton.Back:
            if (NumberRoom != 6 && NumberRoom != 1)
            {
                AppRootStatic.PrevRoomNavigation();
            }
            NumberRoom--;
            ViewerActivWindow();
            break;

        case TypeButton.Metodics:
            AppRootStatic.SetActiveUI(TypeUI.AppMenu, false);
            AppRootStatic.SetActiveLabel(TypeLabel.Header, false);
            AppRootStatic.SetActiveLabel(TypeLabel.Info, false);
            AppRootStatic.SetActiveUI(TypeUI.Metodic, true);
            oWindows = false;
            break;

        case TypeButton.CloseMetodics:
            AppRootStatic.SetActiveUI(TypeUI.Metodic, false);
            ViewerActivWindow();
            break;

        case TypeButton.CloseApplication:
            AppRootStatic.SetActiveUI(TypeUI.AppMenu, false);
            AppRootStatic.SetActiveLabel(TypeLabel.Header, false);
            AppRootStatic.SetActiveLabel(TypeLabel.Info, false);
            AppRootStatic.SetActiveUI(TypeUI.Exit, true);
            oWindows = false;
            break;

        case TypeButton.YesExit:
            Application.Quit();
            break;

        case TypeButton.NoExit:
            AppRootStatic.SetActiveUI(TypeUI.Exit, false);
            ViewerActivWindow();
            break;

        case TypeButton.NextInstr:
            if (Instrument % 3 != 0)
            {
                return;
            }
            Instrument = (Instrument + 1) % 3;
            ButtonInstrument();
            AppRootStatic.NextTool();
            break;

        case TypeButton.PrevInstr:
            if (Instrument % 3 != 1)
            {
                return;
            }
            Instrument = (Instrument - 1) % 3;
            AppRootStatic.PrevuTool();
            ButtonInstrument();
            break;

        case TypeButton.Viewer:
            AppRootStatic.SetActiveUI(TypeUI.Metodic, false);
            AppRootStatic.SetActiveLabel(TypeLabel.Viewer, true);
            AppRootStatic.SetObjectViewer(num_but, true);
            ///просотр объектов!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            break;

        case TypeButton.CloseViewr:
            AppRootStatic.SetActiveUI(TypeUI.Metodic, true);
            AppRootStatic.SetActiveLabel(TypeLabel.Viewer, false);
            break;

        case TypeButton.Task:
            AppRootStatic.SetActiveLabel(TypeLabel.Task, !AppRootStatic.isActive(TypeLabel.Task));
            ///задачи
            break;
        }
    }