private void Awake() { Instance = this; IsGameRunning = true; roundTimer = levelFightTime; BGM = BGM.Initialize(gameObject); BGM.Play(); //levels = levels.RandomizeList(); }
protected virtual void OnTriggerEnter2D(Collider2D other) { IPickUp pickUp = other.gameObject.GetComponent <IPickUp> (); if (pickUp != null) { pickUp.PickUpBehaviour(this); pickUpSound.Play(); } }
private void Awake() { instance = this; mainMenuMusic = mainMenuMusic.Initialize(gameObject); mainMenuMusic.Play(); buttonPress = buttonPress.Initialize(gameObject); beeping = beeping.Initialize(gameObject); //timer.gameObject.SetActive(false); }
protected override void Update() { if (bounceCounter >= maxBounce) { gameObject.Explode(explosionForce, transform.position, explosionRadius); if (explosionSound) { explosionSound.Play(); } if (impactAnimation) { impactAnimation.SetBool("Impact", true); } gameObject.GetComponent <Renderer> ().enabled = false; gameObject.GetComponent <Rigidbody2D> ().velocity = Vector2.zero; Destroy(gameObject, 0.5f); } }
protected override void collisionBehaviour(Collision2D col) { gameObject.Explode(explosionForce, transform.position, explosionRadius); shakeCam.Shake(10); if (explosionSound) { explosionSound.Play(); } if (impactAnimation) { impactAnimation.SetBool("Impact", true); } gameObject.GetComponent <Renderer> ().enabled = false; gameObject.GetComponent <Rigidbody2D> ().velocity = Vector2.zero; Destroy(gameObject, 0.5f); }
public void PlayButtonPressSound() { buttonPress.Play(); }