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(); }
/// <summary> /// 2D support /// </summary> protected virtual void OnTriggerEnter2D(Collider2D other) { if (powerUpState != PowerUpState.IsCollected && powerUpState != PowerUpState.IsExpiring) { SingleAudioSource.PlayMusic(sound); } PowerUpCollected(other.gameObject); }
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(); }
public void MainMenu() { SingleAudioSource.PlayMusic(buttonSound); SceneManager.LoadScene("MainMenu"); }
public void Exit() { SingleAudioSource.PlayMusic(btnSound); Application.Quit(); }
public void HighScores() { SingleAudioSource.PlayMusic(btnSound); SceneManager.LoadScene("HighScoresMenu"); }
public void Controls() { SingleAudioSource.PlayMusic(btnSound); SceneManager.LoadScene("ControlsMenu"); }
public void NewGame() { SingleAudioSource.PlayMusic(btnSound); SceneManager.LoadScene("GameScene"); }
public void Continue() { SingleAudioSource.PlayMusic(buttonSound); gameCamera.Continue(); }
public void PlayAgain() { SingleAudioSource.PlayMusic(buttonSound); SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex); }