You've already forked super-mario-bros
mirror of
https://github.com/izzy2lost/super-mario-bros.git
synced 2026-03-26 16:58:05 -07:00
3572833995
Fixed Fireworks Completed LevelCompleteManager Cleared all audio at end of scene
46 lines
955 B
C#
46 lines
955 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Firework : MonoBehaviour
|
|
{
|
|
private ScoreManager SM;
|
|
private Animator myAnim;
|
|
private SpriteRenderer mySR;
|
|
|
|
private void Awake()
|
|
{
|
|
SM = GameObject.FindGameObjectWithTag("GameController").GetComponent<ScoreManager>();
|
|
myAnim = gameObject.GetComponent<Animator>();
|
|
mySR = gameObject.GetComponent<SpriteRenderer>();
|
|
|
|
}
|
|
|
|
|
|
public void Explode()
|
|
{
|
|
if (SM)
|
|
{
|
|
SM.AddPoints(500);
|
|
}
|
|
|
|
myAnim.Play("Explode");
|
|
|
|
// TODO: Play audio of fireworks here /////////////////////////////////////////
|
|
|
|
// Seems to destroy the soundguy GO
|
|
SoundGuy.Instance.PlaySound("smb_fireworks",false);
|
|
}
|
|
|
|
public void SpriteEnabled()
|
|
{
|
|
mySR.enabled = true;
|
|
}
|
|
|
|
public void SpriteDisabled()
|
|
{
|
|
mySR.enabled = false ;
|
|
}
|
|
|
|
}
|