Commit a6d9e687 authored by limingzhe's avatar limingzhe

fix: 闪屏

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