Commit feed66e8 authored by wangxin's avatar wangxin

test03

parent 510ed4b5
...@@ -1139,7 +1139,7 @@ ...@@ -1139,7 +1139,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": -46, "width": 46,
"height": 245 "height": 245
}, },
"_anchorPoint": { "_anchorPoint": {
...@@ -1213,7 +1213,7 @@ ...@@ -1213,7 +1213,7 @@
"_enabled": true, "_enabled": true,
"_layoutSize": { "_layoutSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": -46, "width": 46,
"height": 245 "height": 245
}, },
"_resize": 1, "_resize": 1,
...@@ -1263,7 +1263,7 @@ ...@@ -1263,7 +1263,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": -46, "width": 46,
"height": 245 "height": 245
}, },
"_anchorPoint": { "_anchorPoint": {
...@@ -1276,7 +1276,7 @@ ...@@ -1276,7 +1276,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 0,
-161.05399999999997, -152.5,
0, 0,
0, 0,
0, 0,
...@@ -1313,7 +1313,7 @@ ...@@ -1313,7 +1313,7 @@
"_alignFlags": 1, "_alignFlags": 1,
"_left": 65, "_left": 65,
"_right": 65, "_right": 65,
"_top": 398.554, "_top": 390,
"_bottom": 0, "_bottom": 0,
"_verticalCenter": 0, "_verticalCenter": 0,
"_horizontalCenter": 0, "_horizontalCenter": 0,
...@@ -1337,7 +1337,7 @@ ...@@ -1337,7 +1337,7 @@
"_enabled": true, "_enabled": true,
"_layoutSize": { "_layoutSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": -46, "width": 46,
"height": 245 "height": 245
}, },
"_resize": 1, "_resize": 1,
......
...@@ -41,6 +41,10 @@ cc.Class({ ...@@ -41,6 +41,10 @@ cc.Class({
onLoad() { onLoad() {
this.initSceneData(); this.initSceneData();
this.initSize(); this.initSize();
// 开启碰撞检查
var manager = cc.director.getCollisionManager();
manager.enabled = true;
}, },
_imageResList: null, _imageResList: null,
...@@ -176,12 +180,12 @@ cc.Class({ ...@@ -176,12 +180,12 @@ cc.Class({
for (var i = 0; i < this.data.options.length; i++) { for (var i = 0; i < this.data.options.length; i++) {
const op_s = cc.instantiate(this.op_sound); const op_s = cc.instantiate(this.op_sound);
op_s.getComponent("op_sound")._opId = i; op_s.getComponent("op_sound")._opId = i;
op_s.getComponent("op_sound")._soundUrl = this.data.options[i]["audio_url_" + i]; op_s.getComponent("op_sound")._soundUrl = this.data.options[i].audio_url;
this.sounds_container.addChild(op_s); this.sounds_container.addChild(op_s);
const op_p = cc.instantiate(this.op_pic); const op_p = cc.instantiate(this.op_pic);
op_p.getComponent("op_pic")._opId = i; op_p.getComponent("op_pic")._opId = i;
op_p.getComponent("op_pic").setPic(this.data.options[i]["pic_url_" + i]); op_p.getComponent("op_pic").setPic(this.data.options[i].pic_url);
this.pic_container.addChild(op_p); this.pic_container.addChild(op_p);
} }
}, },
......
...@@ -30,4 +30,20 @@ cc.Class({ ...@@ -30,4 +30,20 @@ cc.Class({
}); });
} }
}, },
/**
* 当碰撞产生的时候调用
* @param {Collider} other 产生碰撞的另一个碰撞组件
* @param {Collider} self 产生碰撞的自身的碰撞组件
*/
onCollisionEnter: function (other, self) {},
/**
* 当碰撞结束后调用
* @param {Collider} other 产生碰撞的另一个碰撞组件
* @param {Collider} self 产生碰撞的自身的碰撞组件
*/
onCollisionExit: function (other, self) {
console.log("on collision exit");
},
}); });
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