Esempio n. 1
0
        private void ClearScore()
        {
            if (PYAudioManager.Instance != null)
            {
                PYAudioManager.Instance.StartAudio(PYAudioTags.Voice_ptBR_Continuar).Play();
                PYAudioManager.Instance.StartAudio(PYAudioTags.Voice_ptBR_DeleteMsg03).Delay(1f).Play();
            }

            PYScoreData.DeleteAll();

            ScoreboardRef.Refresh();

            PYAlertPopup popup = PYAlertPopup.InvokeAlertPopup("AlertPopup_1b")
                                 .SetTitle(Localization.GetAsset <string>(TagManager.LOCALIZATION_ATENTION, "ATENÇÂO") + "!")
                                 .SetText(Localization.GetAsset <string>(TagManager.LOCALIZATION_SCORE_DELETED, "O PLACAR FOI APAGADO."));

            popup.UseFader = true;
            popup.AddButton("PYButtonConfirm", null);
            popup.Open();

            popup.onClosing.AddListener(() =>
            {
                if (PYAudioManager.Instance != null)
                {
                    PYAudioManager.Instance.Stop(PYAudioTags.Voice_ptBR_DeleteMsg03);
                }
            });
            popup.onClosed.AddListener(() =>
            {
                ScoreMenuManager.Instance.ChangeScene("menu");
            });
        }
Esempio n. 2
0
        public void DeleteAll()
        {
            DeleteButton.IsEnabled = false;

            PYAudioManager.Instance.StartAudio(PYAudioTags.Voice_ptBR_DeleteMsg01).Play();

            PYAlertPopup popup = PYAlertPopup.InvokeAlertPopup("AlertPopup_2b")
                                 .SetTitle(Localization.GetAsset <string>(TagManager.LOCALIZATION_ATENTION, "ATENÇÂO") + "!")
                                 .SetText(Localization.GetAsset <string>(TagManager.LOCALIZATION_RESTRICTED_ACCESS, "ACESSO RESTRITO A RESPONSÁVEIS."));

            popup.UseFader = true;

            popup.AddButton("PYButtonText", Localization.GetAsset <string>(TagManager.LOCALIZATION_BACK, "VOLTAR")).AddButtonAction(0, PlayBackSound);
            popup.AddButton("PYButtonText", Localization.GetAsset <string>(TagManager.LOCALIZATION_CONTINUE, "CONTINUAR")).AddButtonAction(1, () =>
            {
                onButtonContinuar       = true;
                popup.CloseFaderByPopup = false;
            });
            popup.Open();

            popup.onClosed.AddListener(() =>
            {
                if (onButtonContinuar)
                {
                    onButtonContinuar = false;
                    ConfirmDelete();
                }
                else
                {
                    DeleteButton.IsEnabled = true;
                }
            });
        }
Esempio n. 3
0
        public static PYAlertPopup InvokePositionPopup(int position, bool closeFader = true)
        {
            PositionAlertPopup popUpGameObject = Resources.Load <PositionAlertPopup>("Popups/PositionPopup");

            popUpGameObject = (PositionAlertPopup)Instantiate(popUpGameObject, Vector3.zero, Quaternion.identity);

            ///*MUDAR ISSO*/popUpGameObject.transform.parent = FindObjectOfType<Canvas>().transform;//Camera.main.transform;

            popUpGameObject.transform.localPosition = new Vector3(0, 0, 10);

            bool wonFirstPrize = position == 1;

            popUpGameObject.FirstPrize.SetActive(wonFirstPrize);
            popUpGameObject.OtherPrize.SetActive(!wonFirstPrize);
            popUpGameObject.OtherPrizeSprite.sprite = Resources.Load <Sprite>("Popups/PositionSprites/" + Mathf.Clamp(position, 1, 4).ToString());

            PYAlertPopup popup = popUpGameObject.GetComponent <PYAlertPopup>();

            //popup.AlertPopup = new PYAlertPopupData();
            popUpGameObject.PositionText.Text = position.ToString();
            popup.ClosePopupByFader           = closeFader;

            popup.Open();

            return(popup);
        }
Esempio n. 4
0
 void CheckScore(string name, int score, TagManager.GameDifficulty difficulty)
 {
     if (PYScoreData.GetStudentScore(name, difficulty) > score)
     {
         PYAlertPopup popup = PYAlertPopup.InvokeAlertPopup("Popups/AlertPopup_1b").SetTitle("ATENÇÃO!", 1).SetText("O resultado atual é inferior ao já registrado, e por isso será descartado.".ToUpper(), 1);
         popup.AddButton("PYButtonConfirm", null).AddButtonAction(0, () => { BackToMainMenu(); PYAudioManager.Instance.StartAudio(PYAudioTags.Voice_ptBR_Continuar); });
         popup.ClosePopupByFader = false;
         popup.Open();
         PYAudioManager.Instance.StartAudio(PYAudioTags.Voice_ptBR_RegistrarPop03).Delay(.25f).Play();
     }
     else
     {
         RegisterScore(name, score, difficulty);
     }
 }
Esempio n. 5
0
        private void ConfirmDelete()
        {
            PYAudioManager.Instance.StartAudio(PYAudioTags.Voice_ptBR_Continuar).Play();
            PYAudioManager.Instance.StartAudio(PYAudioTags.Voice_ptBR_DeleteMsg02).Delay(1f).Play();

            PYAlertPopup popup = PYAlertPopup.InvokeAlertPopup("AlertPopup_2b")
                                 .SetTitle(Localization.GetAsset <string>(TagManager.LOCALIZATION_ATENTION, "ATENÇÂO") + "!")
                                 .SetText(Localization.GetAsset <string>(TagManager.LOCALIZATION_CONFIRM_DELETE_ALL, "DESEJA MESMO APAGAR O PLACAR \nDESTE JOGO ?"));

            popup.UseFader = true;
            popup.AddButton("PYButtonText", Localization.GetAsset <string>(TagManager.LOCALIZATION_BACK, "VOLTAR")).AddButtonAction(0, PlayBackSound);
            popup.AddButton("PYButtonText", Localization.GetAsset <string>(TagManager.LOCALIZATION_CONTINUE, "CONTINUAR")).AddButtonAction(1, () =>
            {
                onButtonContinuar       = true;
                popup.CloseFaderByPopup = false;
            });
            popup.Open();

            popup.onClosing.AddListener(() =>
            {
                if (PYAudioManager.Instance != null)
                {
                    PYAudioManager.Instance.Stop(PYAudioTags.Voice_ptBR_DeleteMsg02);
                }
            });
            popup.onClosed.AddListener(() =>
            {
                if (onButtonContinuar)
                {
                    onButtonContinuar = false;
                    ClearScore();
                }
                else
                {
                    DeleteButton.IsEnabled = true;
                }
            });
        }
Esempio n. 6
0
        void SetScore(string message, string name, int score, TagManager.GameDifficulty difficulty, PYAudioTags voiceMsg)
        {
            if (!char.IsLetter(name[0]))
            {
                return;
            }

            string[] studentNames = PYScoreData.GetStudentNames();

            PlayTableKeyboard.Instance.SetText(name);
            PlayTableKeyboard.Instance.ShowText();

            if (new List <string>(studentNames).Contains(name))
            {
                string messageText = message;

                PYAudioManager.Instance.StartAudio(voiceMsg).Play();

                PYAudioManager.Instance.StartAudio(PYAudioTags.Voice_ptBR_RegistrarPop01).Play();
                PYAlertPopup popup = PYAlertPopup.InvokeAlertPopup("Popups/AlertPopup_2b").SetTitle("ATENÇÃO!", 1).SetText(messageText.ToUpper(), 1);
                popup.AddButton("PYButtonEffectManager", "NÃO").AddButtonAction(0, () =>
                {
                    PlayTableKeyboard.Instance.Close();
                    PYAudioManager.Instance.StartAudio(PYAudioTags.Voice_ptBR_No).Play();
                });
                popup.AddButton("PYButtonEffectManager_Smaller", "SIM").AddButtonAction(1, () =>
                {
                    CheckScore(name, score, difficulty);
                    PYAudioManager.Instance.StartAudio(PYAudioTags.Voice_ptBR_Yes).Play();
                });
                popup.ClosePopupByFader = false;
                popup.Open();
            }
            else
            {
                RegisterScore(name, score, difficulty);
            }
        }