Esempio n. 1
0
        private void OnEnable()
        {
            if (event_system_ == null)
            {
                event_system_ = EventSystem.current;
            }

            FirstTouchSelectable.Select(event_system_, first_touch_object_);
        }
Esempio n. 2
0
        public void OpenMenu()
        {
            // メニューを開く
            foreach (var menu in opened_menu_)
            {
                menu.SetActive(true);
            }

            FirstTouchSelectable.Select(event_system_, ui_controllers_[0].button_to_open_the_menu_);
        }
Esempio n. 3
0
        // Start is called before the first frame update
        private void Start()
        {
            event_system_ = EventSystem.current;

            current_buttom = event_system_.firstSelectedGameObject;

            SelectedOptionButtonSettings();

            return_option_scene_ += () => { FirstTouchSelectable.Select(event_system_, ui_controllers_[0].button_to_open_the_menu_); };

            appManager_ = FindObjectOfType <ApplicationManager>();

            OnStart();
        }
        protected override void OnUpdate()
        {
            // タイトルへが押されていたら処理しない
            if (!appManager_.IsInput)
            {
                return;
            }
            //if (IsGoToTitle) return;

            // メニュー開閉
            if (Input.GetButtonDown(Constants.InputName.PAUSE) && is_opened_and_closed_)
            {
                // メニュー画面を開いている間、時間を止める
                Time.timeScale = (opened_menu_[0].activeSelf) ? 1f : 0f;
                print(Time.timeScale);

                if (opened_menu_[0].activeSelf)
                {
                    // 開いているならバックのSE再生
                    AudioManager.Instance.Play2DSE(gameObject, SEPath.COMMON_SE_BACK);
                }
                else
                {
                    // 閉じてるならポーズのSE再生
                    AudioManager.Instance.Play2DSE(gameObject, SEPath.GAME_SE_PAUSE);
                }


                // メニューを開いている場合は閉じる、閉じている場合は開く
                foreach (var menu in opened_menu_)
                {
                    menu.SetActive(!menu.activeSelf);
                    IsOpen = menu.activeSelf;
                }

                SetButtonActive(true);

                FirstTouchSelectable.Select(event_system_, ui_controllers_[0].button_to_open_the_menu_);
            }
        }
        /// <summary>
        /// メニューを閉じれるようにする
        /// </summary>
        public void AllowsTheMenuClose()
        {
            is_opened_and_closed_ = true;

            FirstTouchSelectable.Select(event_system_, ui_controllers_[0].button_to_open_the_menu_);
        }
Esempio n. 6
0
        // Start is called before the first frame update
        void Start()
        {
            event_system_ = EventSystem.current;

            FirstTouchSelectable.Select(event_system_, first_touch_object_);
        }