// ----------
    void Start()
    {
        // プレイデータのクリア
        PlayData.Init();
        // ランキング名はセットする (一度プレイ後のスタート画面に戻った時)
        inputField.text = PlayData.rankingName;

        // 最初はボタンを無効に
        startButton.interactable = false;

        // BGM
        BgmManager.Play("TheLaboratory");

        verText.text = "Ver." + Application.version;

        // 名前を入力されたら、ボタンを有効に
        SetOnceCall(() => string.IsNullOrEmpty(PlayData.rankingName) == false,
                    () => startButton.interactable = true);
    }
Esempio n. 2
0
    // <int, 새로만든 구조체> dic~~

    private DataManager()
    {
        Initialize();

        PlayData.Init();
    }
    void UserModeInit()
    {
        YellowBean.SoundManager.Instance.PlayBgm("Heroes of Legend (no loop)", true, 0.2f);
        userModeDesc.Init(-99, null, null, null, null, null);
        sortToggle.Toggle(-99);

        // 모드 선택 창 => 유저 모드 선택.
        // 로그인을 한다.
        Login(() =>
        {
            Vector2 moveValue = rtUserMode.anchoredPosition;
            rtUI.DOAnchorPos(-moveValue, duration);
        });

        btnOnlineModeBack.onClick.AddListener(() =>
        {
            YellowBean.SoundManager.Instance.PlayBgm("Whistle Fairy", true, 0.5f);
        });

        // 정렬 버튼
        btnLike.onClick.AddListener(() =>
        {
            GetStages((int)YBEnum.eSortType.Like);
        });
        btnClearCnt.onClick.AddListener(() =>
        {
            GetStages((int)YBEnum.eSortType.ClearCnt);
        });
        btnScore.onClick.AddListener(() =>
        {
            GetStages((int)YBEnum.eSortType.Score);
        });
        btnDate.onClick.AddListener(() =>
        {
            GetStages((int)YBEnum.eSortType.Date);
        });

        btnOption2.onClick.AddListener(() =>
        {
            option.SetActive(true);
        });


        // 맵 만들기
        btnCreateStage.onClick.AddListener(() =>
        {
            UnityAnalyticsManager.GetInstance().OnClickCreateMap();
            PlayData.Init();
            PlayData.Mode = PlayData.ePlayMode.Editor;

            App.Instance.LoadScene(mapSelectSceneName);
        });

        btnUserModePlay.onClick.AddListener(() =>
        {
            UnityAnalyticsManager.GetInstance().OnClickButton();
            if (PlayData.id != -1)
            {
                DoPlay(PlayData.id);
            }
        });

        btnRanking.onClick.AddListener(() =>
        {
            GetRank();
            // GetMyRank();

            Vector2 moveValue = rtRanking.anchoredPosition;
            rtUI.DOAnchorPos(-moveValue, duration);
        });
    }
Esempio n. 4
0
    public void Awake()
    {
        gpgsManager = FindObjectOfType <GPGSManager>();

        if (btnClose != null)
        {
            btnClose.onClick.AddListener(() =>
            {
                if (this.goCredit != null)
                {
                    this.goCredit.SetActive(false);
                }

                if (this.goNewGame != null)
                {
                    this.goNewGame.SetActive(false);
                }

                this.gameObject.SetActive(false);

                Time.timeScale = 1f;
            });
        }

        if (btnRestart != null)
        {
            btnRestart.onClick.AddListener(() =>
            {
                Time.timeScale = 1f;

                if (App.Instance != null)
                {
                    App.Instance.LoadScene(reStartSceneName);
                }
            });
        }

        if (btnBack != null)
        {
            btnBack.onClick.AddListener(() =>
            {
                Time.timeScale = 1f;

                if (App.Instance != null)
                {
                    App.Instance.LoadScene(backSceneName);
                }
            });
        }


        if (btnNewGame)
        {
            btnNewGame.onClick.AddListener(() =>
            {
                goNewGame.SetActive(true);
            });

            btnNewGameOK.onClick.AddListener(() =>
            {
                DataManager.GetInstance().CreateUserData();
                Protocol.token = null;
                this.gpgsManager.SignOut();
                PlayData.Init();
                App.Instance.LoadScene("4. Mode Select");
            });

            btnNewGameNo.onClick.AddListener(() =>
            {
                goNewGame.SetActive(false);
            });
        }

        if (btnCredit)
        {
            btnCredit.onClick.AddListener(() => {
                goCredit.SetActive(true);
            });

            btnCrediExit.onClick.AddListener(() => {
                goCredit.SetActive(false);
            });
        }
    }