List的touchItem报错问题
list滑动的时候好像会触发touchItem, 代码中
public GObject touchItem
{
get
{
//find out which item is under finger
//逐层往上知道查到点击了那个item
GObject obj = GRoot.inst.touchTarget;
GObject p = obj.parent;
while (p != null)
{
if (p == this)
return obj;
obj = p;
p = p.parent;
}
return null;
}
}
GObject p = obj.parent 会报空引用异常,应该是无obj,不清楚具体原因。。求谷主解答。。Unity + tolua#
public GObject touchItem
{
get
{
//find out which item is under finger
//逐层往上知道查到点击了那个item
GObject obj = GRoot.inst.touchTarget;
GObject p = obj.parent;
while (p != null)
{
if (p == this)
return obj;
obj = p;
p = p.parent;
}
return null;
}
}
GObject p = obj.parent 会报空引用异常,应该是无obj,不清楚具体原因。。求谷主解答。。Unity + tolua#
没有找到相关结果
已邀请:
2 个回复
谷主
赞同来自:
MeLwh
赞同来自: