From 4caca126272e9574f7cc224b9143bd10b11fdb1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=93=AE?= <834207172@qq.com> Date: Wed, 25 Jun 2025 15:51:50 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90m=E3=80=91UI=20=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/06.UIFarme/RunTime/Base/BasePanel.cs | 13 ++++++++++--- Assets/06.UIFarme/RunTime/Manager/PanelSystem.cs | 13 ++++++++++++- Assets/06.UIFarme/RunTime/UIFarme.RunTime.asmdef | 3 ++- Assets/06.UIFarme/package.json | 2 +- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/Assets/06.UIFarme/RunTime/Base/BasePanel.cs b/Assets/06.UIFarme/RunTime/Base/BasePanel.cs index 8cd52d6..0422a15 100644 --- a/Assets/06.UIFarme/RunTime/Base/BasePanel.cs +++ b/Assets/06.UIFarme/RunTime/Base/BasePanel.cs @@ -3,8 +3,9 @@ using System.Threading.Tasks; using DG.Tweening; using UnityEngine; using UnityEngine.UI; +#if HotUpdate using YooAsset; - +#endif namespace Stary.Evo.UIFarme { public interface IBasePanel : IController @@ -157,7 +158,7 @@ namespace Stary.Evo.UIFarme { return activePanel.gameObject; } - +#if HotUpdate AssetHandle handle = null; if (packageName == null) { @@ -165,7 +166,7 @@ namespace Stary.Evo.UIFarme } else { - var package= YooAssets.TryGetPackage(packageName); + var package = YooAssets.TryGetPackage(packageName); if (package == null) { handle = YooAssets.LoadAssetAsync(panelName); @@ -179,6 +180,12 @@ namespace Stary.Evo.UIFarme await handle.Task; activePanel = GameObject.Instantiate(handle.AssetObject as GameObject, panelParent); +#else + GameObject handle = Resources.Load(panelName); + activePanel = GameObject.Instantiate(handle, panelParent); +#endif + + activePanel.name = this.GetType().Name; diff --git a/Assets/06.UIFarme/RunTime/Manager/PanelSystem.cs b/Assets/06.UIFarme/RunTime/Manager/PanelSystem.cs index ec24b4d..4782f45 100644 --- a/Assets/06.UIFarme/RunTime/Manager/PanelSystem.cs +++ b/Assets/06.UIFarme/RunTime/Manager/PanelSystem.cs @@ -93,7 +93,12 @@ namespace Stary.Evo.UIFarme dicUI = new Dictionary(); } - + /// + /// UI的入栈操作,此操作会显示一个面板 + /// + /// + /// 非热更模式传null + /// public async Task PushQueue(Transform parent,string packageName=null) where T : IBasePanel, new() { string panelName = typeof(T).Name; @@ -127,6 +132,12 @@ namespace Stary.Evo.UIFarme //TOOD } + /// + /// UI的入栈操作,此操作会显示一个面板 + /// + /// + /// 非热更模式传null + /// public async Task PushStack(Transform parent,string packageName=null) where T : IBasePanel, new() { string panelName = typeof(T).Name; diff --git a/Assets/06.UIFarme/RunTime/UIFarme.RunTime.asmdef b/Assets/06.UIFarme/RunTime/UIFarme.RunTime.asmdef index d0dc529..713bdc4 100644 --- a/Assets/06.UIFarme/RunTime/UIFarme.RunTime.asmdef +++ b/Assets/06.UIFarme/RunTime/UIFarme.RunTime.asmdef @@ -5,7 +5,8 @@ "GUID:d1a793c2b6959e04ea45b972eaa369c8", "GUID:e34a5702dd353724aa315fb8011f08c3", "GUID:fad681b9bfe621d4fa07f4f69c311443", - "GUID:51491f1e8b9b8204a9f0c3d3935f742d" + "GUID:51491f1e8b9b8204a9f0c3d3935f742d", + "DOTweenPro.Scripts" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Assets/06.UIFarme/package.json b/Assets/06.UIFarme/package.json index a42711c..cbe8869 100644 --- a/Assets/06.UIFarme/package.json +++ b/Assets/06.UIFarme/package.json @@ -1,7 +1,7 @@ { "name": "com.staryevo.uifarme", "displayName": "06.UIFarme", - "version": "1.0.7", + "version": "1.0.9", "description": "UI模板框架工具", "unity": "2021.3", "unityRelease": "30f1",