コード例 #1
0
ファイル: GameManager.cs プロジェクト: wakapippi/Tempest-Wave
        private void Update()
        {
            if (IsStarted && !Paused)
            {
                Dispensor.UpdateNote(Frame);
                Frame      += 60 * Time.deltaTime * FrameSpeed;
                FrameFixed += 60 * Time.deltaTime;
                if (IsPlaying)
                {
                    SongTime += 1 * Time.deltaTime;
                }
            }
            else if (!IsStarted && !HasError && (!BGA.isCustom || (BGA.isCustom && BGA.readyToPlay)))
            {
                StartPanel.SetActive(true);
                StartCount         += 1 * Time.deltaTime;
                StartCountText.text = Mathf.Ceil(3 - StartCount).ToString();
#if UNITY_ANDROID
                if (Social.localUser.authenticated)
                {
                    PlayGamesPlatform.Instance.ReportProgress(GPGSIds.achievement_your_first_step, 100.0f, null);
                }
#elif UNITY_IOS
                Achievementer.ReportProgress("YourFirstStep");
#endif
                if (StartCount >= 3f)
                {
                    PauseButton.interactable = true;
                    DataContainer.SetNoteCount(Dispensor.VisibleNoteCount);
                    IsStarted = true;
                    BGA.ResumeBGA();
                    BGA.SetStartFrame();
                    StartPanel.SetActive(false);
                }
            }
            if (IsEnded)
            {
                PauseButton.interactable = false;
                EndCount += 1 * Time.deltaTime;
                if (EndCount >= 3 && !EndPanel.activeSelf)
                {
                    EndPanel.SetActive(true);
                }
                if (EndCount >= 6)
                {
                    DataSender.SetGameResult(DataContainer);
                    SceneAnimate.Play("6LineCvFadeOut");
                    Screen.sleepTimeout = SleepTimeout.SystemSetting;
                    if (ScreenAdjusted)
                    {
                        Screen.SetResolution(PreservedWidth, PreservedHeight, Screen.fullScreen);
                    }
                    if (Mode.Equals(GameMode.Theater2P))
                    {
                        if (Application.platform.Equals(RuntimePlatform.Android) || Application.platform.Equals(RuntimePlatform.IPhonePlayer))
                        {
                            Screen.orientation = ScreenOrientation.Landscape;
                            Screen.orientation = ScreenOrientation.AutoRotation;
                        }
                        else if (Application.platform.Equals(RuntimePlatform.WindowsPlayer))
                        {
                            Screen.SetResolution(PreservedWidth, PreservedHeight, Screen.fullScreen);
                        }
                    }
                    changer.ChangeToScene("GameResult", 0.5f);
                }
            }
            if (IsEnded && DataContainer.GetMaxCombo() >= Dispensor.VisibleNoteCount && !FCFlag)
            {
                StartCoroutine(FullComboShow());
                FCFlag = true;
            }
        }
コード例 #2
0
        // Use this for initialization
        void Start()
        {
            data     = DataSender.ReturnGameResult();
            autoplay = DataSender.ReturnAutoPlay();
            j        = data.GetAllNoteDecision();
            allNote  = data.GetNoteCount();
            sc       = data.GetMaxScore();
            pc       = data.GetMaxPercent();

            song.text   = DataSender.ReturnSongName();
            miss.text   = j[0].ToString();
            bad.text    = j[1].ToString();
            nice.text   = j[2].ToString();
            great.text  = j[3].ToString();
            perf.text   = (j[4] + j[5]).ToString();
            all.text    = allNote.ToString();
            totcom.text = data.GetMaxCombo().ToString();
            if (j[5] > 0)
            {
                tpst.gameObject.SetActive(true);
                tpst.text = j[5].ToString();
            }
            totsco.text = sc.ToString();
            perc.text   = pc.ToString("N2") + "%";

            if (data.GetMaxCombo() >= allNote)
            {
                isFC = true;
                if ((j[4] + j[5]) >= allNote)
                {
                    isAP = true;
                    if ((j[4] + j[5]).Equals(j[5]))
                    {
                        isRT = true;
                    }
                }
            }

            if (!autoplay && allNote >= 500 && isFC && Social.localUser.authenticated)
            {
#if UNITY_ANDROID
                PlayGamesPlatform.Instance.ReportProgress(GPGSIds.achievement_sweety_fruition, 100.0f, null);
                PlayGamesPlatform.Instance.IncrementAchievement(GPGSIds.achievement_marginal_utility, 1, null);
                PlayGamesPlatform.Instance.IncrementAchievement(GPGSIds.achievement_voracity, 1, null);
#elif UNITY_IOS
                Achievementer.ReportProgress("sweetyfruit");
                Achievementer.ReportProgress("marginalutility", 5.0f);
                Achievementer.ReportProgress("voracity", 2.0f);
#endif
            }
            if (!autoplay && allNote >= 500 && isAP && Social.localUser.authenticated)
            {
#if UNITY_ANDROID
                PlayGamesPlatform.Instance.ReportProgress(GPGSIds.achievement_perfect_itself, 100.0f, null);
                PlayGamesPlatform.Instance.IncrementAchievement(GPGSIds.achievement_admirable, 1, null);
#elif UNITY_IOS
                Achievementer.ReportProgress("perfectitself");
                Achievementer.ReportProgress("admirable", 5.0f);
#endif
            }
            if (!autoplay && allNote >= 500 && isRT && Social.localUser.authenticated)
            {
#if UNITY_ANDROID
                PlayGamesPlatform.Instance.ReportProgress(GPGSIds.achievement_you_are_really_a_monster, 100.0f, null);
#elif UNITY_IOS
                Achievementer.ReportProgress("youaremonster");
#endif
            }
            if (!autoplay && allNote >= 300 && (j[0] + j[1] + j[2]).Equals(1) && Social.localUser.authenticated)
            {
#if UNITY_ANDROID
                PlayGamesPlatform.Instance.ReportProgress(GPGSIds.achievement_its_ok_dont_be_depressed, 100.0f, null);
#elif UNITY_IOS
                Achievementer.ReportProgress("itsok");
#endif
                if (j[2].Equals(1))
                {
#if UNITY_ANDROID
                    PlayGamesPlatform.Instance.IncrementAchievement(GPGSIds.achievement_discovering_science, 1, null);
                    PlayGamesPlatform.Instance.IncrementAchievement(GPGSIds.achievement_science_theory, 1, null);
                    PlayGamesPlatform.Instance.IncrementAchievement(GPGSIds.achievement_should_earn_a_nobel_prize, 1, null);
#elif UNITY_IOS
                    Achievementer.ReportProgress("science", 34.0f);
                    Achievementer.ReportProgress("theory", 10.0f);
                    Achievementer.ReportProgress("nobelprize", 4.0f);
#endif
                }
            }

            string tsl, tff, tsa; // tsl만 쓰임
            bool   tap, trw, tmi;
            DataSender.ResultPopOut(out tsl, out tff, out tap, out trw, out tmi, out tsa);
            float speed, sync;
            bool  hit, tpstb;
            int   flick;
            data.ResultPopOut(out speed, out sync, out hit, out tpstb, out flick);

            if (DataSender.ReturnGameMode().Equals(GameMode.Starlight))
            {
                gameMode.text = "5L STARLIGHT";
            }
            else if (DataSender.ReturnGameMode().Equals(GameMode.Theater2L))
            {
                gameMode.text = "2L THEATER (L)";
            }
            else if (DataSender.ReturnGameMode().Equals(GameMode.Theater2P))
            {
                gameMode.text = "2L THEATER (P)";
            }
            else if (DataSender.ReturnGameMode().Equals(GameMode.Theater4))
            {
                gameMode.text = "4L THEATER";
            }
            else if (DataSender.ReturnGameMode().Equals(GameMode.Theater))
            {
                gameMode.text = "6L THEATER";
            }
            else if (DataSender.ReturnGameMode().Equals(GameMode.Platinum))
            {
                gameMode.text = "1L PLATINUM";
            }
            level.text = tsl;

            GameMode mode = DataSender.ReturnGameMode();
            if (!autoplay && mode.Equals(GameMode.Starlight) && Social.localUser.authenticated)
            {
#if UNITY_ANDROID
                PlayGamesPlatform.Instance.ReportProgress(GPGSIds.achievement_seeing_the_starlight_at_the_stage, 100.0f, null);
#elif UNITY_IOS
                Achievementer.ReportProgress("StarlightStage");
#endif
            }
            else if (!autoplay && (mode.Equals(GameMode.Theater) || mode.Equals(GameMode.Theater4) || mode.Equals(GameMode.Theater2L) || mode.Equals(GameMode.Theater2P)) && Social.localUser.authenticated)
            {
#if UNITY_ANDROID
                PlayGamesPlatform.Instance.ReportProgress(GPGSIds.achievement_nice_days_to_go_to_the_theater, 100.0f, null);
#elif UNITY_IOS
                Achievementer.ReportProgress("TheaterDays");
#endif
            }
            else if (!autoplay && mode.Equals(GameMode.Platinum) && Social.localUser.authenticated)
            {
#if UNITY_ANDROID
                PlayGamesPlatform.Instance.ReportProgress(GPGSIds.achievement_platinum_on_stage, 100.0f, null);
#elif UNITY_IOS
                Achievementer.ReportProgress("PlatinumOnStage");
#endif
            }
            if (!autoplay && allNote >= 300 && pc > 100 && Social.localUser.authenticated)
            {
#if UNITY_ANDROID
                if (tpstb)
                {
                    PlayGamesPlatform.Instance.ReportProgress(GPGSIds.achievement_percentile_ignored, 100.0f, null);
                }
                else
                {
                    PlayGamesPlatform.Instance.ReportProgress(GPGSIds.achievement_should_not_be_happened, 100.0f, null);
                }
#elif UNITY_IOS
                if (tpstb)
                {
                    Achievementer.ReportProgress("percentile");
                }
                else
                {
                    Achievementer.ReportProgress("notbehappened");
                }
#endif
            }

            if (Social.localUser.authenticated)
            {
#if UNITY_ANDROID
                PlayGamesPlatform.Instance.IncrementAchievement(GPGSIds.achievement_thank_you, 1, null);
#elif UNITY_IOS
                Achievementer.ReportProgress("thankyou", 1.0f);
#endif
            }
            StartCoroutine(ShowAchieveText());
        }