Skip to content

Commit 9d47659

Browse files
author
gzytom@139.com
committed
Add GList.touchItem
1 parent 6111bf2 commit 9d47659

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

Source/Scripts/UI/GList.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,6 +1014,30 @@ public void ScrollToView(int index, bool ani, bool setFirst)
10141014
}
10151015
}
10161016

1017+
/// <summary>
1018+
/// 获取当前点击哪个item
1019+
/// </summary>
1020+
public GObject touchItem
1021+
{
1022+
get
1023+
{
1024+
//find out which item is under finger
1025+
//逐层往上知道查到点击了那个item
1026+
GObject obj = GRoot.inst.touchTarget;
1027+
GObject p = obj.parent;
1028+
while (p != null)
1029+
{
1030+
if (p == this)
1031+
return obj;
1032+
1033+
obj = p;
1034+
p = p.parent;
1035+
}
1036+
1037+
return null;
1038+
}
1039+
}
1040+
10171041
/// <summary>
10181042
/// Get first child in view.
10191043
/// </summary>

0 commit comments

Comments
 (0)