mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
refactor(ui): 将View属性重命名为Original以统一接口设计
- 将IUiPageBehavior中的View属性重命名为Original - 更新UiRouterBase中日志输出使用Original属性替代View属性 - 在ISceneBehavior接口中添加Original属性定义 - 在SceneBehaviorBase实现类中添加Original属性实现 - 在CanvasItemUiPageBehaviorBase中将View属性改为Original属性 - 更新相关注释文档说明Original属性用途
This commit is contained in:
parent
342b4b5e88
commit
323976677c
@ -25,6 +25,12 @@ public interface ISceneBehavior
|
||||
/// </summary>
|
||||
string Key { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取场景的原始对象。
|
||||
/// </summary>
|
||||
object Original { get; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取场景是否已加载完成的状态。
|
||||
/// true表示场景资源已加载,false表示未加载或正在加载中。
|
||||
|
||||
@ -40,10 +40,10 @@ public interface IUiPageBehavior
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取页面视图对象。
|
||||
/// 获取原始对象。
|
||||
/// </summary>
|
||||
/// <returns>页面视图实例。</returns>
|
||||
object View { get; }
|
||||
/// <returns>原始对象。</returns>
|
||||
object Original { get; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -576,22 +576,22 @@ public abstract class UiRouterBase : AbstractSystem, IUiRouter
|
||||
if (_stack.Count > 0)
|
||||
{
|
||||
var current = _stack.Peek();
|
||||
Log.Debug("Pause current page: {0}", current.View.GetType().Name);
|
||||
Log.Debug("Pause current page: {0}", current.Original.GetType().Name);
|
||||
current.OnPause();
|
||||
|
||||
if (policy == UiTransitionPolicy.Exclusive)
|
||||
{
|
||||
Log.Debug("Suspend current page (Exclusive): {0}", current.View.GetType().Name);
|
||||
Log.Debug("Suspend current page (Exclusive): {0}", current.Original.GetType().Name);
|
||||
current.OnHide();
|
||||
}
|
||||
}
|
||||
|
||||
Log.Debug("Add page to UiRoot: {0}", page.View.GetType().Name);
|
||||
Log.Debug("Add page to UiRoot: {0}", page.Original.GetType().Name);
|
||||
_uiRoot.AddUiPage(page);
|
||||
|
||||
_stack.Push(page);
|
||||
|
||||
Log.Debug("Enter & Show page: {0}, stackAfter={1}", page.View.GetType().Name, _stack.Count);
|
||||
Log.Debug("Enter & Show page: {0}, stackAfter={1}", page.Original.GetType().Name, _stack.Count);
|
||||
page.OnEnter(param);
|
||||
page.OnShow();
|
||||
}
|
||||
|
||||
@ -71,9 +71,17 @@ public abstract class SceneBehaviorBase<T> : ISceneBehavior
|
||||
|
||||
/// <summary>
|
||||
/// 获取场景的唯一标识键。
|
||||
/// 该属性返回场景的唯一标识符,用于区分不同的场景实例。
|
||||
/// </summary>
|
||||
public string Key => _key;
|
||||
|
||||
/// <summary>
|
||||
/// 获取场景的原始数据对象。
|
||||
/// 该属性返回场景的底层数据对象,通常用于序列化或反序列化操作。
|
||||
/// </summary>
|
||||
public object Original => Owner;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取场景是否已加载完成的状态。
|
||||
/// </summary>
|
||||
|
||||
@ -98,7 +98,7 @@ public abstract class CanvasItemUiPageBehaviorBase<T> : IUiPageBehavior
|
||||
/// <summary>
|
||||
/// 获取视图节点实例。
|
||||
/// </summary>
|
||||
public object View => Owner;
|
||||
public object Original => Owner;
|
||||
|
||||
/// <summary>
|
||||
/// 获取 UI 的唯一标识键。
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user