Commit a6d9e687 authored by limingzhe's avatar limingzhe

fix: 闪屏

parent 6883876e
No preview for this file type
...@@ -929,7 +929,7 @@ ...@@ -929,7 +929,7 @@
"asset": { "asset": {
"__uuid__": "0b2135a8-d95c-4717-8a26-1d8526396e94" "__uuid__": "0b2135a8-d95c-4717-8a26-1d8526396e94"
}, },
"fileId": "7clMl2GbFKqphcx/dFidIz", "fileId": "",
"sync": false "sync": false
} }
] ]
\ No newline at end of file
...@@ -75,23 +75,23 @@ ...@@ -75,23 +75,23 @@
"__id__": 5 "__id__": 5
}, },
{ {
"__id__": 36 "__id__": 37
},
{
"__id__": 50
}, },
{ {
"__id__": 54 "__id__": 51
}, },
{ {
"__id__": 56 "__id__": 55
}, },
{ {
"__id__": 58 "__id__": 57
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{
"__id__": 61
},
{ {
"__id__": 62 "__id__": 62
}, },
...@@ -103,9 +103,6 @@ ...@@ -103,9 +103,6 @@
}, },
{ {
"__id__": 65 "__id__": 65
},
{
"__id__": 66
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -133,7 +130,7 @@ ...@@ -133,7 +130,7 @@
"array": [ "array": [
640, 640,
360, 360,
0, 1000,
0, 0,
0, 0,
0, 0,
...@@ -299,7 +296,7 @@ ...@@ -299,7 +296,7 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 35 "__id__": 36
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1592,7 +1589,11 @@ ...@@ -1592,7 +1589,11 @@
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [], "_components": [
{
"__id__": 35
}
],
"_prefab": null, "_prefab": null,
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -1604,8 +1605,8 @@ ...@@ -1604,8 +1605,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 1230, "width": 1280,
"height": 300 "height": 720
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -1617,7 +1618,7 @@ ...@@ -1617,7 +1618,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 0,
-169.548, 0,
0, 0,
0, 0,
0, 0,
...@@ -1641,6 +1642,33 @@ ...@@ -1641,6 +1642,33 @@
"groupIndex": 0, "groupIndex": 0,
"_id": "0cNf+xmuNGo6vyXLF2UWm9" "_id": "0cNf+xmuNGo6vyXLF2UWm9"
}, },
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 34
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 1230,
"_originalHeight": 300,
"_id": "a1KyXWDvhG7aH+WzdebNnW"
},
{ {
"__type__": "cc.Widget", "__type__": "cc.Widget",
"_name": "", "_name": "",
...@@ -1677,19 +1705,19 @@ ...@@ -1677,19 +1705,19 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 37 "__id__": 38
}, },
{ {
"__id__": 41 "__id__": 42
}, },
{ {
"__id__": 45 "__id__": 46
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 49 "__id__": 50
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1745,16 +1773,16 @@ ...@@ -1745,16 +1773,16 @@
"_name": "$btnLast", "_name": "$btnLast",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 36 "__id__": 37
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 38 "__id__": 39
}, },
{ {
"__id__": 40 "__id__": 41
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1810,7 +1838,7 @@ ...@@ -1810,7 +1838,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 37 "__id__": 38
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": { "_normalMaterial": {
...@@ -1823,7 +1851,7 @@ ...@@ -1823,7 +1851,7 @@
"zoomScale": 1.2, "zoomScale": 1.2,
"clickEvents": [ "clickEvents": [
{ {
"__id__": 39 "__id__": 40
} }
], ],
"_N$interactable": true, "_N$interactable": true,
...@@ -1891,7 +1919,7 @@ ...@@ -1891,7 +1919,7 @@
"__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
}, },
"_N$target": { "_N$target": {
"__id__": 37 "__id__": 38
}, },
"_id": "3aYEjZFo9EW5nRfp9wQsPT" "_id": "3aYEjZFo9EW5nRfp9wQsPT"
}, },
...@@ -1908,7 +1936,7 @@ ...@@ -1908,7 +1936,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 37 "__id__": 38
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -1940,16 +1968,16 @@ ...@@ -1940,16 +1968,16 @@
"_name": "$btnReplay", "_name": "$btnReplay",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 36 "__id__": 37
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 42 "__id__": 43
}, },
{ {
"__id__": 44 "__id__": 45
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2005,7 +2033,7 @@ ...@@ -2005,7 +2033,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 41 "__id__": 42
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": { "_normalMaterial": {
...@@ -2018,7 +2046,7 @@ ...@@ -2018,7 +2046,7 @@
"zoomScale": 1.2, "zoomScale": 1.2,
"clickEvents": [ "clickEvents": [
{ {
"__id__": 43 "__id__": 44
} }
], ],
"_N$interactable": true, "_N$interactable": true,
...@@ -2086,7 +2114,7 @@ ...@@ -2086,7 +2114,7 @@
"__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
}, },
"_N$target": { "_N$target": {
"__id__": 41 "__id__": 42
}, },
"_id": "07Ws9ikrxNn7zeBRgoDjd6" "_id": "07Ws9ikrxNn7zeBRgoDjd6"
}, },
...@@ -2103,7 +2131,7 @@ ...@@ -2103,7 +2131,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 41 "__id__": 42
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -2135,16 +2163,16 @@ ...@@ -2135,16 +2163,16 @@
"_name": "$btnNext", "_name": "$btnNext",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 36 "__id__": 37
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 46 "__id__": 47
}, },
{ {
"__id__": 48 "__id__": 49
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2200,7 +2228,7 @@ ...@@ -2200,7 +2228,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 45 "__id__": 46
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": { "_normalMaterial": {
...@@ -2213,7 +2241,7 @@ ...@@ -2213,7 +2241,7 @@
"zoomScale": 1.2, "zoomScale": 1.2,
"clickEvents": [ "clickEvents": [
{ {
"__id__": 47 "__id__": 48
} }
], ],
"_N$interactable": true, "_N$interactable": true,
...@@ -2281,7 +2309,7 @@ ...@@ -2281,7 +2309,7 @@
"__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
}, },
"_N$target": { "_N$target": {
"__id__": 45 "__id__": 46
}, },
"_id": "135iNKUqZJsISLr7ME3oWt" "_id": "135iNKUqZJsISLr7ME3oWt"
}, },
...@@ -2298,7 +2326,7 @@ ...@@ -2298,7 +2326,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 45 "__id__": 46
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -2330,7 +2358,7 @@ ...@@ -2330,7 +2358,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 36 "__id__": 37
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
...@@ -2361,13 +2389,13 @@ ...@@ -2361,13 +2389,13 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 51 "__id__": 52
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 53 "__id__": 54
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2423,13 +2451,13 @@ ...@@ -2423,13 +2451,13 @@
"_name": "$sprAudio", "_name": "$sprAudio",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 50 "__id__": 51
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 52 "__id__": 53
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2485,7 +2513,7 @@ ...@@ -2485,7 +2513,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 51 "__id__": 52
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -2517,7 +2545,7 @@ ...@@ -2517,7 +2545,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 50 "__id__": 51
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": null, "_normalMaterial": null,
...@@ -2590,99 +2618,10 @@ ...@@ -2590,99 +2618,10 @@
"__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
}, },
"_N$target": { "_N$target": {
"__id__": 50 "__id__": 51
}, },
"_id": "28Vhywz4hGv7Zkx2yg5cPL" "_id": "28Vhywz4hGv7Zkx2yg5cPL"
}, },
{
"__type__": "cc.Node",
"_name": "$nodLayerAnswer",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 55
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "eee+zEI6VBx6gOTjjhLza/"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 54
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 100,
"_originalHeight": 100,
"_id": "a6MuGT3mJClJqZTFmT5PI0"
},
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "dragonbones", "_name": "dragonbones",
...@@ -2694,7 +2633,7 @@ ...@@ -2694,7 +2633,7 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 57 "__id__": 56
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2750,7 +2689,7 @@ ...@@ -2750,7 +2689,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 56 "__id__": 55
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -2796,13 +2735,13 @@ ...@@ -2796,13 +2735,13 @@
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 59 "__id__": 58
}, },
{ {
"__id__": 60 "__id__": 59
}, },
{ {
"__id__": 61 "__id__": 60
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2858,7 +2797,7 @@ ...@@ -2858,7 +2797,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 58 "__id__": 57
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -2890,7 +2829,7 @@ ...@@ -2890,7 +2829,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 58 "__id__": 57
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
...@@ -2917,7 +2856,7 @@ ...@@ -2917,7 +2856,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 58 "__id__": 57
}, },
"_enabled": true, "_enabled": true,
"_id": "6agttKBQpG2LLsR8YnzqwI" "_id": "6agttKBQpG2LLsR8YnzqwI"
...@@ -3010,7 +2949,7 @@ ...@@ -3010,7 +2949,7 @@
"__uuid__": "88f15fa0-f590-4044-949c-b337e6a0b06f" "__uuid__": "88f15fa0-f590-4044-949c-b337e6a0b06f"
}, },
"dragonBone": { "dragonBone": {
"__id__": 57 "__id__": 56
}, },
"spfAudio": [ "spfAudio": [
{ {
......
const saveKey = "DataKey_Cocos_FT12"; const saveKey = "DataKey_Cocos_FT12";
const BaseUI = require('BaseUI'); const BaseUI_FT_12 = require('BaseUI_FT_12');
import { DefaultData } from './DefaultData'; import { DefaultData } from '../script/DefaultData';
import EventMgr from './EventMgr'; import EventMgr from '../script/EventMgr';
cc.Class({ cc.Class({
extends: BaseUI, extends: BaseUI_FT_12,
properties: { properties: {
audEnter: cc.AudioClip, audEnter: cc.AudioClip,
...@@ -180,16 +181,17 @@ cc.Class({ ...@@ -180,16 +181,17 @@ cc.Class({
// 初始化选项 // 初始化选项
initAnswer() { initAnswer() {
this.nodeDict.nodLayerAnswer.destroyAllChildren(); console.log('this.nodeDict: ',this.nodeDict);
this.nodeDict.nodAnswerParent.destroyAllChildren();
let optionList = this.data.questionList[GameData.questionIndex].optionList; let optionList = this.data.questionList[GameData.questionIndex].optionList;
if (optionList.length <= 5) { if (optionList.length <= 5) {
this.layerAnser = cc.instantiate(this.layerFive); this.layerAnser = cc.instantiate(this.layerFive);
this.layerAnser.parent = this.nodeDict.nodLayerAnswer; this.layerAnser.parent = this.nodeDict.nodAnswerParent;
} else { } else {
this.layerAnser = cc.instantiate(this.layerSeven); this.layerAnser = cc.instantiate(this.layerSeven);
this.layerAnser.parent = this.nodeDict.nodLayerAnswer; this.layerAnser.parent = this.nodeDict.nodAnswerParent;
} }
this.nodeDict.nodLayerAnswer.zIndex = 2; this.nodeDict.nodAnswerParent.zIndex = 2;
this.layerAnser.active = true; this.layerAnser.active = true;
for (let i = 0; i < optionList.length; i++) { for (let i = 0; i < optionList.length; i++) {
let node = this.layerAnser.children[i]; let node = this.layerAnser.children[i];
...@@ -198,7 +200,12 @@ cc.Class({ ...@@ -198,7 +200,12 @@ cc.Class({
if (this.data.questionList[GameData.questionIndex].rightOptionIdx == i) { if (this.data.questionList[GameData.questionIndex].rightOptionIdx == i) {
isRight = true; isRight = true;
} }
node.getComponent('ItemAnswer').setInfo(optionList[i], i, this, isRight); const script = node.getComponent('ItemAnswer_FT_12');
if (script) {
script.setInfo(optionList[i], i, this, isRight);
} else {
console.log("ItemAnswer not exist");
}
} }
for (let i = this.layerAnser.children.length - 1; i >= optionList.length; i--) { for (let i = this.layerAnser.children.length - 1; i >= optionList.length; i--) {
this.layerAnser.children[i].active = false; this.layerAnser.children[i].active = false;
...@@ -286,14 +293,14 @@ cc.Class({ ...@@ -286,14 +293,14 @@ cc.Class({
onClickAnswer(itemAnser, isRight) { onClickAnswer(itemAnser, isRight) {
for (let i = 0; i < this.layerAnser.children.length; i++) { for (let i = 0; i < this.layerAnser.children.length; i++) {
this.layerAnser.children[i].getComponent('ItemAnswer').playHideAudioButton(); this.layerAnser.children[i].getComponent('ItemAnswer_FT_12').playHideAudioButton();
} }
if (isRight) { if (isRight) {
this.showDragonBonesMove(itemAnser.node); this.showDragonBonesMove(itemAnser.node);
} else { } else {
this.scheduleOnce(() => { this.scheduleOnce(() => {
for (let i = 0; i < this.layerAnser.children.length; i++) { for (let i = 0; i < this.layerAnser.children.length; i++) {
this.layerAnser.children[i].getComponent('ItemAnswer').playShowAudioButton(); this.layerAnser.children[i].getComponent('ItemAnswer_FT_12').playShowAudioButton();
} }
}, 2) }, 2)
this.playWrong(); this.playWrong();
...@@ -328,7 +335,7 @@ cc.Class({ ...@@ -328,7 +335,7 @@ cc.Class({
}, },
showChooseRight(target) { showChooseRight(target) {
let itemAnswer = target.getComponent('ItemAnswer'); let itemAnswer = target.getComponent('ItemAnswer_FT_12');
for(let i = 0;i<this.questionList.length;i++){ for(let i = 0;i<this.questionList.length;i++){
if(this.questionList[i] === GameData.questionIndex){ if(this.questionList[i] === GameData.questionIndex){
this.questionList.splice(i, 1); this.questionList.splice(i, 1);
......
This diff is collapsed.
This diff is collapsed.
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