init
This commit is contained in:
commit
e0a842f222
796 changed files with 361371 additions and 0 deletions
24
Assets/Scripts/StartGameDelay.cs
Normal file
24
Assets/Scripts/StartGameDelay.cs
Normal file
|
@ -0,0 +1,24 @@
|
|||
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);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue