From 3f2cd27c5dfb3b450245bf1a37fc1b3414031c7c Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期三, 11 二月 2026 11:03:58 +0800
Subject: [PATCH] 小游戏适配 资源系统改造
---
Main/Utility/ShaderUtility.cs | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/Main/Utility/ShaderUtility.cs b/Main/Utility/ShaderUtility.cs
index f19e29a..3e11810 100644
--- a/Main/Utility/ShaderUtility.cs
+++ b/Main/Utility/ShaderUtility.cs
@@ -1,6 +1,8 @@
锘縰sing System.Collections;
using System.Collections.Generic;
using UnityEngine;
+using Cysharp.Threading.Tasks;
+using ProjSG.Resource;
public class ShaderUtility
{
@@ -15,13 +17,23 @@
Shader.SetGlobalColor("_Gbl_Wat", new Color(1, 1, 1, 1));
}
+ [System.Obsolete("US2: Use WarmUpAllAsync. Sync loading removed. Final preload+cache pattern in T044.")]
public static void WarmUpAll()
+ {
+ // US2: Sync AB loading removed. Use WarmUpAllAsync instead.
+ Shader.WarmupAllShaders();
+ }
+
+ /// <summary>
+ /// US2: Async shader warm up via YooAsset. Temporary API 鈥� will be replaced by preload+cache in T044.
+ /// </summary>
+ public static async UniTask WarmUpAllAsync()
{
if (AssetSource.isUseAssetBundle)
{
- AssetBundleUtility.Instance.Sync_LoadAllAssets("Graphic/Shader");
- Shader.WarmupAllShaders();
+ await YooAssetService.Instance.LoadAllAssetsAsync<Shader>("Assets/ResourcesOut/Shader");
}
+ Shader.WarmupAllShaders();
}
--
Gitblit v1.8.0