【m】UI 更新

This commit is contained in:
2025-06-25 15:51:50 +08:00
parent a6bd4dce81
commit 4caca12627
4 changed files with 25 additions and 6 deletions

View File

@@ -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<GameObject>(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<GameObject>(panelName);
activePanel = GameObject.Instantiate(handle, panelParent);
#endif
activePanel.name = this.GetType().Name;