Example #1
0
 private void LoadSceneDependencyAssetCallback(string sceneAssetName, string dependencyAssetName, int loadedCount, int totalCount, object userData)
 {
     if (m_LoadSceneDependencyAssetEventHandler != null)
     {
         InnerLoadSceneDependencyAssetEventArgs loadSceneDependencyAssetEventArgs = InnerLoadSceneDependencyAssetEventArgs.Create(sceneAssetName, dependencyAssetName, loadedCount, totalCount, userData);
         m_LoadSceneDependencyAssetEventHandler(this, loadSceneDependencyAssetEventArgs);
         ReferencePool.Release(loadSceneDependencyAssetEventArgs);
     }
 }
        /// <summary>
        /// 创建加载场景时加载依赖资源事件。
        /// </summary>
        /// <param name="e">内部事件。</param>
        /// <returns>创建的加载场景时加载依赖资源事件。</returns>
        public static OuterLoadSceneDependencyAssetEventArgs Create(InnerLoadSceneDependencyAssetEventArgs e)
        {
            OuterLoadSceneDependencyAssetEventArgs loadSceneDependencyAssetEventArgs = ReferencePool.Acquire <OuterLoadSceneDependencyAssetEventArgs>();

            loadSceneDependencyAssetEventArgs.SceneAssetName      = e.SceneAssetName;
            loadSceneDependencyAssetEventArgs.DependencyAssetName = e.DependencyAssetName;
            loadSceneDependencyAssetEventArgs.LoadedCount         = e.LoadedCount;
            loadSceneDependencyAssetEventArgs.TotalCount          = e.TotalCount;
            loadSceneDependencyAssetEventArgs.UserData            = e.UserData;
            return(loadSceneDependencyAssetEventArgs);
        }