Commit 92f79ad4 authored by yu's avatar yu

1

parent 9744aaf1
...@@ -299,17 +299,18 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent { ...@@ -299,17 +299,18 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
// let dis = this.getDistances(target.getPosition(), bg.getPosition()); // let dis = this.getDistances(target.getPosition(), bg.getPosition());
let dis = this.getDistances(target, bg); let dis = this.getDistances(target, bg);
// if (dis < 100 && bg.sortId == data.id) { // if (dis < 100 && bg.sortId == data.id) {
if (dis < 100 && !cc.find("img", bg)) { // if (dis < 100 && !cc.find("img", bg) ) {
if (dis < 100 && bg.sortId == data.id) {
return bg; return bg;
} }
return null; return null;
}) })
//检测是否在区域内 //检测是否在区域内
let isIn = this.rectCollect(target, this.layout_sort); let isIn = this.rectCollect(target, this.layout_sort);
if (!itemBg && !isIn) { if (!itemBg) {
target.parent = this.right_layout.children[data.count]; target.parent = this.right_layout.children[data.count];
target.setPosition(data.pos); target.setPosition(data.pos);
// this.playLocalAudio("error"); this.playLocalAudio("error");
target.scale = 0.9; target.scale = 0.9;
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment