Example #1
0
            public void LoadSceneAsync(string sceneName, int priority, LoadSceneCallbacks loadSceneCallbacks, object userData)
            {
                m_loadSceneCallbacks = loadSceneCallbacks;
                m_userData           = userData;
                m_duration           = 0f;

                GameEntry.GetInstance().StartCoroutine(BeginLoadSceneAsync(sceneName, priority));
            }
Example #2
0
 /// <summary>
 /// 使用同步方式加载场景
 /// </summary>
 /// <param name="sceneName">场景名称</param>
 /// <param name="priority">加载优先级,数值越低,加载优先级越高</param>
 /// <param name="loadSceneCallbacks">加载回调函数类</param>
 /// <param name="userData">用户数据</param>
 public void LoadScene(string sceneName, int priority, LoadSceneCallbacks loadSceneCallbacks, object userData)
 {
     SceneManager.LoadScene(sceneName, LoadSceneMode.Single);
     if (loadSceneCallbacks.LoadSceneSuccessCallback != null)
     {
         loadSceneCallbacks.LoadSceneSuccessCallback(sceneName, 0, userData);
     }
 }
Example #3
0
        public static void LoadScene(string sceneName, LoadSceneCallbacks loadCallbacks, object userData)
        {
            if (string.IsNullOrEmpty(sceneName))
            {
                UnityEngine.Debug.LogError("Load Scene Name is a null value");
                return;
            }
            if (loadCallbacks == null)
            {
                UnityEngine.Debug.LogError("Load Scene not contain callbacks");
                return;
            }

            ResourceManager.GetInstance().m_resourceLoader.LoadSceneAsync(sceneName, 0, loadCallbacks, userData);
        }
Example #4
0
 /// <summary>
 /// 异步加载场景
 /// </summary>
 /// <param name="sceneName"></param>
 /// <param name="finishDelegate"></param>
 public static void LoadScene(string sceneName, LoadSceneCallbacks loadCallbacks)
 {
     ResourceManager.LoadScene(sceneName, loadCallbacks, null);
 }