Commit f4eee2d3 authored by Vũ Gia Vương's avatar Vũ Gia Vương

fix bug fragments 6, 3

parent 328daa85
......@@ -735,8 +735,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 500,
"height": 500
"width": 800,
"height": 800
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......
......@@ -21,6 +21,10 @@ export default class BreakingBottleController extends cc.Component {
onLoad() {
cc.director.getPhysicsManager().enabled = true;
// cc.director.getPhysicsManager().debugDrawFlags = cc.PhysicsManager.DrawBits.e_aabbBit |
// cc.PhysicsManager.DrawBits.e_jointBit |
// cc.PhysicsManager.DrawBits.e_shapeBit;
this._spine = this.hammerNode.getComponentInChildren(sp.Skeleton);
this.node.on(cc.Node.EventType.TOUCH_START, this.onTouchStart, this);
......@@ -31,8 +35,6 @@ export default class BreakingBottleController extends cc.Component {
eventTarget.on(RESET_BOTTLE, this.resetBottle, this);
this._fragmentsNode = this.getComponentsInChildren(FragmentController).map(item => item.node);
console.log('this._fragmentsAll', this._fragmentsNode)
this._fragmentsPosition = this._fragmentsNode.map(item => item.position.clone());
}
......@@ -53,9 +55,9 @@ export default class BreakingBottleController extends cc.Component {
private onHammer(newPos: cc.Vec2) {
cc.tween(this.hammerNode)
.to(0.1, { opacity: 255, position: cc.v3(newPos.x, newPos.y) })
.to(0.1, { opacity: 255, position: cc.v3(newPos.x, newPos.y), active: true })
.delay(0.7)
.to(0.2, { opacity: 0 })
.to(0.2, { opacity: 0, active: false })
.start();
}
......
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