获得自身组件 对应 其父物体 的序号。
...
using FairyGUI;
...
#region 获取自身序号
/// <summary>
/// 获得 当前 GObject组件 对应其 父物体 的序号
/// </summary>
/// <param name="go"> GObject组件</param>
/// <returns>对应其 父物体 的序号</returns>
public static int getIndexFromParent(GObject go)
{
int index = 0;
if (go != null
&& go.parent != null)
{
index = go.parent.GetChildIndex(go);
}//
return index;
}//
/// <summary>
/// 获得 当前 GComponent组件 对应其 父物体 的序号
/// </summary>
/// <param name="go"> GComponent组件</param>
/// <returns>对应其 父物体 的序号</returns>
public static int getIndexFromParent(GComponent go)
{
int index = 0;
if (go != null
&& go.parent != null)
{
index = go.parent.GetChildIndex(go);
}//
return index;
}//
#endregion//获取自身序号
...