24 lines
530 B
C#
24 lines
530 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class StartGameDelay : MonoBehaviour{
|
|
|
|
[SerializeField] Animator fade;
|
|
|
|
void Start(){
|
|
AudioManager.instance.Play("MenuMusic");
|
|
}
|
|
|
|
public void StartGame(float delay){
|
|
AudioManager.instance.FadeOut("MenuMusic", 1f);
|
|
StartCoroutine(DelayedStart(delay));
|
|
}
|
|
|
|
IEnumerator DelayedStart(float delay){
|
|
yield return new WaitForSeconds(delay - 1f);
|
|
fade.SetTrigger("FadeIn");
|
|
yield return new WaitForSeconds(1f);
|
|
Loader.Load(3);
|
|
}
|
|
}
|