Exemplo n.º 1
0
 /// <summary>
 /// 切换场景 异步加载
 /// </summary>
 /// <param name="name">场景名字</param>
 /// <param name="fuction"></param>
 public void LoadSceneAsync(string name, UnityAction <AsyncOperation> fuction)
 {
     if (IsValidCanLoadScene(name))
     {
         MonoMgr.GetInstance().StartCoroutine(ReallyLoadSceneAsync(name, fuction));
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 从一个背景音乐过渡到另一个背景音乐
 /// </summary>
 /// <param name="_from"></param>
 /// <param name="_to"></param>
 /// <param name="_time"></param>
 public void PlayBGMMusicTransition(AudioClip _to, float _time)
 {
     if (bgMusic != null)
     {
         isTransition = false;
         MonoMgr.GetInstance().StartCoroutine(BGMMusicTransition(bgMusic, _to, _time));
     }
 }
Exemplo n.º 3
0
 public MusicMgr()
 {
     if (musicMgrObj == null)
     {
         musicMgrObj = new GameObject("MusicMgr");
         GameObject.DontDestroyOnLoad(musicMgrObj);
     }
     MonoMgr.GetInstance().AddUpdateListener(UpdateSound);
 }
Exemplo n.º 4
0
 public InputMgr()
 {
     MonoMgr.GetInstance().AddUpdateListener(InputUpdate);
     //MonoMgr.GetInstance().AddFixedUpdateListener(InputUpdate);
 }
Exemplo n.º 5
0
 /// <summary>
 /// 异步加载接口
 /// </summary>
 /// <typeparam name="T">类型</typeparam>
 /// <param name="name">地址</param>
 /// <param name="callback">方法</param>
 public void loadAsync <T>(string name, UnityAction <T> callback) where T : Object
 {
     MonoMgr.GetInstance().StartCoroutine(ReallyloadAsync(name, callback));
 }