Ejemplo n.º 1
0
    void OnGUI()
    {
        if (!gui_enabled)
        {
            return;
        }

        GuiService.update();
    }
Ejemplo n.º 2
0
    void Start()
    {
        GuiService.init(gameObject);

        initBgmSlider();
        initSeSlider();

/*
 *      Observable.Zip(
 *          //MessageBroker.Default.Receive<CreatedPlayerService>(),
 *          //MessageBroker.Default.Receive<CreatedEnemyService>(),
 *          MessageBroker.Default.Receive<CreatedPlayerService>(),
 *          MessageBroker.Default.Receive<CreatedEquipBaseResouces>(),
 *          MessageBroker.Default.Receive<LogInitialized>(),
 *          Tuple.Create
 *      ).Subscribe(x => {
 *          //LogService.write("GuiManager::Awake()::Receive<3>");
 *          enable();
 *
 *          MessageBroker.Default.Publish<CreatedGUI>(new CreatedGUI());
 *      });
 */
        //LogService.write("GuiManager::Start()::Publish<CreatedGUI>");
        //MessageBroker.Default.Publish<CreatedGUI>(new CreatedGUI());

        enable();
        GuiService.modeChange(GuiState.Title);

        MessageBroker.Default.Receive <ChangeGuiMode>().Subscribe(x => {
            GuiService.modeChange(x.mode);
        });

        MessageBroker.Default.Receive <EnableGui>().Subscribe(x => {
            if (x.enable)
            {
                enable();
            }
            else
            {
                disable();
            }
        });

        MessageBroker.Default.Receive <SaveEnd>().Subscribe(x => {
            if (!scene_change_title)
            {
                return;
            }
            scene_change_title = false;
            applySceneChangeTitle();
        });
    }
Ejemplo n.º 3
0
    public void applySceneChangeTitle()
    {
        Debug.Log("MessageBroker.Default.Publish<SceneChangeSingle>()");
        Time.timeScale = 0f;

        MessageBroker.Default.Publish <SceneChangeSimple>(new SceneChangeSimple {
            add_scene = "Title",
            del_scene = UnityEngine.SceneManagement.SceneManager.GetActiveScene().name,

            pre_action = () => {
                // GUI表示をタイトル画面に切り替え
                GuiService.modeChange(GuiState.Title);

                // 設定画面表示を消去
                toggle_settings_dialog();

                // NextRoomを消去
                EffectService.nextRoomClear();

                // 地面に落ちてる装備品を削除
                EquipService.ClearTarget();
                EquipService.destroyEquipItem();

                // 装備品リストをクリア
                EquipService.clear();

                // 家具配置範囲再初期化
                EffectiveFloorService.reset();

                // 家具再初期化
                FieldObjectService.clear();

                // 敵削除
                EnemyService.destroyEnemyDead();
                EnemyService.destroyEnemy();
                EnemyService.stopSpawn();
            },

            post_action = () => {
                Time.timeScale = 1f;
            }
        });
    }
Ejemplo n.º 4
0
 public void disable()
 {
     //Debug.Log("GuiManager::disable() : start");
     GuiService.unDisplay();
     gui_enabled = false;
 }
Ejemplo n.º 5
0
 public void enable()
 {
     //Debug.Log("GuiManager::enable() : start");
     GuiService.display();
     gui_enabled = true;
 }