Exemplo n.º 1
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     SingleAudioSource.PlayMusic(hit);
     this.gameObject.SetActive(false);
     other.gameObject.GetComponent <UnityStandardAssets._2D.Platformer2DUserControl>().Stun();
     other.gameObject.transform.Find("Particle System").GetComponent <ParticleSystem>().Play();
 }
Exemplo n.º 2
0
 /// <summary>
 /// 2D support
 /// </summary>
 protected virtual void OnTriggerEnter2D(Collider2D other)
 {
     if (powerUpState != PowerUpState.IsCollected && powerUpState != PowerUpState.IsExpiring)
     {
         SingleAudioSource.PlayMusic(sound);
     }
     PowerUpCollected(other.gameObject);
 }
Exemplo n.º 3
0
 public void Fire(Vector3 startPos, Vector3 target, bool flip)
 {
     this.gameObject.SetActive(true);
     this.transform.position         = startPos;
     this.transform.localEulerAngles = new Vector3(this.transform.localEulerAngles.x, this.transform.localEulerAngles.y, Vector3.Angle(new Vector3(1f, 0, 0), target) * (flip ? -1f : 1f));
     targetVector = target;
     moving       = true;
     SingleAudioSource.PlayMusic(fire);
 }
Exemplo n.º 4
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     Debug.Log("GAME OVER");
     SingleAudioSource.PlayMusic(gameOverSound);
     transform.parent.gameObject.GetComponent <CameraMovement>().SetSpeed(0f);
     gameOverUI.GetComponent <GameOverUI>().OnGameOver();
     toldt.GetComponent <Enemy>().Stop();
     player.GetComponent <UnityStandardAssets._2D.Platformer2DUserControl>().Stop();
 }
Exemplo n.º 5
0
 public void MainMenu()
 {
     SingleAudioSource.PlayMusic(buttonSound);
     SceneManager.LoadScene("MainMenu");
 }
Exemplo n.º 6
0
 public void Exit()
 {
     SingleAudioSource.PlayMusic(btnSound);
     Application.Quit();
 }
Exemplo n.º 7
0
 public void HighScores()
 {
     SingleAudioSource.PlayMusic(btnSound);
     SceneManager.LoadScene("HighScoresMenu");
 }
Exemplo n.º 8
0
 public void Controls()
 {
     SingleAudioSource.PlayMusic(btnSound);
     SceneManager.LoadScene("ControlsMenu");
 }
Exemplo n.º 9
0
 public void NewGame()
 {
     SingleAudioSource.PlayMusic(btnSound);
     SceneManager.LoadScene("GameScene");
 }
Exemplo n.º 10
0
 public void Continue()
 {
     SingleAudioSource.PlayMusic(buttonSound);
     gameCamera.Continue();
 }
Exemplo n.º 11
0
 public void PlayAgain()
 {
     SingleAudioSource.PlayMusic(buttonSound);
     SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
 }