Files
super-mario-bros/Assets/Scripts/DummyScript.cs
2020-03-30 18:31:37 +11:00

33 lines
873 B
C#

using System.Collections;
using UnityEngine;
public class DummyScript : MonoBehaviour
{
void Start()
{
SoundGuy.Instance.PlaySound("main_theme", true);
// StartCoroutine(PlayStarSound());
}
private IEnumerator PlayStarSound()
{
yield return new WaitForSeconds(5);
SoundGuy.Instance.PlaySound("star_theme", true);
yield return new WaitForSeconds(3);
SoundGuy.Instance.PlaySound("main_theme", true);
SoundGuy.Instance.PlaySound("Player damage 2", false, OnSoundEnd);
yield return new WaitForSeconds(3);
SoundGuy.Instance.PlaySound("Player damage 2", false, OnSoundEnd);
}
private void OnSoundEnd()
{
print("I got called!");
}
public void PlayDeathSound()
{
SoundGuy.Instance.PlaySound("Player damage 2", false, OnSoundEnd);
}
}