Esempio n. 1
0
        public void ThrowError(ErrorMode errMode)
        {
            HasError = true;
            MessageBox.Show(LocaleManager.instance.GetLocaleText("error_occured"), ErrorManager.GetErrorText(errMode), MessageBoxButton.OK);
            StartCoroutine(MessageAct_ThrowError());
#if UNITY_ANDROID
            if (Social.localUser.authenticated)
            {
                PlayGamesPlatform.Instance.IncrementAchievement(GPGSIds.achievement_never_give_up, 1, null);
            }
#elif UNITY_IOS
            Achievementer.ReportProgress("nevergiveup", 20.0f);
#endif
        }
Esempio n. 2
0
        private void Start()
        {
            LoadList();
            FilePanel.SetActive(true);

#if UNITY_ANDROID
            if (Social.localUser.authenticated)
            {
                PlayGamesPlatform.Instance.ReportProgress(GPGSIds.achievement_starting_line_as_a_creator, 100.0f, null);
            }
#elif UNITY_IOS
            Achievementer.ReportProgress("startingline");
#endif
        }
Esempio n. 3
0
        public void OpenInstruction()
        {
            if (LocaleManager.instance.CurrentIndex.Equals(0))
            {
                Application.OpenURL("https://drive.google.com/open?id=0B4lmwqLbQ-YKQ0xkWXh2VG50UjA");
            }
            else
            {
                Application.OpenURL("https://drive.google.com/open?id=0B4lmwqLbQ-YKb2U2YWFkTUUyVWc");
            }
#if UNITY_ANDROID
            if (Social.localUser.authenticated)
            {
                PlayGamesPlatform.Instance.ReportProgress(GPGSIds.achievement_reading_the_field_manual, 100.0f, null);
            }
#elif UNITY_IOS
            Achievementer.ReportProgress("ReadTheFieldManual");
#endif
        }
Esempio n. 4
0
        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;
            }
        }
Esempio n. 5
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());
        }
Esempio n. 6
0
        public void SearchLoad(Text searchText)
        {
            string value = searchText.text;

            lastButtonIdx = -1;

            if (buttons.Count > 0)
            {
                for (int i = 0; i < buttons.Count; i++)
                {
                    buttons[i].SetActive(false);
                }
                buttons.Clear();
            }
            DirectoryInfo source = new DirectoryInfo(GamePath.SongPath());

            DirectoryInfo[] dir = source.GetDirectories();
            if (dir.Length.Equals(0))
            {
                ErrorManager.showErrorText(errorText.gameObject, ErrorMode.NoSong);
                return;
            }

            List <string> list = new List <string>();

            for (int i = 0; i < dir.Length; i++)
            {
                list.Add(dir[i].Name);
            }
            list.Sort();

            int chk; // 악곡 데이터가 정상적으로 입력되었는지를 알려주는 값.

            foreach (string dat in list)
            {
                GameObject go = Instantiate(listButton) as GameObject;
                go.SetActive(true);
                SongButton realBtn = go.GetComponent <SongButton>();
                chk = realBtn.SetSongName(dat, source.FullName + dat, value);
                //chk = realBtn.SetSong(dat, source.FullName + dat, value);                // 이거를 버튼 눌렀을 때로도 뺀다.
                realBtn.Index = buttons.Count;

                if (chk.Equals(1))
                {
                    go.SetActive(false); continue;
                }
                else if (chk.Equals(-1))
                {
                    if (!ErrorInfo.activeSelf)
                    {
                        ErrorInfo.SetActive(true);
                    }
                    ErrorDirList.Add(dat);
                }
                //여기까지
                go.transform.SetParent(listButton.transform.parent);
                go.transform.localScale = new Vector3(1, 1, 1); // 해상도에 따른 조정
                buttons.Add(go);
            }

            if (buttons.Count >= 30 && !ErrorInfo.activeSelf)
            {
#if UNITY_ANDROID
                if (Social.localUser.authenticated)
                {
                    PlayGamesPlatform.Instance.ReportProgress(GPGSIds.achievement_pride_of_the_rich, 100.0f, null);
                }
#elif UNITY_IOS
                Achievementer.ReportProgress("prideoftherich");
#endif
            }
        }