예제 #1
0
    private Color fadeCol = new Color(0, 0, 0, 0.5f);           // 50% transparent black to dim the screen

    public void Activate()
    {
        // animate all the elements into place
        MenuAnim.MoveTo(pausedText, new Vector3(0, 1, 0), 0.4f, 0.0f);
        MenuAnim.MoveTo(tapToResume, new Vector3(0, -1, 0), 0.4f, 0.0f);
        // dim the screen
        MenuAnim.FadeTo(screenFade, fadeCol, 0.3f, 0.0f);
        // pause the music
        SoundManager.PauseMusic(0.5f);
    }
예제 #2
0
 void OnStartPressed()
 {
     // animate out all the elements
     MenuAnim.MoveTo(title, new Vector3(12, 0.7f, 0), 0.5f, 0.0f);
     MenuAnim.MoveTo(playerImage, new Vector3(-12, -1, 0), 0.5f, 0.0f);
     MenuAnim.MoveTo(tapToStart, new Vector3(0, -10, 0), 0.3f, 0.0f);
     MenuAnim.FadeTo(screenFade, Color.clear, 0.3f, 0.2f);
     // start the actual game
     GameManager.Game.Restart();
 }
예제 #3
0
    public void Activate()
    {
        SoundManager.PlayMusic("Intro");

        // animate in all the elements, and dim the screen.
        MenuAnim.MoveTo(title, new Vector3(1, 0.7f, 0), 0.5f, 0.0f);
        MenuAnim.MoveTo(playerImage, new Vector3(-4, -1, 0), 0.5f, 0.0f);
        MenuAnim.MoveTo(tapToStart, new Vector3(0, -2.5f, 0), 0.3f, 0.5f);
        MenuAnim.FadeTo(screenFade, fadeCol, 0.3f, 0.2f);
    }
예제 #4
0
 public void OnBackToMenu()
 {
     // animate the elements out
     MenuAnim.MoveTo(gameOverText, new Vector3(0, 5, 0), 0.4f, 0.1f);
     MenuAnim.MoveTo(score, new Vector3(0, -4, 0), 0.4f, 0.1f);
     MenuAnim.MoveTo(exitButton, new Vector3(-10, -1.5f, 0), 0.4f, 0.0f);
     MenuAnim.MoveTo(restartButton, new Vector3(10, -1.5f, 0), 0.4f, 0.0f);
     // fade to black (the title screen handles fading back in)
     MenuAnim.FadeTo(screenFade, Color.black, 0.3f, 0.1f);
     // show the title screen once the screen is black
     GameManager.Game.Invoke("ShowTitleScreen", 0.7f);
 }
예제 #5
0
 public void OnRestart()
 {
     // animate all the elements out again
     MenuAnim.MoveTo(gameOverText, new Vector3(0, 5, 0), 0.4f, 0.1f);
     MenuAnim.MoveTo(score, new Vector3(0, -4, 0), 0.4f, 0.1f);
     MenuAnim.MoveTo(exitButton, new Vector3(-10, -1.5f, 0), 0.4f, 0.0f);
     MenuAnim.MoveTo(restartButton, new Vector3(10, -1.5f, 0), 0.4f, 0.0f);
     // fade to black
     MenuAnim.FadeTo(screenFade, Color.black, 0.3f, 0.1f);
     // restart the game once the screen is black
     GameManager.Game.Invoke("Restart", 0.7f);
     // fade back in as the game starts
     MenuAnim.FadeTo(screenFade, Color.clear, 0.3f, 0.7f);
 }
예제 #6
0
 void OnResume()
 {
     if (GameManager.Game.IsPaused)
     {
         // animate everything offscreen again
         MenuAnim.MoveTo(pausedText, new Vector3(-12, 1, 0), 0.3f, 0.0f);
         MenuAnim.MoveTo(tapToResume, new Vector3(12, -1, 0), 0.3f, 0.0f);
         // undim the screen
         MenuAnim.FadeTo(screenFade, Color.clear, 0.3f, 0.1f);
         // start the music again
         SoundManager.UnpauseMusic();
         // resume the game
         GameManager.Game.IsPaused = false;
     }
 }
예제 #7
0
    private Color fadeCol = new Color(0, 0, 0, 0.5f);           // 50% transparent black to dim the screen

    public void Activate()
    {
        // fill in score text
        distanceText.text = GameManager.Game.LastScore.ToString() + "m";
        bestText.text     = GameManager.Game.BestScore.ToString() + "m";

        // animate all the elements onto the screen
        MenuAnim.FadeTo(screenFade, fadeCol, 0.3f, 0.0f);
        MenuAnim.MoveTo(gameOverText, new Vector3(0, 0.5f, 0), 0.4f, 0.0f);
        MenuAnim.MoveTo(score, new Vector3(0, 0, 0), 0.4f, 0.1f);
        MenuAnim.MoveTo(exitButton, new Vector3(-1.35f, -1.5f, 0), 0.4f, 0.3f);
        MenuAnim.MoveTo(restartButton, new Vector3(1.35f, -1.5f, 0), 0.4f, 0.3f);

        // fade out the music
        SoundManager.PauseMusic(0.5f);
    }