コード例 #1
0
        public override void SetState(OptionsMenuModel model, Func <string, string> l)
        {
            _resume.text = l("resume");

            _restart.text = l("restart");
            _restart.gameObject.SetActive(model.MenuState == MenuId.Playing);

            _changeParachute.gameObject.SetActive(model.MenuState == MenuId.Playing);
            _changeParachute.text = l("change_parachute");

            _startSelection.text = l("start_selection");
            _startSelection.gameObject.SetActive(model.MenuState == MenuId.Playing);

            _options.text = l("options");

            _tutorial.text = l("tutorial");

            _mainMenu.text = l("main_menu");
            _mainMenu.gameObject.SetActive(model.MenuState == MenuId.StartSelection);

            _credits.gameObject.SetActive(model.MenuState != MenuId.Playing);
            _credits.text = l("credits");

            _followUs.gameObject.SetActive(model.MenuState != MenuId.Playing);
            _followUs.text = l("follow_us");

            _quit.text = l("quit");

            UiNavigation.ResolveExplicitNavigation(_selectables);
        }
コード例 #2
0
        public override void SetState(OptionsMenuModel model, Func <string, string> l)
        {
            _title.text = l("audio");
            _settingsContainer.SetState(l);
            _restoreDefaults.text = l("restore_defaults");
            _back.text            = l("back");

            UiNavigation.ResolveExplicitNavigation(_selectables);
        }
コード例 #3
0
        public override void SetState(OptionsMenuModel model, Func <string, string> l)
        {
            _title.text          = l("options");
            _graphics.text       = l("graphics");
            _input.text          = l("input");
            _gameplay.text       = l("gameplay");
            _audio.text          = l("audio");
            _timeAndWeather.text = l("time_and_weather");
            _other.text          = l("other");
            _back.text           = l("back");

            UiNavigation.ResolveExplicitNavigation(_selectables);
        }
コード例 #4
0
        public override void SetState(OptionsMenuModel model, Func <string, string> l)
        {
            _title.text = l("input");

            if (model.InputBindings != null)
            {
                if (!_isInputBindingsInitialized)
                {
                    _inputBindingViews = new InputBindingView[model.InputBindings.Length];
                    for (int i = 0; i < model.InputBindings.Length; i++)
                    {
                        var inputBinding     = model.InputBindings[i];
                        var inputBindingView = Instantiate(_inputBindingPrefab).GetComponent <InputBindingView>();
                        inputBindingView.transform.SetParent(_inputBindingsContainer.transform, worldPositionStays: false);
                        inputBindingView.transform.localScale = Vector3.one;
                        inputBindingView.OnSubmit            += () => model.StartRebind(inputBinding);
                        _inputBindingViews[i] = inputBindingView;
                    }
                    var bindingViews = _inputBindingViews.Select(v => v as Selectable);
                    var settingViews = _settingsContainer.GuiComponents
                                       .Select(g => g.NavigationElement);
                    var buttons = new[] {
                        _restoreDefaults.Button,
                        _back.Button
                    };
                    _selectables = bindingViews.Concat(settingViews).Concat(buttons).ToList();
                    _isInputBindingsInitialized = true;
                }

                var rebindingText = l("press_to_bind") + " (" + l("press_escape_to_cancel") + ")";
                for (int i = 0; i < model.InputBindings.Length; i++)
                {
                    var inputBinding     = model.InputBindings[i];
                    var inputBindingView = _inputBindingViews[i];
                    var isRebinding      = model.Rebinding.HasValue && model.Rebinding.Value.Id == inputBinding.Id;
                    inputBindingView.SetState(inputBinding, isRebinding, rebindingText);
                }
            }

            _settingsContainer.SetState(l);

            _back.text            = l("back");
            _restoreDefaults.text = l("restore_defaults");

            UiNavigation.ResolveExplicitNavigation(_selectables);
        }
コード例 #5
0
        public override void SetState(OptionsMenuModel model, Func <string, string> l)
        {
            _title.text         = l("graphics");
            _pleaseRestart.text = l("please_restart");
            if (model.NeedsRestart)
            {
                ShowText(_pleaseRestart);
            }
            else
            {
                HideText(_pleaseRestart);
            }
            _settingsContainer.SetState(l);
            _restoreDefaults.text = l("restore_defaults");
            _apply.text           = l("apply");
            _apply.gameObject.SetActive(model.IsApplyGraphicsSettingsRequired);
            _back.text = l("back");

            UiNavigation.ResolveExplicitNavigation(_selectables);
        }
コード例 #6
0
        public void SetState(Func <string, string> l)
        {
            _settingsContainer.SetState(l);

            UiNavigation.ResolveExplicitNavigation(_selectables);
        }
コード例 #7
0
 public void Open(Action onClose)
 {
     this.gameObject.SetActive(true);
     UiNavigation.ResolveExplicitNavigation(_selectables);
 }