139 lines
3.6 KiB
C#
139 lines
3.6 KiB
C#
/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
|
||
|
||
using ET;
|
||
using FairyGUI;
|
||
using FairyGUI.Utils;
|
||
|
||
namespace ET
|
||
{
|
||
[ObjectSystem]
|
||
public class FUI_HeadInfoItemMain_AwakeSystem : AwakeSystem<FUI_HeadInfoItemMain, GObject>
|
||
{
|
||
public override void Awake(FUI_HeadInfoItemMain self, GObject go)
|
||
{
|
||
self.Awake(go);
|
||
}
|
||
}
|
||
|
||
public sealed class FUI_HeadInfoItemMain : FUI
|
||
{
|
||
public const string UIPackageName = "Common";
|
||
public const string UIResName = "HeadInfoItemMain";
|
||
|
||
/// <summary>
|
||
/// {uiResName}的组件类型(GComponent、GButton、GProcessBar等),它们都是GObject的子类。
|
||
/// </summary>
|
||
public GComponent self;
|
||
|
||
public GImage m_imgLeader;
|
||
public GProgressBar m_pbarMp;
|
||
public GProgressBar m_pBarHp;
|
||
public GProgressBar m_pBarExp;
|
||
public GTextField m_txtName;
|
||
public GTextField m_txtLevel;
|
||
public GButton m_btn;
|
||
public const string URL = "ui://kqsmrpxluuap62";
|
||
|
||
private static GObject CreateGObject()
|
||
{
|
||
return UIPackage.CreateObject(UIPackageName, UIResName);
|
||
}
|
||
|
||
private static void CreateGObjectAsync(UIPackage.CreateObjectCallback result)
|
||
{
|
||
UIPackage.CreateObjectAsync(UIPackageName, UIResName, result);
|
||
}
|
||
|
||
public static FUI_HeadInfoItemMain CreateInstance(Entity domain)
|
||
{
|
||
return EntityFactory.Create<FUI_HeadInfoItemMain, GObject>(domain, CreateGObject());
|
||
}
|
||
|
||
public static ETTask<FUI_HeadInfoItemMain> CreateInstanceAsync(Entity domain)
|
||
{
|
||
ETTaskCompletionSource<FUI_HeadInfoItemMain> tcs = new ETTaskCompletionSource<FUI_HeadInfoItemMain>();
|
||
|
||
CreateGObjectAsync((go) =>
|
||
{
|
||
tcs.SetResult(EntityFactory.Create<FUI_HeadInfoItemMain, GObject>(domain, go));
|
||
});
|
||
|
||
return tcs.Task;
|
||
}
|
||
|
||
public static FUI_HeadInfoItemMain Create(Entity domain,GObject go)
|
||
{
|
||
return EntityFactory.Create<FUI_HeadInfoItemMain, GObject>(domain,go);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 通过此方法获取的FUI,在Dispose时不会释放GObject,需要自行管理(一般在配合FGUI的Pool机制时使用)。
|
||
/// </summary>
|
||
public static FUI_HeadInfoItemMain GetFormPool(Entity domain,GObject go)
|
||
{
|
||
FUI_HeadInfoItemMain fui = go.Get<FUI_HeadInfoItemMain>();
|
||
|
||
if(fui == null)
|
||
{
|
||
fui = Create(domain,go);
|
||
}
|
||
|
||
fui.isFromFGUIPool = true;
|
||
|
||
return fui;
|
||
}
|
||
|
||
public void Awake(GObject go)
|
||
{
|
||
if(go == null)
|
||
{
|
||
return;
|
||
}
|
||
|
||
GObject = go;
|
||
|
||
if (string.IsNullOrWhiteSpace(Name))
|
||
{
|
||
Name = Id.ToString();
|
||
}
|
||
|
||
self = (GComponent)go;
|
||
|
||
self.Add(this);
|
||
|
||
GComponent com = go.asCom;
|
||
|
||
if(com != null)
|
||
{
|
||
|
||
m_imgLeader = (GImage)com.GetChildAt(1);
|
||
m_pbarMp = (GProgressBar)com.GetChildAt(2);
|
||
m_pBarHp = (GProgressBar)com.GetChildAt(3);
|
||
m_pBarExp = (GProgressBar)com.GetChildAt(4);
|
||
m_txtName = (GTextField)com.GetChildAt(5);
|
||
m_txtLevel = (GTextField)com.GetChildAt(6);
|
||
m_btn = (GButton)com.GetChildAt(7);
|
||
}
|
||
}
|
||
public override void Dispose()
|
||
{
|
||
if(IsDisposed)
|
||
{
|
||
return;
|
||
}
|
||
|
||
base.Dispose();
|
||
|
||
self.Remove();
|
||
self = null;
|
||
|
||
m_imgLeader = null;
|
||
m_pbarMp = null;
|
||
m_pBarHp = null;
|
||
m_pBarExp = null;
|
||
m_txtName = null;
|
||
m_txtLevel = null;
|
||
m_btn = null;
|
||
}
|
||
}
|
||
} |