Delayed music start
This commit is contained in:
parent
2de586fd42
commit
7ab99b81ff
1 changed files with 7 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
public class MusicStarter : MonoBehaviour
|
||||
|
@ -8,6 +9,12 @@ public class MusicStarter : MonoBehaviour
|
|||
|
||||
void Start()
|
||||
{
|
||||
DelayedSongRequest();
|
||||
}
|
||||
|
||||
async void DelayedSongRequest()
|
||||
{
|
||||
await Task.Delay(250);
|
||||
GameObject.FindWithTag("MusicManager")
|
||||
.GetComponent<MusicManager>()
|
||||
.PlaySong(songName);
|
||||
|
|
Loading…
Add table
Reference in a new issue