Commit d4e105db authored by liujiaxin's avatar liujiaxin

123

parent c07d7564
...@@ -32,27 +32,29 @@ export default class ChangeItemAnimation extends cc.Component { ...@@ -32,27 +32,29 @@ export default class ChangeItemAnimation extends cc.Component {
} }
changeSkin (data) { changeSkin (data) {
pg.view.setNetImg(this.node, data.itemImage, true); pg.view.setNetImg(this.node, data.itemImage, false).then(() => {
let {x, y, width, height} = this.node;
if (data.rect) {
x = data.rect.x;
y = data.rect.y;
width = data.rect.width;
height = data.rect.height;
this.node.x = x;
this.node.y = y;
this.node.width = width;
this.node.height = height;
}
user.updateFurniture(data, {
x, y, width, height
});
});
if (!this.animNode) { if (!this.animNode) {
return; return;
} }
this.animNode.active = true; this.animNode.active = true;
cc.audioEngine.play(this.starPopAudio, false, 1); cc.audioEngine.play(this.starPopAudio, false, 1);
this.armatureDisplay.playAnimation("newAnimation", 1); this.armatureDisplay.playAnimation("newAnimation", 1);
let {x, y, width, height} = this.node;
if (data.rect) {
x = data.rect.x;
y = data.rect.y;
width = data.rect.width;
height = data.rect.height;
this.node.x = x;
this.node.y = y;
this.node.width = width;
this.node.height = height;
}
user.updateFurniture(data, {
x, y, width, height
});
} }
OnCallAnimationPlayComplete () { OnCallAnimationPlayComplete () {
console.log(1111); console.log(1111);
......
...@@ -1605,7 +1605,7 @@ ...@@ -1605,7 +1605,7 @@
"__id__": 30 "__id__": 30
} }
], ],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 33 "__id__": 33
...@@ -1890,7 +1890,7 @@ ...@@ -1890,7 +1890,7 @@
"__id__": 39 "__id__": 39
} }
], ],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 42 "__id__": 42
...@@ -2382,7 +2382,7 @@ ...@@ -2382,7 +2382,7 @@
"__id__": 56 "__id__": 56
} }
], ],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 59 "__id__": 59
...@@ -2918,7 +2918,7 @@ ...@@ -2918,7 +2918,7 @@
"__id__": 69 "__id__": 69
} }
], ],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 72 "__id__": 72
...@@ -3203,7 +3203,7 @@ ...@@ -3203,7 +3203,7 @@
"__id__": 78 "__id__": 78
} }
], ],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 81 "__id__": 81
...@@ -3488,7 +3488,7 @@ ...@@ -3488,7 +3488,7 @@
"__id__": 87 "__id__": 87
} }
], ],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 90 "__id__": 90
...@@ -3773,7 +3773,7 @@ ...@@ -3773,7 +3773,7 @@
"__id__": 96 "__id__": 96
} }
], ],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 99 "__id__": 99
...@@ -4058,7 +4058,7 @@ ...@@ -4058,7 +4058,7 @@
"__id__": 105 "__id__": 105
} }
], ],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 108 "__id__": 108
...@@ -4343,7 +4343,7 @@ ...@@ -4343,7 +4343,7 @@
"__id__": 114 "__id__": 114
} }
], ],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 117 "__id__": 117
...@@ -4628,7 +4628,7 @@ ...@@ -4628,7 +4628,7 @@
"__id__": 123 "__id__": 123
} }
], ],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 126 "__id__": 126
......
...@@ -148,8 +148,8 @@ let pg = { ...@@ -148,8 +148,8 @@ let pg = {
if (!cc.isValid(node)) return pg.logger.i("节点已销毁"); if (!cc.isValid(node)) return pg.logger.i("节点已销毁");
let nw = node.width = texture.width; let nw = node.width = texture.width;
let nh = node.height = texture.height; let nh = node.height = texture.height;
let spriteFrame = new cc.SpriteFrame(texture); let spriteFrame = new cc.SpriteFrame(texture);
node.net_spriteFrame
node.net_url = res; node.net_url = res;
const cover = node.getChildByName('cover'); const cover = node.getChildByName('cover');
if (cover) { if (cover) {
...@@ -312,7 +312,7 @@ let pg = { ...@@ -312,7 +312,7 @@ let pg = {
}) })
}) })
}, },
loadNetImg: function (url) { loadNetImg: async function (url) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
cc.loader.load({ url }, (err, texture) => { cc.loader.load({ url }, (err, texture) => {
if (err && !texture) return resolve(pg.logger.w('loading loadRes warn-> ' + texture)); if (err && !texture) return resolve(pg.logger.w('loading loadRes warn-> ' + texture));
......
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