Commit 8be14c7c authored by 徐行's avatar 徐行

题配好了

parent 0473a6b7
...@@ -16,54 +16,110 @@ export const vhfn_lv_1: VHFillNumCfg = { ...@@ -16,54 +16,110 @@ export const vhfn_lv_1: VHFillNumCfg = {
row: 4, row: 4,
column: 4, column: 4,
numArr: [ numArr: [
[3, 6, 5, 14], [3, 2, 4, 11],
[8, 4, 2, 16], [2, 3, 5, 11],
[6, 2, 3, 36], [1, 4, 2, 9],
[30, 8, 10, -1] [1, 10, 18, -1]
], ],
emptyCtrArr: [ emptyCtrArr: [
[1, 1, 0, 1],
[0, 1, 0, 1],
[1, 0, 1, 1], [1, 0, 1, 1],
[1, 0, 1, 1],
[0, 0, 0, 1],
[1, 1, 1, 1] [1, 1, 1, 1]
], ],
rowSymb: [ rowSymb: [
["+", "+", "="], ["+", "×", "="],
["×", "÷", "="], ["×", "+", "="],
["×", "×", "="] ["+", "×", "="]
], ],
columnSymb: [ columnSymb: [
["×", "+", "+"], ["-", "×", "×"],
["+", "÷", "+"], ["×", "+", "-"],
["=", "=", "="], ["=", "=", "="],
], ],
options: [5, 2, 8] options: [1, 2, 3, 4]
} }
export const vhfn_lv_2: VHFillNumCfg = { export const vhfn_lv_2: VHFillNumCfg = {
row: 4, row: 4,
column: 4, column: 4,
numArr: [ numArr: [
[2, 4, 2, 10], [3, 6, 5, 23],
[6, 5, 2, 60], [4, 2, 3, 5],
[3, 3, 3, 9], [5, 5, 4, 5],
[4, 60, 7, -1] [23, 7, 12, -1]
], ],
emptyCtrArr: [ emptyCtrArr: [
[1, 0, 1, 1], [0, 1, 1, 1],
[0, 0, 1, 1], [0, 0, 1, 1],
[0, 1, 0, 1],
[1, 1, 1, 1]
],
rowSymb: [
["×", "+", "="],
["÷", "+", "="],
["÷", "+", "="]
],
columnSymb: [
["+", "×", "+"],
["×", "-", "+"],
["=", "=", "="],
],
options: [2, 3, 4, 5]
}
export const vhfn_lv_3: VHFillNumCfg = {
row: 4,
column: 4,
numArr: [
[10, 3, 19, 11],
[4, 12, 15, 33],
[7, 18, 9, 9],
[38, 18, 13, -1]
],
emptyCtrArr: [
[1, 1, 0, 1], [1, 1, 0, 1],
[0, 0, 1, 1],
[0, 1, 0, 1],
[1, 1, 1, 1] [1, 1, 1, 1]
], ],
rowSymb: [ rowSymb: [
["+", "×", "="], ["×", "+", "="],
["×", "×", "="], ["÷", "+", "="],
["+", "+", "="] ["÷", "+", "="]
],
columnSymb: [
["+", "×", "+"],
["×", "-", "+"],
["=", "=", "="],
],
options: [4, 7, 9, 12, 19]
}
export const vhfn_lv_4: VHFillNumCfg = {
row: 4,
column: 4,
numArr: [
[7, 11, 40, 37],
[8, 4, 5, 7],
[2, 19, 7, 45],
[23, 25, 56, -1]
],
emptyCtrArr: [
[1, 0, 0, 1],
[0, 1, 1, 1],
[0, 1, 0, 1],
[1, 1, 1, 1]
],
rowSymb: [
["×", "-", "="],
["÷", "+", "="],
["×", "+", "="]
], ],
columnSymb: [ columnSymb: [
["×", "×", "×"], ["+", "×", "÷"],
["÷", "×", "+"], ["×", "-", "×"],
["=", "=", "="], ["=", "=", "="],
], ],
options: [5, 6, 4, 3] options: [2, 7, 8, 11, 40]
} }
import { _decorator, Component, Node, Prefab, Label, CCFloat, Vec3, UITransform, instantiate, v3, Color, Toggle, director } from 'cc'; import { _decorator, Component, Node, Prefab, Label, CCFloat, Vec3, UITransform, instantiate, v3, Color, Toggle, director, isValid } from 'cc';
import { countdownMus, failMus, succMus } from '../../../../startFolder/script/common/AudioDef'; import { countdownMus, failMus, succMus } from '../../../../startFolder/script/common/AudioDef';
import { AudioMgr } from '../../../../startFolder/script/common/AudioMgr'; import { AudioMgr } from '../../../../startFolder/script/common/AudioMgr';
import { Utils } from '../../../../startFolder/script/common/Utils'; import { Utils } from '../../../../startFolder/script/common/Utils';
...@@ -11,7 +11,7 @@ import { GameDescView } from '../../commonView/script/GameDescView'; ...@@ -11,7 +11,7 @@ import { GameDescView } from '../../commonView/script/GameDescView';
import { ScoreFailView } from '../../commonView/script/ScoreFailView'; import { ScoreFailView } from '../../commonView/script/ScoreFailView';
import { ScoreSuccView } from '../../commonView/script/ScoreSuccView'; import { ScoreSuccView } from '../../commonView/script/ScoreSuccView';
import { SwitchOkView } from '../../commonView/script/SwitchOkView'; import { SwitchOkView } from '../../commonView/script/SwitchOkView';
import { VHFillNumCfg, vhfn_lv_1, vhfn_lv_2 } from './VHFillNumCfg'; import { VHFillNumCfg, vhfn_lv_1, vhfn_lv_2, vhfn_lv_3, vhfn_lv_4 } from './VHFillNumCfg';
import { VHFillNumItem, VHFN_ITEM_TYPE } from './VHFillNumItem'; import { VHFillNumItem, VHFN_ITEM_TYPE } from './VHFillNumItem';
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
...@@ -57,7 +57,7 @@ export class VHFillNumCtr extends Component { ...@@ -57,7 +57,7 @@ export class VHFillNumCtr extends Component {
private itemPosIfoArr: ItemPosIfo[] = []; private itemPosIfoArr: ItemPosIfo[] = [];
private row = 4; private row = 4;
private column = 4; private column = 4;
private level = 2; private level = 4;
private levelData: VHFillNumCfg = null!; private levelData: VHFillNumCfg = null!;
private selNum = 0; private selNum = 0;
...@@ -466,6 +466,12 @@ export class VHFillNumCtr extends Component { ...@@ -466,6 +466,12 @@ export class VHFillNumCtr extends Component {
case 2: case 2:
this.levelData = vhfn_lv_2; this.levelData = vhfn_lv_2;
break; break;
case 3:
this.levelData = vhfn_lv_3;
break;
case 4:
this.levelData = vhfn_lv_4;
break;
default: default:
this.levelData = vhfn_lv_1; this.levelData = vhfn_lv_1;
break; break;
...@@ -475,6 +481,9 @@ export class VHFillNumCtr extends Component { ...@@ -475,6 +481,9 @@ export class VHFillNumCtr extends Component {
} }
creOptions() { creOptions() {
for (let i = 1; i < this.optionsTogsNode.children.length; ++i) {
if (isValid(this.optionsTogsNode.children[i], true)) this.optionsTogsNode.children[i].destroy();
}
while (this.optionsTogsNode.children.length < this.levelData.options.length) { while (this.optionsTogsNode.children.length < this.levelData.options.length) {
this.optionsTogsNode.addChild(instantiate(this.optionsTogsNode.children[0])); this.optionsTogsNode.addChild(instantiate(this.optionsTogsNode.children[0]));
} }
...@@ -487,6 +496,8 @@ export class VHFillNumCtr extends Component { ...@@ -487,6 +496,8 @@ export class VHFillNumCtr extends Component {
} }
this.optionsTogsNode.children[0].getComponent(Toggle)!.isChecked = true; this.optionsTogsNode.children[0].getComponent(Toggle)!.isChecked = true;
this.selNum = this.levelData.options[0]; this.selNum = this.levelData.options[0];
this.optionsTogsNode.scale = this.levelData.options.length > 4 ? v3(0.7, 0.7, 1) : v3(1, 1, 1);
} }
......
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