【m】UI 更新
This commit is contained in:
@@ -3,8 +3,9 @@ using System.Threading.Tasks;
|
|||||||
using DG.Tweening;
|
using DG.Tweening;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
#if HotUpdate
|
||||||
using YooAsset;
|
using YooAsset;
|
||||||
|
#endif
|
||||||
namespace Stary.Evo.UIFarme
|
namespace Stary.Evo.UIFarme
|
||||||
{
|
{
|
||||||
public interface IBasePanel : IController
|
public interface IBasePanel : IController
|
||||||
@@ -157,7 +158,7 @@ namespace Stary.Evo.UIFarme
|
|||||||
{
|
{
|
||||||
return activePanel.gameObject;
|
return activePanel.gameObject;
|
||||||
}
|
}
|
||||||
|
#if HotUpdate
|
||||||
AssetHandle handle = null;
|
AssetHandle handle = null;
|
||||||
if (packageName == null)
|
if (packageName == null)
|
||||||
{
|
{
|
||||||
@@ -165,7 +166,7 @@ namespace Stary.Evo.UIFarme
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var package= YooAssets.TryGetPackage(packageName);
|
var package = YooAssets.TryGetPackage(packageName);
|
||||||
if (package == null)
|
if (package == null)
|
||||||
{
|
{
|
||||||
handle = YooAssets.LoadAssetAsync<GameObject>(panelName);
|
handle = YooAssets.LoadAssetAsync<GameObject>(panelName);
|
||||||
@@ -179,6 +180,12 @@ namespace Stary.Evo.UIFarme
|
|||||||
await handle.Task;
|
await handle.Task;
|
||||||
|
|
||||||
activePanel = GameObject.Instantiate(handle.AssetObject as GameObject, panelParent);
|
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;
|
activePanel.name = this.GetType().Name;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -93,7 +93,12 @@ namespace Stary.Evo.UIFarme
|
|||||||
dicUI = new Dictionary<string, IBasePanel>();
|
dicUI = new Dictionary<string, IBasePanel>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// UI的入栈操作,此操作会显示一个面板
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parent"></param>
|
||||||
|
/// <param name="packageName">非热更模式传null</param>
|
||||||
|
/// <typeparam name="T"></typeparam>
|
||||||
public async Task PushQueue<T>(Transform parent,string packageName=null) where T : IBasePanel, new()
|
public async Task PushQueue<T>(Transform parent,string packageName=null) where T : IBasePanel, new()
|
||||||
{
|
{
|
||||||
string panelName = typeof(T).Name;
|
string panelName = typeof(T).Name;
|
||||||
@@ -127,6 +132,12 @@ namespace Stary.Evo.UIFarme
|
|||||||
//TOOD
|
//TOOD
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// UI的入栈操作,此操作会显示一个面板
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parent"></param>
|
||||||
|
/// <param name="packageName">非热更模式传null</param>
|
||||||
|
/// <typeparam name="T"></typeparam>
|
||||||
public async Task PushStack<T>(Transform parent,string packageName=null) where T : IBasePanel, new()
|
public async Task PushStack<T>(Transform parent,string packageName=null) where T : IBasePanel, new()
|
||||||
{
|
{
|
||||||
string panelName = typeof(T).Name;
|
string panelName = typeof(T).Name;
|
||||||
|
|||||||
@@ -5,7 +5,8 @@
|
|||||||
"GUID:d1a793c2b6959e04ea45b972eaa369c8",
|
"GUID:d1a793c2b6959e04ea45b972eaa369c8",
|
||||||
"GUID:e34a5702dd353724aa315fb8011f08c3",
|
"GUID:e34a5702dd353724aa315fb8011f08c3",
|
||||||
"GUID:fad681b9bfe621d4fa07f4f69c311443",
|
"GUID:fad681b9bfe621d4fa07f4f69c311443",
|
||||||
"GUID:51491f1e8b9b8204a9f0c3d3935f742d"
|
"GUID:51491f1e8b9b8204a9f0c3d3935f742d",
|
||||||
|
"DOTweenPro.Scripts"
|
||||||
],
|
],
|
||||||
"includePlatforms": [],
|
"includePlatforms": [],
|
||||||
"excludePlatforms": [],
|
"excludePlatforms": [],
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "com.staryevo.uifarme",
|
"name": "com.staryevo.uifarme",
|
||||||
"displayName": "06.UIFarme",
|
"displayName": "06.UIFarme",
|
||||||
"version": "1.0.7",
|
"version": "1.0.9",
|
||||||
"description": "UI模板框架工具",
|
"description": "UI模板框架工具",
|
||||||
"unity": "2021.3",
|
"unity": "2021.3",
|
||||||
"unityRelease": "30f1",
|
"unityRelease": "30f1",
|
||||||
|
|||||||
Reference in New Issue
Block a user