From ca83a4450d664e13e4a9b117eebceff5cbeb92a2 Mon Sep 17 00:00:00 2001 From: hevinci Date: Thu, 22 Sep 2022 11:42:13 +0800 Subject: [PATCH] Update Basic Samples --- .../GameScript/Runtime/BootScene.cs | 6 ++-- .../GameScript/Runtime/Game1Scene.cs | 30 +++++++++---------- .../GameScript/Runtime/Game2Scene.cs | 10 +++---- .../PatchUpdater/FsmNode/FsmPatchDone.cs | 2 +- .../AssetBundleBuilderSetting.asset | 4 +-- .../AssetBundleCollectorConfig.xml | 24 +++++++-------- .../AssetBundleCollectorSetting.asset | 15 ++++++++-- 7 files changed, 50 insertions(+), 41 deletions(-) diff --git a/Assets/YooAsset/Samples~/Basic Sample/GameScript/Runtime/BootScene.cs b/Assets/YooAsset/Samples~/Basic Sample/GameScript/Runtime/BootScene.cs index 1534b6b..8dc2a60 100644 --- a/Assets/YooAsset/Samples~/Basic Sample/GameScript/Runtime/BootScene.cs +++ b/Assets/YooAsset/Samples~/Basic Sample/GameScript/Runtime/BootScene.cs @@ -40,7 +40,7 @@ public class BootScene : MonoBehaviour if (PlayMode == YooAssets.EPlayMode.EditorSimulateMode) { var createParameters = new YooAssets.EditorSimulateModeParameters(); - createParameters.LocationServices = new DefaultLocationServices("Assets/Samples/BasicSample/GameRes"); + createParameters.LocationServices = new AddressLocationServices(); //createParameters.SimulatePatchManifestPath = GetPatchManifestPath(); yield return YooAssets.InitializeAsync(createParameters); } @@ -49,7 +49,7 @@ public class BootScene : MonoBehaviour if (PlayMode == YooAssets.EPlayMode.OfflinePlayMode) { var createParameters = new YooAssets.OfflinePlayModeParameters(); - createParameters.LocationServices = new DefaultLocationServices("Assets/Samples/BasicSample/GameRes"); + createParameters.LocationServices = new AddressLocationServices(); yield return YooAssets.InitializeAsync(createParameters); } @@ -57,7 +57,7 @@ public class BootScene : MonoBehaviour if (PlayMode == YooAssets.EPlayMode.HostPlayMode) { var createParameters = new YooAssets.HostPlayModeParameters(); - createParameters.LocationServices = new DefaultLocationServices("Assets/Samples/BasicSample/GameRes"); + createParameters.LocationServices = new AddressLocationServices(); createParameters.DecryptionServices = null; createParameters.ClearCacheWhenDirty = false; createParameters.DefaultHostServer = GetHostServerURL(); diff --git a/Assets/YooAsset/Samples~/Basic Sample/GameScript/Runtime/Game1Scene.cs b/Assets/YooAsset/Samples~/Basic Sample/GameScript/Runtime/Game1Scene.cs index fde0bed..4a4346f 100644 --- a/Assets/YooAsset/Samples~/Basic Sample/GameScript/Runtime/Game1Scene.cs +++ b/Assets/YooAsset/Samples~/Basic Sample/GameScript/Runtime/Game1Scene.cs @@ -72,7 +72,7 @@ public class Game1Scene : MonoBehaviour #if UNITY_WEBGL { var rawImage = CanvasRoot.transform.Find("background").GetComponent(); - AssetOperationHandle handle = YooAssets.LoadAssetAsync("Texture/bg"); + AssetOperationHandle handle = YooAssets.LoadAssetAsync("bg"); _cachedAssetOperationHandles.Add(handle); handle.Completed += (AssetOperationHandle obj) => { @@ -82,7 +82,7 @@ public class Game1Scene : MonoBehaviour #else { var rawImage = CanvasRoot.transform.Find("background").GetComponent(); - AssetOperationHandle handle = YooAssets.LoadAssetSync("Texture/bg"); + AssetOperationHandle handle = YooAssets.LoadAssetSync("bg"); _cachedAssetOperationHandles.Add(handle); rawImage.texture = handle.AssetObject as Texture; } @@ -92,7 +92,7 @@ public class Game1Scene : MonoBehaviour #if UNITY_WEBGL { var logoImage = CanvasRoot.transform.Find("title/logo").GetComponent(); - AssetOperationHandle handle = YooAssets.LoadAssetAsync("Texture/logo.png"); + AssetOperationHandle handle = YooAssets.LoadAssetAsync("logo"); _cachedAssetOperationHandles.Add(handle); handle.Completed += (AssetOperationHandle obj) => { @@ -102,7 +102,7 @@ public class Game1Scene : MonoBehaviour #else { var logoImage = CanvasRoot.transform.Find("title/logo").GetComponent(); - AssetOperationHandle handle = YooAssets.LoadAssetSync("Texture/logo.png"); + AssetOperationHandle handle = YooAssets.LoadAssetSync("logo"); _cachedAssetOperationHandles.Add(handle); logoImage.sprite = handle.AssetObject as Sprite; } @@ -112,10 +112,10 @@ public class Game1Scene : MonoBehaviour { string[] entityAssetNames = { - "Level1/footman_Blue", - "Level2/footman_Green", - "Level3/footman_Red", - "Level3/footman_Yellow" + "footman_Blue", + "footman_Green", + "footman_Red", + "footman_Yellow" }; var btn = CanvasRoot.transform.Find("load_npc/btn").GetComponent