Esempio n. 1
0
 public override void ReleaseResources(IObjectPool objectPool)
 {
     objectPool.ReleaseObjects(enemies);
     objectPool.ReleaseObjects(completedEnemies);
     objectPool.ReleaseObject(enemyTemplate);
     objectPool.ReleaseObject(Path);
     base.ReleaseResources(objectPool);
 }
Esempio n. 2
0
            /// <summary>
            /// 异步卸载场景。
            /// </summary>
            /// <param name="sceneAssetName">要卸载场景资源的名称。</param>
            /// <param name="unloadSceneCallbacks">卸载场景回调函数集。</param>
            /// <param name="userData">用户自定义数据。</param>
            public void UnloadScene(string sceneAssetName, UnloadSceneCallbacks unloadSceneCallbacks, object userData)
            {
                if (m_ResourceManager.m_ResourceHelper == null)
                {
                    throw new GameFrameworkException("You must set resource helper first.");
                }

                object asset = null;

                if (m_SceneToAssetMap.TryGetValue(sceneAssetName, out asset))
                {
                    m_SceneToAssetMap.Remove(sceneAssetName);
                    m_AssetPool.Unspawn(asset);
                    if (!m_AssetPool.ReleaseObject(asset))
                    {
                        throw new GameFrameworkException(Utility.Text.Format("Unload scene '{0}' failure.", sceneAssetName));
                    }
                }
                else
                {
                    throw new GameFrameworkException(Utility.Text.Format("Can not find asset of scene '{0}'.", sceneAssetName));
                }

                m_ResourceManager.m_ResourceHelper.UnloadScene(sceneAssetName, unloadSceneCallbacks, userData);
            }
Esempio n. 3
0
 public override void ReleaseResources(IObjectPool objectPool)
 {
     objectPool.ReleaseObjects(WeaponPods);
     objectPool.ReleaseObject(WeaponPickerDialog);
     changeStatusSubscription.Dispose();
     base.ReleaseResources(objectPool);
 }
Esempio n. 4
0
 public override void ReleaseResources(IObjectPool objectPool)
 {
     objectPool.ReleaseObject(Weapon);
     objectPool.ReleaseObject(MouseHoverColorTransition);
     base.ReleaseResources(objectPool);
 }