Commit d4e105db authored by liujiaxin's avatar liujiaxin

123

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