123456789101112131415161718192021222324252627282930 |
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.SceneManagement;
- using KFADA = XGame.Framework.Asyncs;
- namespace XGame.Framework.Asset
- {
- public class UnitySceneModule : IUnitySceneModule
- {
- private IAssetModule _assetModule;
- public UnitySceneModule(IAssetModule assetModule)
- {
- _assetModule = assetModule;
- }
- public KFADA.IResultAsync<TResult> LoadSceneAsync<TResult>(string sceneName) where TResult : Component
- {
- var asyncOperation = new SceneAsyncOperation<TResult>(sceneName, _assetModule);
- return asyncOperation;
- }
- public void UnLoadScene(string sceneName)
- {
- _assetModule.UnLoadSceneBundle(sceneName);
- _assetModule.UnloadUnusedAssets();
- SceneManager.UnloadSceneAsync(sceneName);
- }
- }
- }
|