Пример #1
0
    // MoveOut all primary buttons
    public void HideAllGUIs()
    {
        // MoveOut all primary buttons
        m_CenterButtons.MoveOut(GSui.eGUIMove.SelfAndChildren);

        // MoveOut all side bars
        if (m_Bar1_IsOn == true)
        {
            m_Bar1.MoveOut(GSui.eGUIMove.SelfAndChildren);
        }
        if (m_Bar2_IsOn == true)
        {
            m_Bar2.MoveOut(GSui.eGUIMove.SelfAndChildren);
        }
        if (m_Bar3_IsOn == true)
        {
            m_Bar3.MoveOut(GSui.eGUIMove.SelfAndChildren);
        }
        if (m_Bar4_IsOn == true)
        {
            m_Bar4.MoveOut(GSui.eGUIMove.SelfAndChildren);
        }

        // MoveOut m_Title1 and m_Title2
        StartCoroutine(HideTitleTextMeshes());
    }
Пример #2
0
 public void BackToMain()
 {
     LevelSelect.MoveOut(GUIAnimSystem.eGUIMove.SelfAndChildren);
     LevelContainer.MoveOut(GUIAnimSystem.eGUIMove.SelfAndChildren);
     Back.MoveOut(GUIAnimSystem.eGUIMove.SelfAndChildren);
     StartCoroutine(TitleScreenEnter(0.75f));
 }
Пример #3
0
 public void EnterSelectLevel()
 {
     Title.MoveOut(GUIAnimSystem.eGUIMove.SelfAndChildren);
     PlayGame.MoveOut(GUIAnimSystem.eGUIMove.SelfAndChildren);
     Resume.MoveOut(GUIAnimSystem.eGUIMove.SelfAndChildren);
     StartCoroutine(SelectLevelEnter(0.5f));
 }
Пример #4
0
    // MoveOut all primary buttons
    public void HideAllGUIs()
    {
        // MoveOut all primary buttons
        m_PrimaryButton1.MoveOut(GSui.eGUIMove.SelfAndChildren);
        m_PrimaryButton2.MoveOut(GSui.eGUIMove.SelfAndChildren);
        m_PrimaryButton3.MoveOut(GSui.eGUIMove.SelfAndChildren);
        m_PrimaryButton4.MoveOut(GSui.eGUIMove.SelfAndChildren);
        m_PrimaryButton5.MoveOut(GSui.eGUIMove.SelfAndChildren);

        // MoveOut all secondary buttons
        if (m_Button1_IsOn == true)
        {
            m_SecondaryButton1.MoveOut(GSui.eGUIMove.SelfAndChildren);
        }
        if (m_Button2_IsOn == true)
        {
            m_SecondaryButton2.MoveOut(GSui.eGUIMove.SelfAndChildren);
        }
        if (m_Button3_IsOn == true)
        {
            m_SecondaryButton3.MoveOut(GSui.eGUIMove.SelfAndChildren);
        }
        if (m_Button4_IsOn == true)
        {
            m_SecondaryButton4.MoveOut(GSui.eGUIMove.SelfAndChildren);
        }
        if (m_Button5_IsOn == true)
        {
            m_SecondaryButton5.MoveOut(GSui.eGUIMove.SelfAndChildren);
        }

        // MoveOut m_Title1 and m_Title2
        StartCoroutine(HideTitleTextMeshes());
    }
Пример #5
0
    // MoveOut m_Dialog
    public void HideAllGUIs()
    {
        // MoveOut m_Dialog
        m_Dialog.MoveOut(GSui.eGUIMove.SelfAndChildren);

        // MoveOut m_Title1 and m_Title2
        StartCoroutine(HideTitleTextMeshes());
    }
Пример #6
0
    // MoveOut all dialogs and buttons
    public void HideAllGUIs()
    {
        // MoveOut all dialogs
        m_Dialog.MoveOut(GSui.eGUIMove.SelfAndChildren);
        m_DialogButtons.MoveOut(GSui.eGUIMove.SelfAndChildren);

        // MoveOut all buttons
        m_Button1.MoveOut(GSui.eGUIMove.SelfAndChildren);
        m_Button2.MoveOut(GSui.eGUIMove.SelfAndChildren);
        m_Button3.MoveOut(GSui.eGUIMove.SelfAndChildren);
        m_Button4.MoveOut(GSui.eGUIMove.SelfAndChildren);

        // MoveOut m_Title1 and m_Title2
        StartCoroutine(HideTitleTextMeshes());
    }
Пример #7
0
    IEnumerator HideMSG(GAui pGUIANimFREE)
    {
        // Creates a yield instruction to wait for a given number of seconds
        // http://docs.unity3d.com/400/Documentation/ScriptReference/WaitForSeconds.WaitForSeconds.html
        yield return(new WaitForSeconds(2.5f));

        if (pGUIANimFREE.gameObject.activeSelf == false)
        {
            pGUIANimFREE.gameObject.SetActive(true);
        }

        // Play Move Out animation
        pGUIANimFREE.MoveOut();

        // Stop particles in the hierarchy of given transfrom
        GSui.Instance.StopParticle(pGUIANimFREE.transform);

        // Enable GraphicRaycasters of Canvas in m_Gameplay
        // http://docs.unity3d.com/Manual/script-GraphicRaycaster.html
        GSui.Instance.SetGraphicRaycasterEnable(m_Gameplay, true);

        // Creates a yield instruction to wait for a given number of seconds
        // http://docs.unity3d.com/400/Documentation/ScriptReference/WaitForSeconds.WaitForSeconds.html
        yield return(new WaitForSeconds(1.5f));

        // Play MoveIn animation
        GSui.Instance.MoveIn(m_PanelForButtons.transform, true);
    }
Пример #8
0
    public void UnStep()
    {
        maskPanel.alpha = 0f;
        AdvanceButton.gameObject.SetActive(true);

        // Unroll player action
        for (int i = 0; i < Players.transform.childCount; i++)
        {
            Players.transform.GetChild(i).position = PlayerPosRecorder [i];
            Players.transform.GetChild(i).gameObject.SetActive(PlayerAvailableRecorder [i]);
            Players.transform.GetChild(i).eulerAngles = PlayerRotRecorder [i];
            Players.transform.GetChild(i).gameObject.GetComponent <PlayerControl> ().lockMove    = false;
            Players.transform.GetChild(i).gameObject.GetComponent <PlayerControl> ().startMoving = false;
        }
        foreach (Transform road in Roads.transform)
        {
            road.gameObject.GetComponent <RoadControl> ().unstep();
        }
        // Advance Step Number
        stepNumber++;
        if (stepNumber > maxStepNumber)
        {
            StepNum.color = Color.red;
        }
        StepNum.text = stepNumber.ToString() + " / " + maxStepNumber.ToString();
        // Unroll change Number
        changed        = 0;
        ChangeNum.text = changed.ToString() + " / " + maxChangeTime.ToString();
        passedTraffic  = lastPassedTraffic;
        ResultPanel.MoveOut(GUIAnimSystem.eGUIMove.SelfAndChildren);
        BackwardButton.interactable = false;
    }
Пример #9
0
    IEnumerator Show_MSG_GameOver()
    {
        // Disable GraphicRaycasters of Canvas in m_Gameplay
        // http://docs.unity3d.com/Manual/script-GraphicRaycaster.html
        GSui.Instance.SetGraphicRaycasterEnable(m_Gameplay, false);
        m_Gameplay_MSG_GameOver.gameObject.SetActive(true);

        // Play MoveIn animation
        m_Gameplay_MSG_GameOver.MoveIn();

        // Play particles in the hierarchy of given transfrom
        GSui.Instance.PlayParticle(m_Gameplay_MSG_GameOver.transform);

        // Creates a yield instruction to wait for a given number of seconds
        // http://docs.unity3d.com/400/Documentation/ScriptReference/WaitForSeconds.WaitForSeconds.html
        yield return(new WaitForSeconds(4.0f));

        m_Gameplay_MSG_GameOver.gameObject.SetActive(true);

        // Play Move Out animation
        m_Gameplay_MSG_GameOver.MoveOut();

        // Keep particles stay alive until it finished playing.
        GSui.Instance.DontDestroyParticleWhenLoadNewScene(m_Gameplay_MSG_GameOver.transform, true);

        // Load next scene according to orientation of current scene.
        string CurrentLevel    = Application.loadedLevelName;
        string OrientationName = "Portrait";

        if (CurrentLevel.Contains("Landscape") == true)
        {
            OrientationName = "Landscape";
        }
        GSui.Instance.LoadLevel("ToonyPRO Demo 03 - " + OrientationName + " - Level Select", 1.0f);
    }
Пример #10
0
    public void Button_NextPage()
    {
        UIPT_PRO_SoundController.Instance.Play_SoundClick();

        if (m_CurrentPage != 1)
        {
            m_Page1.m_MoveOut.Enable  = false;
            m_Page1.m_MoveIn.Enable   = true;
            m_Page1.m_MoveIn.MoveFrom = GAui.ePosMove.RightScreenEdge;
            m_Page1.m_MoveIn.Time     = 1.5f;
            m_Page1.m_MoveIn.Delay    = 0;
            m_Page1.Reset();                                // Reset all animations' information of before replay
            m_Page1.MoveIn(GUIAnimSystem.eGUIMove.Self);    // Play MoveIn animation
            m_Page_0_Dot.gameObject.GetComponent <Image>().color = new Color(0.4f, 0.4f, 0.4f, 0.4f);

            m_Page0.m_MoveIn.Enable  = false;
            m_Page0.m_MoveOut.Enable = true;
            m_Page0.m_MoveOut.MoveTo = GAui.ePosMove.LeftScreenEdge;
            m_Page0.m_MoveOut.Time   = 1.5f;
            m_Page0.m_MoveOut.Delay  = 0;
            m_Page0.Reset();                                // Reset all animations' information of before replay
            m_Page0.MoveOut(GUIAnimSystem.eGUIMove.Self);   // Play Move Out animation
            m_Page_1_Dot.gameObject.GetComponent <Image>().color = new Color(1, 1, 0, 1);
        }

        m_CurrentPage++;
        UpdateArrowButtons();
    }
Пример #11
0
    public void OnClickContinue()
    {
        StartCoroutine(PrepareQuestion());

        blackBG.SetActive(false);

        continuePanel.MoveOut();
    }
    // When the user click continue
    public void OnClickContinue()
    {
        black.SetActive(false);

        continueWindow.MoveOut();

        StartCoroutine(GameContinue());
    }
Пример #13
0
    // === Button Region === //
    // On Close Welcome button
    public void OnClickWelcomeTutorialPanel()
    {
        MCTutorial.Instance.finger.SetActive(true);

        welcomeTutorialPanel.MoveOut();

        welcomeTutorialPanel.gameObject.transform.parent.GetComponent <Image>().enabled = false;
    }
Пример #14
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            if (curActivePanel == activatePanel.gameObject)
            {
                activatePanel.MoveOut();
                blackBG.SetActive(false);

                curActivePanel = menuPanel;
            }
            else
            {
                blackBG.SetActive(true);
                exitPanel.GetComponent <GAui>().MoveIn();

                curActivePanel = exitPanel;
            }
        }
    }
Пример #15
0
    // MoveOut m_Title1 and m_Title2
    IEnumerator HideTitleTextMeshes()
    {
        yield return(new WaitForSeconds(1.0f));

        // MoveOut m_Title1 and m_Title2
        m_Title1.MoveOut(GSui.eGUIMove.Self);
        m_Title2.MoveOut(GSui.eGUIMove.Self);

        // MoveOut m_TopBar and m_BottomBar
        m_TopBar.MoveOut(GSui.eGUIMove.SelfAndChildren);
        m_BottomBar.MoveOut(GSui.eGUIMove.SelfAndChildren);
    }
Пример #16
0
    // MoveOut all primary buttons
    public void HideAllGUIs()
    {
        m_TopLeft_A.MoveOut(GSui.eGUIMove.SelfAndChildren);
        m_BottomLeft_A.MoveOut(GSui.eGUIMove.SelfAndChildren);
        m_RightBar_A.MoveOut(GSui.eGUIMove.Self);

        if (m_TopLeft_IsOn == true)
        {
            m_TopLeft_B.MoveOut(GSui.eGUIMove.SelfAndChildren);
        }
        if (m_BottomLeft_IsOn == true)
        {
            m_BottomLeft_B.MoveOut(GSui.eGUIMove.SelfAndChildren);
        }
        if (m_RightBar_IsOn == true)
        {
            m_RightBar_B.MoveOut(GSui.eGUIMove.SelfAndChildren);
        }

        // MoveOut m_Title1 and m_Title2
        StartCoroutine(HideTitleTextMeshes());
    }
Пример #17
0
 public void FoldMenu()
 {
     if (MenuMoveIn)
     {
         RestartButton.MoveIn(GUIAnimSystem.eGUIMove.SelfAndChildren);
         HomeButton.MoveIn(GUIAnimSystem.eGUIMove.SelfAndChildren);
     }
     else
     {
         RestartButton.MoveOut(GUIAnimSystem.eGUIMove.SelfAndChildren);
         HomeButton.MoveOut(GUIAnimSystem.eGUIMove.SelfAndChildren);
     }
     MenuMoveIn = !MenuMoveIn;
 }
    IEnumerator ShowQuestions()
    {
        yield return(new WaitForSeconds(0.2f));

        readyImg.MoveIn();

        yield return(new WaitForSeconds(1));

        readyImg.MoveOut();

        yield return(new WaitForSeconds(1));

        OnClickQuestion(arr[qIndex]);
    }
Пример #19
0
    IEnumerator ReadyPanel()
    {
        if (!readyPanel.gameObject.activeInHierarchy)
        {
            readyPanel.gameObject.SetActive(true);
        }

        yield return(new WaitForSeconds(0.2f));

        readyPanel.MoveIn();

        yield return(new WaitForSeconds(1f));

        readyPanel.MoveOut();

        // Start generating questions
        StartCoroutine(PrepareQuestion());
    }
    // Show and add +1 trophy when the player get 3 stars.
    IEnumerator ShowTrophy()
    {
        yield return(new WaitForSeconds(0.5f));

        trophiImage.gameObject.SetActive(true);
        particle.SetActive(false);
        particle.SetActive(true);
        trophiImage.MoveIn();

        celebrateAudioSource.clip = celebrateSound;
        celebrateAudioSource.Play();

        yield return(new WaitForSeconds(3));

        celebrateAudioSource.clip = trophyMoveOut;
        celebrateAudioSource.Play();

        trophiImage.MoveOut();

        ResetScore();

        yield return(new WaitForSeconds(1f));

        // Increase trophy count
        trophyCount++;

        PlayerPrefs.SetInt("LPL_TrophyCount", trophyCount);

        trophyCountText.text = trophyCount.ToString();

        yield return(new WaitForSeconds(0.5f));

        // Ask the user to start next round.
        //OnClickQuestion(arr[qIndex]);
        black.SetActive(true);
        continueWindow.MoveIn();
    }
Пример #21
0
    IEnumerator IncStar()
    {
        yield return(new WaitForSeconds(1.2f));

        if (isCorrect)
        {
            isCorrect = false;

            // Increase star count

            stars[starCount - 1].sprite = starSpecial;
            starParticles[starCount - 1].SetActive(true);

            audioSource.clip = starSound;
            audioSource.Play();

            // Check and reset stars.
            if (starCount == stars.Length)
            {
                trophyParticle.SetActive(false);
                trophyParticle.SetActive(true);

                audioSource.clip = trophySound;
                audioSource.Play();

                trophy.transform.localPosition = new Vector2(-226, 0);

                if (!trophy.gameObject.activeInHierarchy)
                {
                    trophy.gameObject.SetActive(true);
                }

                // Show Trophy
                trophy.MoveIn();

                Destroy(curObject);

                yield return(new WaitForSeconds(1.5f));

                trophy.MoveOut();

                for (int i = 0; i < stars.Length; i++)
                {
                    stars[i].sprite = starNormal;
                    starParticles[i].SetActive(false);
                }

                starCount = 0;

                yield return(new WaitForSeconds(1));

                trophyCount++;
                PlayerPrefs.SetInt("TrophyCount", trophyCount);
                trophyText.text = trophyCount.ToString();

                blackBG.SetActive(true);

                if (!continuePanel.gameObject.activeInHierarchy)
                {
                    continuePanel.gameObject.SetActive(true);
                }

                continuePanel.MoveIn();
            }
        }
    }