Browse Source

修复红叉bug

baowen 2 days ago
parent
commit
37d33ab8a2
1 changed files with 5 additions and 4 deletions
  1. 5 4
      assets/hall/script/BaseZhaocha.ts

+ 5 - 4
assets/hall/script/BaseZhaocha.ts

@@ -90,11 +90,12 @@ export class BaseZhaocha extends Component {
                 let scpos = event.getLocation()
                 let wopos = this.cam.screenToWorld(new Vec3(scpos.x, scpos.y, 0))
                 // let localpos = this.arr_node_allitem[0].parent.getComponent(UITransform).convertToNodeSpaceAR(new Vec3(worldpos.x, worldpos.y))
-                let localPos1 = this.cam.convertToUINode(wopos,this.arr_node_allitem[0].parent)
-                let localpos = new Vec3(localPos1.x,localPos1.y)
-                LayerMgr.instance.ShowPrefab(BundleName.hall, "prefab/x", (node) => {
+                // let localPos1 = this.cam.convertToUINode(wopos,this.arr_node_allitem[0].parent)
+                // let localpos = new Vec3(localPos1.x,localPos1.y)
+                LayerMgr.instance.ShowPrefab(BundleName.hall, "prefab/x", (node:Node) => {
+
                     node.parent = this.arr_node_allitem[0].parent
-                    node.setPosition(localpos)
+                    node.setWorldPosition(wopos)
                     this.scheduleOnce(() => {
                         node?.destroy()
                     }, 0.3)