Exemple #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();
 }
Exemple #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);
 }
Exemple #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);
 }
 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();
 }
Exemple #5
0
 public void MainMenu()
 {
     SingleAudioSource.PlayMusic(buttonSound);
     SceneManager.LoadScene("MainMenu");
 }
Exemple #6
0
 public void Exit()
 {
     SingleAudioSource.PlayMusic(btnSound);
     Application.Quit();
 }
Exemple #7
0
 public void HighScores()
 {
     SingleAudioSource.PlayMusic(btnSound);
     SceneManager.LoadScene("HighScoresMenu");
 }
Exemple #8
0
 public void Controls()
 {
     SingleAudioSource.PlayMusic(btnSound);
     SceneManager.LoadScene("ControlsMenu");
 }
Exemple #9
0
 public void NewGame()
 {
     SingleAudioSource.PlayMusic(btnSound);
     SceneManager.LoadScene("GameScene");
 }
Exemple #10
0
 public void Continue()
 {
     SingleAudioSource.PlayMusic(buttonSound);
     gameCamera.Continue();
 }
Exemple #11
0
 public void PlayAgain()
 {
     SingleAudioSource.PlayMusic(buttonSound);
     SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
 }