Exemplo n.º 1
0
 public override void Exit()
 {
     base.Exit();
     Program.Instance.Interface.ClearInterface();
     if (MainMenuMusic != null)
     {
         MainMenuMusic.Stop();
     }
     MainMenuMusic = null;
 }
    public void ResetGame()
    {
        points       = 0;
        currentLevel = 1;
        fruitCounter = 0;
        easterBlocks = 0;
        lives        = MAX_LIVES;
        MainMenuMusic music = GameObject.FindObjectOfType <MainMenuMusic>();

        music.Stop();
    }
    void Start()
    {
        MainMenuMusic music = GameObject.FindObjectOfType <MainMenuMusic>();

        if (music.source != null)
        {
            music.Stop();
            music.source.enabled = false;
        }
        music.source         = GameObject.Find("PacmanTheme").GetComponent <AudioSource>();
        music.source.enabled = true;
        music.source.Play();
        levelLoading = false;
        gameManager  = FindObjectOfType <GameManager>();
        gameManager.SetPacmanAsGame();
        playerPosition = transform.position;
        dest           = transform.position;
        addUnlockedFruits(gameManager.getFruitCounter());
        pointsText      = GameObject.Find("LivesText").GetComponent <Text>();
        pointsText.text = "Lives: " + gameManager.lives;
        pointsText      = GameObject.Find("PointsText").GetComponent <Text>();
        pointsText.text = "Points: " + gameManager.points;
    }
 public void OnButton1Click()
 {
     GameObject.Find("Main Camera").GetComponent <AudioListener>().enabled = false;
     music.Stop();
     SceneManager.LoadScene("arkanoid1");
 }
 public void StopMainMenuMusicAudio()
 {
     MainMenuMusic.Stop();
 }