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 LoadSceneAsync(string sceneName) where TResult : Component { var asyncOperation = new SceneAsyncOperation(sceneName, _assetModule); return asyncOperation; } public void UnLoadScene(string sceneName) { _assetModule.UnLoadSceneBundle(sceneName); _assetModule.UnloadUnusedAssets(); SceneManager.UnloadSceneAsync(sceneName); } } }