blob: fa93b474d7126c23d8764d2931d0cf8a4bf45484 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
using System.Collections;
using UnityEngine;
namespace I2.Loc;
public class CoroutineManager : MonoBehaviour
{
private static CoroutineManager mInstance;
private static CoroutineManager pInstance
{
get
{
if (mInstance == null)
{
GameObject gameObject = new GameObject("_Coroutiner");
gameObject.hideFlags = HideFlags.HideAndDontSave;
mInstance = gameObject.AddComponent<CoroutineManager>();
if (Application.isPlaying)
{
Object.DontDestroyOnLoad(gameObject);
}
}
return mInstance;
}
}
private void Awake()
{
if (Application.isPlaying)
{
Object.DontDestroyOnLoad(base.gameObject);
}
}
public static Coroutine Start(IEnumerator coroutine)
{
return pInstance.StartCoroutine(coroutine);
}
}
|