22 lines
462 B
C#
22 lines
462 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using UnityEngine;
|
|
|
|
public class MusicStarter : MonoBehaviour
|
|
{
|
|
public string songName = "gameplay";
|
|
|
|
void Start()
|
|
{
|
|
DelayedSongRequest();
|
|
}
|
|
|
|
async void DelayedSongRequest()
|
|
{
|
|
await Task.Delay(250);
|
|
GameObject.FindWithTag("MusicManager")
|
|
.GetComponent<MusicManager>()
|
|
.PlaySong(songName);
|
|
}
|
|
}
|