예제 #1
0
 // Displays the Credits Window in the Main Menu
 public void Credit()
 {
     if (CreditMenu.activeInHierarchy == false)
     {
         //closes other windows if open
         TutorialMenu.SetActive(false);
         HighscoreMenu.SetActive(false);
         //open credits
         CreditMenu.SetActive(true);
     }
     else
     {
         CreditMenu.SetActive(false);
     }
 }
예제 #2
0
 // Displays the Tutorial Window in the Main Menu
 public void Tutorial()
 {
     if (TutorialMenu.activeInHierarchy == false)
     {
         //closes other windows if open
         CreditMenu.SetActive(false);
         HighscoreMenu.SetActive(false);
         //open tutorial
         TutorialMenu.SetActive(true);
     }
     else
     {
         TutorialMenu.SetActive(false);
     }
 }
예제 #3
0
 // Displays the High Score Window in the Main Menu
 public void HighScore()
 {
     if (HighscoreMenu.activeInHierarchy == false)
     {
         //closes other windows if open
         CreditMenu.SetActive(false);
         TutorialMenu.SetActive(false);
         //open high scores
         HighscoreMenu.SetActive(true);
     }
     else
     {
         HighscoreMenu.SetActive(false);
     }
 }
예제 #4
0
파일: MainMenu.cs 프로젝트: IKARUSA/UnityGo
    private IEnumerator CreditButtonRoutine()
    {
        yield return(StartCoroutine(FadeOn()));

        CreditMenu.Open();
    }
예제 #5
0
        private void MainMenuLinkDraw(string text, float Y, string process, int offset, ref bool IsIn, string type)
        {
            #region Color Setting

            Color color;
            if (type == "Useful Links")
            {
                color = IsIn ? Color.White * 0.75f : Color.Lerp(Color.White * 0.50f, Color.Lerp(Color.SlateGray, Color.Black, 0.5f), (float)Math.Sin(fadePercent));
            }
            else
            {
                color = IsIn ? Color.White * 0.75f : Color.SlateGray;
            }
            Color newColor = Color.Black;
            for (int i = 0; i < 5; i++)
            {
                if (i == 4)
                {
                    newColor   = color;
                    newColor.R = (byte)((255 + newColor.R) / 2);
                    newColor.G = (byte)((255 + newColor.G) / 2);
                    newColor.B = (byte)((255 + newColor.B) / 2);
                }
                newColor.A = (byte)(newColor.A * 0.5f);
            }

            #endregion Color Setting

            #region Rectangle & Hover/Click

            Vector2   size      = ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, Main.fontMouseText, text, new Vector2(10f, Y), Color.Transparent, 0f, Vector2.Zero, new Vector2(1f, 1f));
            Rectangle rectangle = new Rectangle((int)10f, (int)Y, (int)size.X - 10, (int)size.Y + offset);
            if (rectangle.Contains(new Point(Main.mouseX, Main.mouseY)))
            {
                if (IsIn == false)
                {
                    IsIn = true;
                    Main.PlaySound(SoundID.MenuTick);
                }
            }
            else if (IsIn == true && !rectangle.Contains(new Point(Main.mouseX, Main.mouseY)))
            {
                IsIn = false;
            }
            if (!lastMouseLeft && Main.mouseLeft && rectangle.Contains(new Point(Main.mouseX, Main.mouseY)))
            {
                if (type == "Credits")
                {
                    if (Main.menuMode == 0)
                    {
                        Main.PlaySound(SoundID.MenuOpen);
                        creditMenuUI = new CreditMenu();
                        UserInterface.ActiveInstance.SetState(creditMenuUI);
                    }
                }
                else if (type == "Useful Links")
                {
                    Main.PlaySound(SoundID.MenuOpen);
                    linksOpen = true;
                }
                else
                {
                    Main.PlaySound(SoundID.MenuOpen);
                    Process.Start(process);
                }
            }

            #endregion Rectangle & Hover/Click

            ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, Main.fontMouseText, text, new Vector2(10f, Y), newColor, 0f, Vector2.Zero, new Vector2(1f, 1f));
        }
예제 #6
0
 public void OnBackToMainMenuPressed()
 {
     MainMenu.SetActive(true);
     CreditMenu.SetActive(false);
 }
예제 #7
0
 public void OnCreditsPressed()
 {
     MainMenu.SetActive(false);
     CreditMenu.SetActive(true);
 }
예제 #8
0
 public void OnCreditPressed()
 {
     CreditMenu.Open();
 }