Commit 3978b37f authored by 智慧's avatar 智慧

fix:解决龙骨动画一次性加载13个问题

parent a75f6491
...@@ -213,7 +213,7 @@ ...@@ -213,7 +213,7 @@
"array": [ "array": [
0, 0,
0, 0,
477.3635282534893, 475.4312900091213,
0, 0,
0, 0,
0, 0,
...@@ -659,7 +659,7 @@ ...@@ -659,7 +659,7 @@
"__id__": 2 "__id__": 2
}, },
"_children": [], "_children": [],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 15 "__id__": 15
...@@ -761,7 +761,7 @@ ...@@ -761,7 +761,7 @@
"__id__": 2 "__id__": 2
}, },
"_children": [], "_children": [],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 17 "__id__": 17
...@@ -863,7 +863,7 @@ ...@@ -863,7 +863,7 @@
"__id__": 2 "__id__": 2
}, },
"_children": [], "_children": [],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 19 "__id__": 19
...@@ -965,7 +965,7 @@ ...@@ -965,7 +965,7 @@
"__id__": 2 "__id__": 2
}, },
"_children": [], "_children": [],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 21 "__id__": 21
...@@ -1067,7 +1067,7 @@ ...@@ -1067,7 +1067,7 @@
"__id__": 2 "__id__": 2
}, },
"_children": [], "_children": [],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 23 "__id__": 23
...@@ -1169,7 +1169,7 @@ ...@@ -1169,7 +1169,7 @@
"__id__": 2 "__id__": 2
}, },
"_children": [], "_children": [],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 25 "__id__": 25
...@@ -1271,7 +1271,7 @@ ...@@ -1271,7 +1271,7 @@
"__id__": 2 "__id__": 2
}, },
"_children": [], "_children": [],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 27 "__id__": 27
...@@ -1373,7 +1373,7 @@ ...@@ -1373,7 +1373,7 @@
"__id__": 2 "__id__": 2
}, },
"_children": [], "_children": [],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 29 "__id__": 29
...@@ -1475,7 +1475,7 @@ ...@@ -1475,7 +1475,7 @@
"__id__": 2 "__id__": 2
}, },
"_children": [], "_children": [],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 31 "__id__": 31
...@@ -1577,7 +1577,7 @@ ...@@ -1577,7 +1577,7 @@
"__id__": 2 "__id__": 2
}, },
"_children": [], "_children": [],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 33 "__id__": 33
...@@ -1679,7 +1679,7 @@ ...@@ -1679,7 +1679,7 @@
"__id__": 2 "__id__": 2
}, },
"_children": [], "_children": [],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 35 "__id__": 35
...@@ -1781,7 +1781,7 @@ ...@@ -1781,7 +1781,7 @@
"__id__": 2 "__id__": 2
}, },
"_children": [], "_children": [],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 37 "__id__": 37
...@@ -1883,7 +1883,7 @@ ...@@ -1883,7 +1883,7 @@
"__id__": 2 "__id__": 2
}, },
"_children": [], "_children": [],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 39 "__id__": 39
......
...@@ -26,6 +26,7 @@ cc.Class({ ...@@ -26,6 +26,7 @@ cc.Class({
_imageResList: null, _imageResList: null,
_audioResList: null, _audioResList: null,
_animaResList: null, _animaResList: null,
_dragonAnimaList: null,
initSceneData() { initSceneData() {
this._imageResList = []; this._imageResList = [];
this._audioResList = []; this._audioResList = [];
...@@ -147,6 +148,10 @@ cc.Class({ ...@@ -147,6 +148,10 @@ cc.Class({
initData() { initData() {
// 所有全局变量 默认都是null // 所有全局变量 默认都是null
this._cantouch = true; this._cantouch = true;
if (!this._dragonAnimaList) {
this._dragonAnimaList = ["DailyConversations","WarmUp","LettersInLife","Phonics","LetsBlend","ExerciseTime","TraceWithMe",
"LookAndSay","LetsReview","SightWords","StoryTime","Topic","ReadClosely"];
}
}, },
initAudio() { initAudio() {
...@@ -175,18 +180,20 @@ cc.Class({ ...@@ -175,18 +180,20 @@ cc.Class({
}, },
initBtn() { initBtn() {
this.hideDragon();
this.showDragon(); this.showDragon();
// const bg = cc.find('Canvas/bg');
// bg.addComponent(cc.Button);
// //节点中添加了button组件 则可以添加click事件监听das
// bg.on('click', async () => {
// await this.showDragon();
// })
}, },
hideDragon() {
this._dragonAnimaList.forEach(dragon => {
const nodeName = 'Canvas/' + dragon;
const animationNode = cc.find(nodeName);
animationNode.active = false;
});
},
async showDragon() { async showDragon() {
const nodeName = 'Canvas/' + this.data.animationName; const nodeName = 'Canvas/' + this.data.animationName;
const animationNode = cc.find(nodeName); const animationNode = cc.find(nodeName);
animationNode.active = true;
animationNode.x = cc.find('Canvas').width; animationNode.x = cc.find('Canvas').width;
animationNode.y = 0; animationNode.y = 0;
......
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