From 0101213f5e3d6a2916908256bce90ed9c6d78f01 Mon Sep 17 00:00:00 2001 From: MichaelO Date: Sun, 19 May 2024 02:18:30 +0800 Subject: [PATCH] updated to v2.11.3 (added new api methods) --- .../Scripts/Runtime/AssetLoaders.cs | 52 +++ .../Scripts/Runtime/Cacher/CacheBundle.cs | 105 +++++ Assets/OxGFrame/CHANGELOG.md | 106 +++-- .../Scripts/Runtime/Core/CoreFrames.cs | 427 ++++++++++++++++++ .../Scripts/Runtime/Core/USFrame/USManager.cs | 77 +++- .../USFrameDemo/Scripts/USFrameDemo.cs | 116 +++-- Assets/OxGFrame/package.json | 2 +- 7 files changed, 806 insertions(+), 79 deletions(-) diff --git a/Assets/OxGFrame/AssetLoader/Scripts/Runtime/AssetLoaders.cs b/Assets/OxGFrame/AssetLoader/Scripts/Runtime/AssetLoaders.cs index 828d0670..69594be3 100644 --- a/Assets/OxGFrame/AssetLoader/Scripts/Runtime/AssetLoaders.cs +++ b/Assets/OxGFrame/AssetLoader/Scripts/Runtime/AssetLoaders.cs @@ -34,6 +34,24 @@ public static async UniTask LoadSceneAsync(string packageName, strin return await CacheBundle.GetInstance().LoadSceneAsync(packageName, assetName, loadSceneMode, activateOnLoad, priority, progression); } + /// + /// Only load scene from bundle + /// + /// + /// + /// + /// + public static BundlePack LoadScene(string assetName, LoadSceneMode loadSceneMode = LoadSceneMode.Single) + { + string packageName = AssetPatcher.GetDefaultPackageName(); + return CacheBundle.GetInstance().LoadScene(packageName, assetName, loadSceneMode); + } + + public static BundlePack LoadScene(string packageName, string assetName, LoadSceneMode loadSceneMode = LoadSceneMode.Single) + { + return CacheBundle.GetInstance().LoadScene(packageName, assetName, loadSceneMode); + } + /// /// Only load scene from bundle /// @@ -53,6 +71,23 @@ public static async UniTask LoadSingleSceneAsync(string packageName, return await CacheBundle.GetInstance().LoadSceneAsync(packageName, assetName, LoadSceneMode.Single, activateOnLoad, priority, progression); } + /// + /// Only load scene from bundle + /// + /// + /// + /// + public static BundlePack LoadSingleScene(string assetName) + { + string packageName = AssetPatcher.GetDefaultPackageName(); + return CacheBundle.GetInstance().LoadScene(packageName, assetName, LoadSceneMode.Single); + } + + public static BundlePack LoadSingleScene(string packageName, string assetName) + { + return CacheBundle.GetInstance().LoadScene(packageName, assetName, LoadSceneMode.Single); + } + /// /// Only load scene from bundle /// @@ -72,6 +107,23 @@ public static async UniTask LoadAdditiveSceneAsync(string packageNam return await CacheBundle.GetInstance().LoadSceneAsync(packageName, assetName, LoadSceneMode.Additive, activateOnLoad, priority, progression); } + /// + /// Only load scene from bundle + /// + /// + /// + /// + public static BundlePack LoadAdditiveScene(string assetName) + { + string packageName = AssetPatcher.GetDefaultPackageName(); + return CacheBundle.GetInstance().LoadScene(packageName, assetName, LoadSceneMode.Additive); + } + + public static BundlePack LoadAdditiveScene(string packageName, string assetName) + { + return CacheBundle.GetInstance().LoadScene(packageName, assetName, LoadSceneMode.Additive); + } + /// /// Only unload scene from bundle /// diff --git a/Assets/OxGFrame/AssetLoader/Scripts/Runtime/Cacher/CacheBundle.cs b/Assets/OxGFrame/AssetLoader/Scripts/Runtime/Cacher/CacheBundle.cs index fa3ec8d8..3341342f 100644 --- a/Assets/OxGFrame/AssetLoader/Scripts/Runtime/Cacher/CacheBundle.cs +++ b/Assets/OxGFrame/AssetLoader/Scripts/Runtime/Cacher/CacheBundle.cs @@ -646,6 +646,111 @@ public async UniTask LoadSceneAsync(string packageName, string asset return pack; } + public BundlePack LoadScene(string packageName, string assetName, LoadSceneMode loadSceneMode) + { + /** + * Single Scene will auto unload and release + */ + + if (string.IsNullOrEmpty(assetName)) return null; + + // 如果有進行 Loading 標記後, 直接 return + if (this.HasInLoadingFlags(assetName) && !this.GetRetryCounter(assetName).IsRetryValid()) + { + if (this.GetRetryCounter(assetName).IsRetryActive()) + { + this.RemoveLoadingFlags(assetName); + Logging.Print($"Asset: {assetName} Load failed and cannot retry anymore!!! Please to check asset is existing."); + } + else Logging.Print($"Asset: {assetName} Loading..."); + return null; + } + + // 場景最多嘗試 1 次 + byte maxRetryCount = 1; + // Loading 標記 + this.AddLoadingFlags(assetName, maxRetryCount); + + bool loaded = false; + var pack = new BundlePack(); + + // 場景需特殊處理 + var package = PackageManager.GetPackage(packageName); + if (package != null && package.CheckLocationValid(assetName)) + { + var req = package.LoadSceneSync(assetName, loadSceneMode); + if (req != null) + { + int frame = 1000; + do + { + if (req.IsDone) + { + loaded = true; + switch (loadSceneMode) + { + case LoadSceneMode.Single: + { + pack.SetPack(packageName, assetName, req); + + // 清除 Additive 計數緩存 (主場景無需緩存, 因為會自動釋放子場景) + this._additiveScenes.Clear(); + this._additiveSceneCounter.Clear(); + } + break; + case LoadSceneMode.Additive: + { + pack.SetPack(packageName, assetName, req); + + // 加載場景的計數緩存 (Additive 需要進行計數, 要手動卸載子場景) + if (!this._additiveSceneCounter.ContainsKey(assetName)) + { + this._additiveSceneCounter.Add(assetName, 1); + var count = this._additiveSceneCounter[assetName]; + string key = $"{assetName}#{count}"; + this._additiveScenes.Add(key, pack); + Logging.Print($"【Load Scene Additive】 => << CacheBundle >> scene: {key}"); + } + else + { + var count = ++this._additiveSceneCounter[assetName]; + string key = $"{assetName}#{count}"; + this._additiveScenes.Add(key, pack); + Logging.Print($"【Load Scene Additive】 => << CacheBundle >> scene: {key}"); + } + } + break; + } + break; + } + + // 保險機制 (Fuse breaker) + frame--; + if (frame <= 0) + break; + } while (true); + } + } + else + { + Logging.Print($"Package: {packageName} doesn't exist or location invalid."); + } + + // (Caution) If use sync to load scene.isLoaded return false -> Why?? + if (!loaded) + { + this.UnloadScene(assetName, true); + if (this.GetRetryCounter(assetName).IsRetryActive()) Logging.Print($"【Load Scene】 => << CacheBundle >> Asset: {assetName} doing retry. Retry count: {this.GetRetryCounter(assetName).retryCount}, Max retry count: {maxRetryCount}"); + else Logging.Print($"【Load Scene】 => << CacheBundle >> Asset: {assetName} start doing retry. Max retry count: {maxRetryCount}"); + this.GetRetryCounter(assetName).AddRetryCount(); + return this.LoadScene(packageName, assetName, loadSceneMode); + } + + this.RemoveLoadingFlags(assetName); + + return pack; + } + public void UnloadScene(string assetName, bool recursively) { /** diff --git a/Assets/OxGFrame/CHANGELOG.md b/Assets/OxGFrame/CHANGELOG.md index 372c5a53..22d4e41a 100644 --- a/Assets/OxGFrame/CHANGELOG.md +++ b/Assets/OxGFrame/CHANGELOG.md @@ -1,5 +1,33 @@ # CHANGELOG +## [2.11.3] - 2024-05-19 +- Added new methods for sync loading of scene. +```csharp + public static void LoadSingleScene(string sceneName) + public static void LoadSingleScene(string packageName, string sceneName) + public static void LoadAdditiveScene(string sceneName) + public static void LoadAdditiveScene(string sceneName, bool activeRootGameObjects = true) + public static void LoadAdditiveScene(string packageName, string sceneName) + public static void LoadAdditiveScene(string packageName, string sceneName, bool activeRootGameObjects = true) + public static void LoadScene(string sceneName, LoadSceneMode loadSceneMode) + public static void LoadScene(string packageName, string sceneName, LoadSceneMode loadSceneMode) + public static Scene LoadScene(int buildIndex, LoadSceneMode loadSceneMode = LoadSceneMode.Single) +``` +- Added new methods to combine load a single scene and additive scenes. +```csharp + public static async UniTask LoadMainAndSubScenesAsync(string singleSceneName, AdditiveSceneInfo[] additiveSceneInfos, uint priority = 100, Progression progression = null) + public static async UniTask LoadMainAndSubScenesAsync(string packageName, string singleSceneName, AdditiveSceneInfo[] additiveSceneInfos, uint priority = 100, Progression progression = null) + public static void LoadMainAndSubScenes(string singleSceneName, AdditiveSceneInfo[] additiveSceneInfos) + public static void LoadMainAndSubScenes(string packageName, string singleSceneName, AdditiveSceneInfo[] additiveSceneInfos) +``` +- Added new methods to load additive scenes. +```csharp + public static async UniTask LoadSubScenesAsync(AdditiveSceneInfo[] additiveSceneInfos, uint priority = 100, Progression progression = null) + public static async UniTask LoadSubScenesAsync(string packageName, AdditiveSceneInfo[] additiveSceneInfos, uint priority = 100, Progression progression = null) + public static void LoadSubScenes(AdditiveSceneInfo[] additiveSceneInfos) + public static void LoadSubScenes(string packageName, AdditiveSceneInfo[] additiveSceneInfos) +``` + ## [2.11.2] - 2024-05-18 - Added burlconfig.conf can export cipher type (If the output is ciphertext, it will automatically determine whether to execute with the decryption process). - Cipher process. @@ -33,12 +61,12 @@ https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask ## [2.10.2] - 2024-03-19 - Fixed When scene load with suspend (activateOnLoad = false) cannot return BundlePack correctly . -```C# +```csharp // activateOnLoad = false (suspend) var bundlePack = await CoreFrames.USFrame.LoadAdditiveSceneAsync("MyPackage", "SceneName", false, 100); ``` - Added UnsuspendScene in BundlePack. -```C# +```csharp // Method 1 var bundlePack = await CoreFrames.USFrame.LoadAdditiveSceneAsync("MyPackage", "SceneName", false, 100); bundlePack.GetOperationHandle().UnSuspend(); @@ -93,7 +121,7 @@ CPBase: ## [2.10.0] - 2024-03-07 - Added BuiltinQueryMode option on PatchLauncher, can switch built-in query mode. -```C# +```csharp public enum BuiltinQueryMode { WebRequest, @@ -102,7 +130,7 @@ CPBase: } ``` - Added Auto save binding content to script for UIBase, SRBase, CPBase. -```C# +```csharp // Specific pattern #region Binding Components #endregion @@ -111,7 +139,7 @@ CPBase: ## [2.9.16] - 2024-02-20 - Updated YooAsset commits. - Added InitPackage in AssetPatcher. -```C# +```csharp /// /// Init package by type /// @@ -121,7 +149,7 @@ CPBase: public static async UniTask InitPackage(PackageInfoWithBuild packageInfo, bool autoUpdate = false) ``` - Modified PackageOperation initialize procedure by manual. -```C# +```csharp public class PackageOperation { /// @@ -137,7 +165,7 @@ public class PackageOperation ## [2.9.15] - 2024-02-19 - Updated UniTask to v2.5.3. - Added DriveUpdate methods in CPBase (can call update by other PlayerLoop). -```C# +```csharp public void DriveUpdate(float dt) => this.HandleUpdate(dt); public void DriveFixedUpdate(float dt) => this.HandleFixedUpdate(dt); public void DriveLateUpdate(float dt) => this.HandleLateUpdate(dt); @@ -145,7 +173,7 @@ public class PackageOperation ## [2.9.14] - 2024-02-02 - Modified PackageOperation user callback events, can reference itself in callback. -```C# +```csharp public class PackageOperation { public delegate void OnPatchRepairFailed(PackageOperation itself); @@ -164,7 +192,7 @@ public class PackageOperation - Must add PatchEvents.PatchCheckDiskNotEnoughSpace in patchEvents to handle it (checkout BundleDemo). - Added CheckDiskSpace flag setting on PatchLauncher inspector. - Added Can set user event handler to PackageOperation. -```C# +```csharp public class PackageOperation { /// @@ -199,14 +227,14 @@ param animeEndCb => animationEnd ## [2.9.12] - 2024-01-16 - Added CoreFrames.UIFrame.GetStackByStackCount method. -```C# +```csharp public static int GetStackByStackCount(string canvasName) public static int GetStackByStackCount(int groupId, string canvasName) ``` **How to use it** -```C# +```csharp if (Keyboard.current.escapeKey.wasReleasedThisFrame) { if (CoreFrames.UIFrame.GetStackByStackCount(groupId, canvasName) > 0) @@ -220,7 +248,7 @@ param animeEndCb => animationEnd } ``` - Modified UI NodeType name (the original settings will not be changed). -```C# +```csharp public enum NodeType { Fixed, // Normal => Fixed @@ -252,7 +280,7 @@ param animeEndCb => animationEnd ## [2.9.9] - 2023-12-18 - Added PackageOperation feature, can download packages more easier (please checkout BundleDLCDemo). -```C# +```csharp // Factory Mode public static PackageOperation CreateOperation(string groupName, PackageInfoWithBuild packageInfo, bool skipDownload = false) public static PackageOperation CreateOperation(string groupName, PackageInfoWithBuild[] packageInfos, bool skipDownload = false) @@ -286,7 +314,7 @@ param animeEndCb => animationEnd ``` - Added BundleDLCDemo for operate PackageOperation. - Modified params to PackageInfoWithBuild. -```C# +```csharp public abstract class PackageInfoWithBuild { [Tooltip("Only for EditorSimulateMode")] @@ -312,7 +340,7 @@ param animeEndCb => animationEnd ## [2.9.8] - 2023-12-08 - Added Generate binding code rule (MethodType: Manual, Auto, default is Auto). -```C# +```csharp #region Binding Components protected Image _bgImg; protected Text _msgTxt; @@ -339,7 +367,7 @@ param animeEndCb => animationEnd ## [2.9.5] - 2023-12-05 - Added AppPackageInfoWithBuild and DlcPackageInfoWithBuild (BuildMode can be selected when executing on SimulateMode). -```C# +```csharp [Serializable] public class PackageInfoWithBuild { @@ -366,31 +394,31 @@ param animeEndCb => animationEnd - Updated UniMachine ([Blackboard](https://github.com/gmhevinci/UniFramework/commit/3ea882c2fc8d5314c51e66fa35579324d0c7a73c)). - Updated UniTask to [v2.5.0](https://github.com/Cysharp/UniTask/releases/tag/2.5.0). - Renamed GetAllScene to GetAllScenes in CoreFrames.USFrame. -```C# +```csharp public static Scene[] GetAllScenes(params string[] sceneNames) public static Scene[] GetAllScenes(params int[] buildIndexes) ``` - Added CoreFrames.UIFrame, CoreFrames.SRFrame can control updates (**enabledUpdate defaults is true, else are false**). -```C# +```csharp public static bool ignoreTimeScale public static bool enabledUpdate public static bool enabledFixedUpdate public static bool enabledLateUpdate ``` - Added FixedUpdate, LateUpdate behaviour to FrameBase (UIBase, SRBase, CPBase). -```C# +```csharp protected override void OnFixedUpdate(float dt) { } protected override void OnLateUpdate(float dt) { } ``` - Added SetActiveSceneRootGameObjects method in CoreFrames.USFrame (Can control the active of scene root GameObjects). -```C# +```csharp public static void SetActiveSceneRootGameObjects(string sceneName, bool active, string[] withoutRootGameObjectNames = null) public static void SetActiveSceneRootGameObjects(Scene scene, bool active, string[] withoutRootGameObjectNames = null) ``` - - Added overload methods in CoreFrames.USFrame (LoadAdditiveSceneAsync has activeRootGameObjects param, can control the active of root GameObjects after the scene is loaded). -```C# +```csharp public static async UniTask LoadAdditiveSceneAsync(string sceneName, bool activeRootGameObjects = true, bool activateOnLoad = true, uint priority = 100, Progression progression = null) public static async UniTask LoadAdditiveSceneAsync(string sceneName, bool activeRootGameObjects = true, bool activateOnLoad = true, uint priority = 100, Progression progression = null) where T : class public static async UniTask LoadAdditiveSceneAsync(string packageName, string sceneName, bool activeRootGameObjects = true, bool activateOnLoad = true, uint priority = 100, Progression progression = null) @@ -418,7 +446,7 @@ param animeEndCb => animationEnd - Fixed UIManager CloseAll with groupId bug issue. - Added [AllowCloseStackByStack] setting for UI. - Added CloseStackByStack method in CoreFrames.UIFrame. -```C# +```csharp // Only allow close stack by stack public static void CloseStackByStack(string canvasName, bool disablePreClose = false, bool forceDestroy = false) public static void CloseStackByStack(int groupId, string canvasName, bool disablePreClose = false, bool forceDestroy = false) @@ -429,7 +457,7 @@ param animeEndCb => animationEnd - Added Priority param for any load async methods (can controls loading priority by YooAsset). - Optimized cached AppConfig in Runtime. - Modified BindCodeSetting init param and use region to group binding code (more clear). -```C# +```csharp #region Binding Components protected GameObject _openBtn; @@ -443,7 +471,7 @@ param animeEndCb => animationEnd #endregion ``` - Changed CoreFrame.FrameBase method name (OnInit change to OnCreate). -```C# +```csharp // Replace all OnInit() to OnCreate() public override void OnCreate() { @@ -453,7 +481,7 @@ param animeEndCb => animationEnd } ``` - Chagned GSIFrame.GSIBase method name (OnInit change to OnCreate). -```C# +```csharp // Replace all OnInit() to OnCreate() public async override UniTask OnCreate() { @@ -461,7 +489,7 @@ param animeEndCb => animationEnd } ``` - Removed methods from AssetPatcher. -```C# +```csharp // Removed public static string GetPresetAppPackageNameByIdx(int idx) ``` @@ -491,7 +519,7 @@ param animeEndCb => animationEnd - Fixed RetryCounter reference bug issue. - Modified RefinePath methods use SubString to process. - Modified params of SendRefreshData method (use RefreshInfo struct). -```C# +```csharp // CoreFrames.UIFrame & CoreFrames.SRFrame public static void SendRefreshData(RefreshInfo refreshInfo) public static void SendRefreshData(RefreshInfo[] refreshInfos) @@ -500,7 +528,7 @@ param animeEndCb => animationEnd ## [2.7.10] - 2023-09-11 - Added more check methods for AssetObject. -```C# +```csharp public bool IsRawFileOperationHandleValid() public bool IsSceneOperationHandleValid() public bool IsAssetOperationHandleValid() @@ -537,7 +565,7 @@ param animeEndCb => animationEnd - Optimized UIBase and SRBase of CoreFrame update behaviour call by FrameManager. - Optimized CPBase of CoreFrame update behaviour, if need to update have to call by self to drive. - Added DriveSelfUpdate(float dt) method in CPBase (drive by self). -```C# +```csharp public class NewTplCP : CPBase { private void Update() @@ -556,7 +584,7 @@ public class NewTplCP : CPBase - Updated part of UniFramework. #### CoreFrames (UIFrame, SRFrame) - Added API. -```C# +```csharp public static void SendRefreshData(string assetName, object data = null) public static void SendRefreshData(string[] assetNames, object[] data = null) @@ -564,7 +592,7 @@ public class NewTplCP : CPBase #### AssetPatcher - Added API. Common -```C# +```csharp public struct DownloadInfo { public int totalCount; @@ -576,7 +604,7 @@ Common public static async UniTask BeginDownloadWithCombineDownloaders(ResourceDownloaderOperation[] downloaders, OnDownloadSpeedProgress onDownloadSpeedProgress = null, OnDownloadError onDownloadError = null) ``` Get Downloader -```C# +```csharp // All public static ResourceDownloaderOperation[] GetDownloadersWithCombinePackages(ResourcePackage[] packages) @@ -598,7 +626,7 @@ Get Downloader public static ResourceDownloaderOperation[] GetDownloadersWithCombinePackagesByAssetInfos(ResourcePackage[] packages, int maxConcurrencyDownloadCount, int failedRetryCount, params AssetInfo[] assetInfos) ``` Begin Download -```C# +```csharp // All public static async UniTask BeginDownloadWithCombinePackages(ResourcePackage[] packages, OnDownloadSpeedProgress onDownloadSpeedProgress = null, OnDownloadError onDownloadError = null) @@ -620,7 +648,7 @@ Begin Download public static async UniTask BeginDownloadWithCombinePackagesByAssetInfos(ResourcePackage[] packages, int maxConcurrencyDownloadCount, int failedRetryCount, AssetInfo[] assetInfos = null, OnDownloadSpeedProgress onDownloadSpeedProgress = null, OnDownloadError onDownloadError = null) ``` Get Download Info -```C# +```csharp // All public static DownloadInfo GetDownloadInfoWithCombinePackages(ResourcePackage[] packages) @@ -640,7 +668,7 @@ Get Download Info ## [2.7.1] - 2023-08-05 - Added Default API in GSIManagerBase (protected GetInstance() method). -```C# +```csharp public static int GetCurrentId() public static U GetStage() where U : GSIBase @@ -662,7 +690,7 @@ Get Download Info public static void Update(float dt = 0.0f) ``` - Added Default API in CenterBase (removed Default API from subtype). -```C# +```csharp public static void Add() where UClass : TClass, new() public static void Add(int id) where UClass : TClass, new() @@ -785,7 +813,7 @@ Get Download Info ## [2.3.1] - 2023-06-19 - Added bind collector can use GetNodeComponent(string nodeName) to get component. -```C# +```csharp // Single collector.GetNodeComponent("BindName"); @@ -849,7 +877,7 @@ collector.GetNodeComponents("BindName"); ## [2.1.4] - 2023-05-15 - Added DownloadSpeedCalculator (using OxGFrame.AssetLoader.Utility). -```C# +```csharp var packageName = "DlcPackage"; bool isInitialized = await AssetPatcher.InitDlcPackage(packageName, "dlcVersion", true); if (isInitialized) @@ -915,7 +943,7 @@ if (isInitialized) - Extended CoreFrames.USFrame methods (LoadSingleSceneAsync and LoadAdditiveSceneAsync). - Extended load asset and download from specific package. - Optimized code. -```C# +```csharp // [Load asset and download from specific package] var packageName = "OtherPackage"; await AssetPatcher.InitPackage(packageName, true, "127.0.0.1/package", "127.0.0.1/package"); diff --git a/Assets/OxGFrame/CoreFrame/Scripts/Runtime/Core/CoreFrames.cs b/Assets/OxGFrame/CoreFrame/Scripts/Runtime/Core/CoreFrames.cs index 94c78900..13789682 100644 --- a/Assets/OxGFrame/CoreFrame/Scripts/Runtime/Core/CoreFrames.cs +++ b/Assets/OxGFrame/CoreFrame/Scripts/Runtime/Core/CoreFrames.cs @@ -4,6 +4,7 @@ using OxGFrame.CoreFrame.SRFrame; using OxGFrame.CoreFrame.UIFrame; using OxGFrame.CoreFrame.USFrame; +using OxGKit.LoggingSystem; using UnityEngine; using UnityEngine.SceneManagement; @@ -655,6 +656,20 @@ public static async UniTask LoadSingleSceneAsync(string sceneName, Progression p else await USManager.GetInstance().LoadFromBundleAsync(packageName, sceneName, LoadSceneMode.Single, true, 100, progression); } + /// + /// (Single) If use prefix "build#" will load from build and else will load from bundle + /// + /// + public static void LoadSingleScene(string sceneName) + { + var packageName = AssetPatcher.GetDefaultPackageName(); + if (RefineBuildScenePath(ref sceneName)) + { + USManager.GetInstance().LoadFromBuild(sceneName, LoadSceneMode.Single); + } + else USManager.GetInstance().LoadFromBundle(packageName, sceneName, LoadSceneMode.Single); + } + /// /// (Single) If use prefix "build#" will load from build and else will load from bundle /// @@ -691,6 +706,20 @@ public static async UniTask LoadSingleSceneAsync(string packageName, string scen else await USManager.GetInstance().LoadFromBundleAsync(packageName, sceneName, LoadSceneMode.Single, true, 100, progression); } + /// + /// (Single) If use prefix "build#" will load from build and else will load from bundle + /// + /// + /// + public static void LoadSingleScene(string packageName, string sceneName) + { + if (RefineBuildScenePath(ref sceneName)) + { + USManager.GetInstance().LoadFromBuild(sceneName, LoadSceneMode.Single); + } + else USManager.GetInstance().LoadFromBundle(packageName, sceneName, LoadSceneMode.Single); + } + /// /// (Single) If use prefix "build#" will load from build and else will load from bundle /// @@ -744,6 +773,34 @@ public static async UniTask LoadAdditiveSceneAsync(string sceneName, bool active /// (Additive) If use prefix "build#" will load from build and else will load from bundle /// /// + public static void LoadAdditiveScene(string sceneName) + { + var packageName = AssetPatcher.GetDefaultPackageName(); + if (RefineBuildScenePath(ref sceneName)) + { + USManager.GetInstance().LoadFromBuild(sceneName, LoadSceneMode.Additive); + } + else USManager.GetInstance().LoadFromBundle(packageName, sceneName, LoadSceneMode.Additive); + } + + public static void LoadAdditiveScene(string sceneName, bool activeRootGameObjects = true) + { + var packageName = AssetPatcher.GetDefaultPackageName(); + if (RefineBuildScenePath(ref sceneName)) + { + USManager.GetInstance().LoadFromBuild(sceneName, LoadSceneMode.Additive); + } + else USManager.GetInstance().LoadFromBundle(packageName, sceneName, LoadSceneMode.Additive); + if (!activeRootGameObjects) USManager.GetInstance().SetActiveSceneRootGameObjects(sceneName, false); + } + + /// + /// (Additive) If use prefix "build#" will load from build and else will load from bundle + /// + /// + /// + /// + /// /// /// /// From Build is <AsyncOperation> @@ -804,6 +861,30 @@ public static async UniTask LoadAdditiveSceneAsync(string packageName, string sc if (!activeRootGameObjects) USManager.GetInstance().SetActiveSceneRootGameObjects(sceneName, false); } + /// + /// (Additive) If use prefix "build#" will load from build and else will load from bundle + /// + /// + /// + public static void LoadAdditiveScene(string packageName, string sceneName) + { + if (RefineBuildScenePath(ref sceneName)) + { + USManager.GetInstance().LoadFromBuild(sceneName, LoadSceneMode.Additive); + } + else USManager.GetInstance().LoadFromBundle(packageName, sceneName, LoadSceneMode.Additive); + } + + public static void LoadAdditiveScene(string packageName, string sceneName, bool activeRootGameObjects = true) + { + if (RefineBuildScenePath(ref sceneName)) + { + USManager.GetInstance().LoadFromBuild(sceneName, LoadSceneMode.Additive); + } + else USManager.GetInstance().LoadFromBundle(packageName, sceneName, LoadSceneMode.Additive); + if (!activeRootGameObjects) USManager.GetInstance().SetActiveSceneRootGameObjects(sceneName, false); + } + /// /// (Additive) If use prefix "build#" will load from build and else will load from bundle /// @@ -842,6 +923,312 @@ public static async UniTask LoadAdditiveSceneAsync(string packageName, str } } + /// + /// Load single scene and additive scenes + /// + /// + /// + /// + /// + /// + public static async UniTask LoadMainAndSubScenesAsync(string singleSceneName, AdditiveSceneInfo[] additiveSceneInfos, uint priority = 100, Progression progression = null) + { + var scene = GetSceneByName(singleSceneName); + if (!string.IsNullOrEmpty(scene.name) && + scene.isLoaded) + { + Logging.PrintWarning($"Single Scene => {singleSceneName} already exists!!!"); + return; + } + + float comboCurrentCount = 0; + float comboTotalCount = 1; + + if (additiveSceneInfos != null) + comboTotalCount += additiveSceneInfos.Length; + + // Single scene + bool loaded = false; + await LoadSingleSceneAsync(singleSceneName, (float progress, float currentCount, float totalCount) => + { + if (!loaded && progress == 1) + { + comboCurrentCount += progress; + loaded = true; + } + progression?.Invoke(comboCurrentCount / comboTotalCount, comboCurrentCount, comboTotalCount); + }); + + // Additive scenes + if (additiveSceneInfos != null) + { + uint idx = 0; + foreach (var additiveSceneInfo in additiveSceneInfos) + { + loaded = false; + await LoadAdditiveSceneAsync + ( + additiveSceneInfo.sceneName, + additiveSceneInfo.activeRootGameObjects, + true, + priority + idx, + (float progress, float currentCount, float totalCount) => + { + if (!loaded && progress == 1) + { + comboCurrentCount += progress; + loaded = true; + } + progression?.Invoke(comboCurrentCount / comboTotalCount, comboCurrentCount, comboTotalCount); + } + ); + idx++; + } + } + } + + public static void LoadMainAndSubScenes(string singleSceneName, AdditiveSceneInfo[] additiveSceneInfos) + { + var scene = GetSceneByName(singleSceneName); + if (!string.IsNullOrEmpty(scene.name) && + scene.isLoaded) + { + Logging.PrintWarning($"Single Scene => {singleSceneName} already exists!!!"); + return; + } + + // Single scene + LoadSingleScene(singleSceneName); + + // Additive scenes + if (additiveSceneInfos != null) + { + foreach (var additiveSceneInfo in additiveSceneInfos) + { + LoadAdditiveScene + ( + additiveSceneInfo.sceneName, + additiveSceneInfo.activeRootGameObjects + ); + } + } + } + + /// + /// Load additive scenes + /// + /// + /// + /// + /// + public static async UniTask LoadSubScenesAsync(AdditiveSceneInfo[] additiveSceneInfos, uint priority = 100, Progression progression = null) + { + float comboCurrentCount = 0; + float comboTotalCount = 0; + + if (additiveSceneInfos != null) + comboTotalCount += additiveSceneInfos.Length; + + // Additive scenes + if (additiveSceneInfos != null) + { + uint idx = 0; + foreach (var additiveSceneInfo in additiveSceneInfos) + { + bool loaded = false; + await LoadAdditiveSceneAsync + ( + additiveSceneInfo.sceneName, + additiveSceneInfo.activeRootGameObjects, + true, + priority + idx, + (float progress, float currentCount, float totalCount) => + { + if (!loaded && progress == 1) + { + comboCurrentCount += progress; + loaded = true; + } + progression?.Invoke(comboCurrentCount / comboTotalCount, comboCurrentCount, comboTotalCount); + } + ); + idx++; + } + } + } + + public static void LoadSubScenes(AdditiveSceneInfo[] additiveSceneInfos) + { + // Additive scenes + if (additiveSceneInfos != null) + { + foreach (var additiveSceneInfo in additiveSceneInfos) + { + LoadAdditiveScene + ( + additiveSceneInfo.sceneName, + additiveSceneInfo.activeRootGameObjects + ); + } + } + } + + /// + /// Load single scene and additive scenes + /// + /// + /// + /// + /// + /// + /// + public static async UniTask LoadMainAndSubScenesAsync(string packageName, string singleSceneName, AdditiveSceneInfo[] additiveSceneInfos, uint priority = 100, Progression progression = null) + { + var scene = GetSceneByName(singleSceneName); + if (!string.IsNullOrEmpty(scene.name) && + scene.isLoaded) + { + Logging.PrintWarning($"Single Scene => {singleSceneName} already exists!!!"); + return; + } + + float comboCurrentCount = 0; + float comboTotalCount = 1; + + if (additiveSceneInfos != null) + comboTotalCount += additiveSceneInfos.Length; + + // Single scene + bool loaded = false; + await LoadSingleSceneAsync(packageName, singleSceneName, (float progress, float currentCount, float totalCount) => + { + if (!loaded && progress == 1) + { + comboCurrentCount += progress; + loaded = true; + } + progression?.Invoke(comboCurrentCount / comboTotalCount, comboCurrentCount, comboTotalCount); + }); + + // Additive scenes + if (additiveSceneInfos != null) + { + uint idx = 0; + foreach (var additiveSceneInfo in additiveSceneInfos) + { + loaded = false; + await LoadAdditiveSceneAsync + ( + packageName, + additiveSceneInfo.sceneName, + additiveSceneInfo.activeRootGameObjects, + true, + priority + idx, + (float progress, float currentCount, float totalCount) => + { + if (!loaded && progress == 1) + { + comboCurrentCount += progress; + loaded = true; + } + progression?.Invoke(comboCurrentCount / comboTotalCount, comboCurrentCount, comboTotalCount); + } + ); + idx++; + } + } + } + + public static void LoadMainAndSubScenes(string packageName, string singleSceneName, AdditiveSceneInfo[] additiveSceneInfos) + { + var scene = GetSceneByName(singleSceneName); + if (!string.IsNullOrEmpty(scene.name) && + scene.isLoaded) + { + Logging.PrintWarning($"Single Scene => {singleSceneName} already exists!!!"); + return; + } + + // Single scene + LoadSingleScene(packageName, singleSceneName); + + // Additive scenes + if (additiveSceneInfos != null) + { + foreach (var additiveSceneInfo in additiveSceneInfos) + { + LoadAdditiveScene + ( + packageName, + additiveSceneInfo.sceneName, + additiveSceneInfo.activeRootGameObjects + ); + } + } + } + + /// + /// Load additive scenes + /// + /// + /// + /// + /// + /// + public static async UniTask LoadSubScenesAsync(string packageName, AdditiveSceneInfo[] additiveSceneInfos, uint priority = 100, Progression progression = null) + { + float comboCurrentCount = 0; + float comboTotalCount = 0; + + if (additiveSceneInfos != null) + comboTotalCount += additiveSceneInfos.Length; + + // Additive scenes + if (additiveSceneInfos != null) + { + uint idx = 0; + foreach (var additiveSceneInfo in additiveSceneInfos) + { + bool loaded = false; + await LoadAdditiveSceneAsync + ( + packageName, + additiveSceneInfo.sceneName, + additiveSceneInfo.activeRootGameObjects, + true, + priority + idx, + (float progress, float currentCount, float totalCount) => + { + if (!loaded && progress == 1) + { + comboCurrentCount += progress; + loaded = true; + } + progression?.Invoke(comboCurrentCount / comboTotalCount, comboCurrentCount, comboTotalCount); + } + ); + idx++; + } + } + } + + public static void LoadSubScenes(string packageName, AdditiveSceneInfo[] additiveSceneInfos) + { + // Additive scenes + if (additiveSceneInfos != null) + { + foreach (var additiveSceneInfo in additiveSceneInfos) + { + LoadAdditiveScene + ( + packageName, + additiveSceneInfo.sceneName, + additiveSceneInfo.activeRootGameObjects + ); + } + } + } + /// /// If use prefix "build#" will load from build and else will load from bundle /// @@ -883,6 +1270,21 @@ public static async UniTask LoadSceneAsync(string sceneName, LoadSceneMode else return await USManager.GetInstance().LoadFromBundleAsync(packageName, sceneName, loadSceneMode, activateOnLoad, priority, progression) as T; } + /// + /// If use prefix "build#" will load from build and else will load from bundle + /// + /// + /// + public static void LoadScene(string sceneName, LoadSceneMode loadSceneMode) + { + var packageName = AssetPatcher.GetDefaultPackageName(); + if (RefineBuildScenePath(ref sceneName)) + { + USManager.GetInstance().LoadFromBuild(sceneName, loadSceneMode); + } + else USManager.GetInstance().LoadFromBundle(packageName, sceneName, loadSceneMode); + } + /// /// If use prefix "build#" will load from build and else will load from bundle /// @@ -925,6 +1327,21 @@ public static async UniTask LoadSceneAsync(string packageName, string scen else return await USManager.GetInstance().LoadFromBundleAsync(packageName, sceneName, loadSceneMode, activateOnLoad, priority, progression) as T; } + /// + /// If use prefix "build#" will load from build and else will load from bundle + /// + /// + /// + /// + public static void LoadScene(string packageName, string sceneName, LoadSceneMode loadSceneMode) + { + if (RefineBuildScenePath(ref sceneName)) + { + USManager.GetInstance().LoadFromBuild(sceneName, loadSceneMode); + } + else USManager.GetInstance().LoadFromBundle(packageName, sceneName, loadSceneMode); + } + /// /// Only load from build via build index /// @@ -937,6 +1354,16 @@ public static async UniTask LoadSceneAsync(int buildIndex, LoadS return await USManager.GetInstance().LoadFromBuildAsync(buildIndex, loadSceneMode, progression); } + /// + /// Only load from build via build index + /// + /// + /// + public static Scene LoadScene(int buildIndex, LoadSceneMode loadSceneMode = LoadSceneMode.Single) + { + return USManager.GetInstance().LoadFromBuild(buildIndex, loadSceneMode); + } + /// /// If use prefix "build#" will unload from build else will unload from bundle /// diff --git a/Assets/OxGFrame/CoreFrame/Scripts/Runtime/Core/USFrame/USManager.cs b/Assets/OxGFrame/CoreFrame/Scripts/Runtime/Core/USFrame/USManager.cs index 5394de3b..44ba8e60 100644 --- a/Assets/OxGFrame/CoreFrame/Scripts/Runtime/Core/USFrame/USManager.cs +++ b/Assets/OxGFrame/CoreFrame/Scripts/Runtime/Core/USFrame/USManager.cs @@ -2,13 +2,18 @@ using OxGFrame.AssetLoader; using OxGFrame.AssetLoader.Cacher; using OxGKit.LoggingSystem; -using System; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; namespace OxGFrame.CoreFrame.USFrame { + public struct AdditiveSceneInfo + { + public string sceneName; + public bool activeRootGameObjects; + } + internal class USManager { public static int sceneCount { get { return SceneManager.sceneCount; } } @@ -143,7 +148,9 @@ public void SetActiveSceneRootGameObjects(Scene scene, bool active, string[] wit public async UniTask LoadFromBundleAsync(string packageName, string sceneName, LoadSceneMode loadSceneMode = LoadSceneMode.Single, bool activateOnLoad = true, uint priority = 100, Progression progression = null) { var scene = this.GetSceneByName(sceneName); - if (!string.IsNullOrEmpty(scene.name) && scene.isLoaded && loadSceneMode == LoadSceneMode.Single) + if (!string.IsNullOrEmpty(scene.name) && + scene.isLoaded && + loadSceneMode == LoadSceneMode.Single) { Logging.PrintWarning($"【US】Single Scene => {sceneName} already exists!!!"); return null; @@ -159,6 +166,27 @@ public async UniTask LoadFromBundleAsync(string packageName, string return null; } + public BundlePack LoadFromBundle(string packageName, string sceneName, LoadSceneMode loadSceneMode = LoadSceneMode.Single) + { + var scene = this.GetSceneByName(sceneName); + if (!string.IsNullOrEmpty(scene.name) && + scene.isLoaded && + loadSceneMode == LoadSceneMode.Single) + { + Logging.PrintWarning($"【US】Single Scene => {sceneName} already exists!!!"); + return null; + } + + var pack = AssetLoaders.LoadScene(packageName, sceneName, loadSceneMode); + if (pack != null) + { + Logging.Print($"Load Scene From Bundle => sceneName: {sceneName}, mode: {loadSceneMode}"); + return pack; + } + + return null; + } + public void UnloadFromBundle(bool recursively, params string[] sceneNames) { if (sceneNames != null && sceneNames.Length > 0) @@ -178,7 +206,9 @@ public async UniTask LoadFromBuildAsync(string sceneName, LoadSc this._totalCount = 1; // 初始 1 = 必有一場景 var scene = this.GetSceneByName(sceneName); - if (!string.IsNullOrEmpty(scene.name) && scene.isLoaded && loadSceneMode == LoadSceneMode.Single) + if (!string.IsNullOrEmpty(scene.name) && + scene.isLoaded && + loadSceneMode == LoadSceneMode.Single) { Logging.PrintWarning($"【US】Single Scene => {sceneName} already exists!!!"); return null; @@ -209,6 +239,26 @@ public async UniTask LoadFromBuildAsync(string sceneName, LoadSc return req; } + public Scene LoadFromBuild(string sceneName, LoadSceneMode loadSceneMode = LoadSceneMode.Single) + { + this._currentCount = 0; + this._totalCount = 1; // 初始 1 = 必有一場景 + + var scene = this.GetSceneByName(sceneName); + if (!string.IsNullOrEmpty(scene.name) && + scene.isLoaded && + loadSceneMode == LoadSceneMode.Single) + { + Logging.PrintWarning($"【US】Single Scene => {sceneName} already exists!!!"); + return default; + } + + scene = SceneManager.LoadScene(sceneName, new LoadSceneParameters(loadSceneMode)); + Logging.Print($"Load Scene From Build => sceneName: {sceneName}, mode: {loadSceneMode}"); + // (Caution) If use sync to load scene.isLoaded return false -> Why?? + return scene; + } + public async UniTask LoadFromBuildAsync(int buildIndex, LoadSceneMode loadSceneMode = LoadSceneMode.Single, Progression progression = null) { this._currentCount = 0; @@ -247,6 +297,27 @@ public async UniTask LoadFromBuildAsync(int buildIndex, LoadScen return req; } + public Scene LoadFromBuild(int buildIndex, LoadSceneMode loadSceneMode = LoadSceneMode.Single) + { + this._currentCount = 0; + this._totalCount = 1; // 初始 1 = 必有一場景 + + var scene = this.GetSceneByBuildIndex(buildIndex); + string sceneName = scene.name; + if (!string.IsNullOrEmpty(sceneName) && + scene.isLoaded && + loadSceneMode == LoadSceneMode.Single) + { + Logging.PrintWarning($"【US】Single Scene => {sceneName} already exists!!!"); + return default; + } + + scene = SceneManager.LoadScene(sceneName, new LoadSceneParameters(loadSceneMode)); + Logging.Print($"Load Scene From Build => idx: {buildIndex}, mode: {loadSceneMode}"); + // (Caution) If use sync to load scene.isLoaded return false -> Why?? + return scene; + } + public void UnloadFromBuild(bool recursively, params string[] sceneNames) { if (sceneCount == 1) diff --git a/Assets/OxGFrame/Samples~/USFrameDemo/Scripts/USFrameDemo.cs b/Assets/OxGFrame/Samples~/USFrameDemo/Scripts/USFrameDemo.cs index 7bfc714a..f0e75fe1 100644 --- a/Assets/OxGFrame/Samples~/USFrameDemo/Scripts/USFrameDemo.cs +++ b/Assets/OxGFrame/Samples~/USFrameDemo/Scripts/USFrameDemo.cs @@ -32,6 +32,8 @@ public static class Bundle public class USFrameDemo : MonoBehaviour { + public bool syncMode = false; + private void Awake() { DontDestroyOnLoad(this); @@ -48,76 +50,118 @@ private void Update() #region From Build if (Keyboard.current.numpad1Key.wasReleasedThisFrame) { - Action asyncHandler = async () => + if (!this.syncMode) { - await CoreFrames.USFrame.LoadSceneAsync(UnityScene.Build.LevelDemo01, LoadSceneMode.Single, true, 100, (float progress, float currentCount, float totalCount) => + Action asyncHandler = async () => { - Debug.Log($"Progress: {progress}, CurrentCount: {currentCount}, TotalCount: {totalCount}"); - }); - }; - asyncHandler.Invoke(); + await CoreFrames.USFrame.LoadSceneAsync(UnityScene.Build.LevelDemo01, LoadSceneMode.Single, true, 100, (float progress, float currentCount, float totalCount) => + { + Debug.Log($"Progress: {progress}, CurrentCount: {currentCount}, TotalCount: {totalCount}"); + }); + }; + asyncHandler.Invoke(); + } + else + { + CoreFrames.USFrame.LoadScene(UnityScene.Build.LevelDemo01, LoadSceneMode.Single); + } } if (Keyboard.current.numpad2Key.wasReleasedThisFrame) { - Action asyncHandler = async () => + if (!this.syncMode) { - await CoreFrames.USFrame.LoadSceneAsync(UnityScene.Build.LevelDemo02, LoadSceneMode.Single, true, 100, (float progress, float currentCount, float totalCount) => + Action asyncHandler = async () => { - Debug.Log($"Progress: {progress}, CurrentCount: {currentCount}, TotalCount: {totalCount}"); - }); - }; - asyncHandler.Invoke(); + await CoreFrames.USFrame.LoadSceneAsync(UnityScene.Build.LevelDemo02, LoadSceneMode.Single, true, 100, (float progress, float currentCount, float totalCount) => + { + Debug.Log($"Progress: {progress}, CurrentCount: {currentCount}, TotalCount: {totalCount}"); + }); + }; + asyncHandler.Invoke(); + } + else + { + CoreFrames.USFrame.LoadScene(UnityScene.Build.LevelDemo02, LoadSceneMode.Single); + } } if (Keyboard.current.numpad3Key.wasReleasedThisFrame) { - Action asyncHandler = async () => + if (!this.syncMode) { - await CoreFrames.USFrame.LoadSceneAsync(UnityScene.Build.LevelDemo03, LoadSceneMode.Additive, true, 100, (float progress, float currentCount, float totalCount) => + Action asyncHandler = async () => { - Debug.Log($"Progress: {progress}, CurrentCount: {currentCount}, TotalCount: {totalCount}"); - }); - }; - asyncHandler.Invoke(); + await CoreFrames.USFrame.LoadSceneAsync(UnityScene.Build.LevelDemo03, LoadSceneMode.Additive, true, 100, (float progress, float currentCount, float totalCount) => + { + Debug.Log($"Progress: {progress}, CurrentCount: {currentCount}, TotalCount: {totalCount}"); + }); + }; + asyncHandler.Invoke(); + } + else + { + CoreFrames.USFrame.LoadScene(UnityScene.Build.LevelDemo03, LoadSceneMode.Additive); + } } #endregion #region From Bundle if (Keyboard.current.numpad4Key.wasReleasedThisFrame) { - Action asyncHandler = async () => + if (!this.syncMode) { - await CoreFrames.USFrame.LoadSceneAsync(UnityScene.Bundle.LevelDemo01, LoadSceneMode.Single, true, 100, (float progress, float currentCount, float totalCount) => + Action asyncHandler = async () => { - Debug.Log($"Progress: {progress}, CurrentCount: {currentCount}, TotalCount: {totalCount}"); - }); - }; - asyncHandler.Invoke(); + await CoreFrames.USFrame.LoadSceneAsync(UnityScene.Bundle.LevelDemo01, LoadSceneMode.Single, true, 100, (float progress, float currentCount, float totalCount) => + { + Debug.Log($"Progress: {progress}, CurrentCount: {currentCount}, TotalCount: {totalCount}"); + }); + }; + asyncHandler.Invoke(); + } + else + { + CoreFrames.USFrame.LoadScene(UnityScene.Bundle.LevelDemo01, LoadSceneMode.Single); + } } if (Keyboard.current.numpad5Key.wasReleasedThisFrame) { - Action asyncHandler = async () => + if (!this.syncMode) { - await CoreFrames.USFrame.LoadSceneAsync(UnityScene.Bundle.LevelDemo02, LoadSceneMode.Single, true, 100, (float progress, float currentCount, float totalCount) => + Action asyncHandler = async () => { - Debug.Log($"Progress: {progress}, CurrentCount: {currentCount}, TotalCount: {totalCount}"); - }); - }; - asyncHandler.Invoke(); + await CoreFrames.USFrame.LoadSceneAsync(UnityScene.Bundle.LevelDemo02, LoadSceneMode.Single, true, 100, (float progress, float currentCount, float totalCount) => + { + Debug.Log($"Progress: {progress}, CurrentCount: {currentCount}, TotalCount: {totalCount}"); + }); + }; + asyncHandler.Invoke(); + } + else + { + CoreFrames.USFrame.LoadScene(UnityScene.Bundle.LevelDemo02, LoadSceneMode.Single); + } } if (Keyboard.current.numpad6Key.wasReleasedThisFrame) { - Action asyncHandler = async () => + if (!this.syncMode) { - await CoreFrames.USFrame.LoadSceneAsync(UnityScene.Bundle.LevelDemo03, LoadSceneMode.Additive, true, 100, (float progress, float currentCount, float totalCount) => + Action asyncHandler = async () => { - Debug.Log($"Progress: {progress}, CurrentCount: {currentCount}, TotalCount: {totalCount}"); - }); - }; - asyncHandler.Invoke(); + await CoreFrames.USFrame.LoadSceneAsync(UnityScene.Bundle.LevelDemo03, LoadSceneMode.Additive, true, 100, (float progress, float currentCount, float totalCount) => + { + Debug.Log($"Progress: {progress}, CurrentCount: {currentCount}, TotalCount: {totalCount}"); + }); + }; + asyncHandler.Invoke(); + } + else + { + CoreFrames.USFrame.LoadScene(UnityScene.Bundle.LevelDemo03, LoadSceneMode.Additive); + } } #endregion diff --git a/Assets/OxGFrame/package.json b/Assets/OxGFrame/package.json index d376437d..738f5bd6 100644 --- a/Assets/OxGFrame/package.json +++ b/Assets/OxGFrame/package.json @@ -2,7 +2,7 @@ "name": "com.michaelo.oxgframe", "displayName": "OxGFrame", "description": "The OxGFrame is a framework based on Unity for accelerating game development. Supports multi-platform Win, OSX, Android, iOS, WebGL.", - "version": "2.11.2", + "version": "2.11.3", "unity": "2021.3", "license": "MIT", "samples": [