this.colorParent.on(Node.EventType.TOUCH_START, function (event: EventTouch) {
let color_start_world = event.getLocation()
// let color_start_node = this.colorParent.getComponent(UITransform).convertToNodeSpaceAR(new Vec3(color_start_world.x, color_start_world.y, 0))
var children = this.colorParent.children
for (let i = 0; i < children.length; i++) {
if (children[i].getComponent(UITransform).getBoundingBoxToWorld().contains(color_start_world)) {
if (i == this.specialColorIndex) {
this.initColorBaseInfo()
this.createColors()
DataManager.Instance.level++
}
}
}
}, this)
## 世界坐标判断
let color_start_world = event.getLocation()
children[i].getComponent(UITransform).getBoundingBoxToWorld().contains(color_start_world)
# 节点坐标判断
let color_start_world = event.getLocation()
let color_start_node = this.colorParent.getComponent(UITransform).convertToNodeSpaceAR(new Vec3(color_start_world.x, color_start_world.y, 0))
children[i].getComponent(UITransform).getBoundingBox().contains(color_start_world)