Exemplo n.º 1
0
    void Start()
    {
        anyKeyToStart.FadeInCompleted.Subscribe(_ => state = State.Active);

        saveDataManager.Init(() =>
        {
            if (!saveDataManager.PlayerNameInitiallized)
            {
                initName.Enter();
                initName.NameEntered.First().Subscribe(name =>
                {
                    saveDataManager.ChangePlayerName(name);
                    initName.Exit().Subscribe(_ =>
                    {
                        mainObj.SetActive(true);
                    });
                });
            }
            else
            {
                mainObj.SetActive(true);
            }
            soundVolumeChanger.ChangeSEVolume(saveDataManager.SEVolume);
            soundVolumeChanger.ChangeBGMVolume(saveDataManager.BGMVolume);
        });
    }