Commit 939dde67 authored by yu's avatar yu

公共部分调整

parent 6a447bde
{
"ver": "2.0.1",
"uuid": "ef016121-135b-4760-ab0c-c50f620e4fa1",
"downloadMode": 0,
"duration": 1.724082,
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
...@@ -116,20 +116,26 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -116,20 +116,26 @@ export default class SceneComponent extends MyCocosSceneComponent {
pg.event.on("check_next_question", () => { pg.event.on("check_next_question", () => {
// this.checkClickEnd(); // this.checkClickEnd();
}); });
pg.event.on("mouse_num_game_end", () => { pg.event.on("mouse_08_num_game_end", () => {
if (this.checkOver()) { if (this.checkOver()) {
this.showFind(); this.showFind();
} }
}); });
} }
private onAgain() { private onAgain() {
this.playLocalAudio("again");
this.layout_finish.active = false; this.layout_finish.active = false;
this.initData(); this.initData();
pg.event.emit("mouse_num", Game.getIns().getCardInfo().length); pg.event.emit("mouse_08_num", Game.getIns().getCardInfo().length);
this.gameStart(); this.gameStart();
} }
private onNext() { private onNext() {
const middleLayer = cc.find('middleLayer');
if (middleLayer) {
const mc = middleLayer.getComponent('middleLayer');
// // 切换下一页
mc.goNextPage();
}
} }
private intervalId; private intervalId;
...@@ -282,7 +288,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -282,7 +288,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
target.y = pos.y; target.y = pos.y;
target.angle = pos.angle; target.angle = pos.angle;
this.playLocalAudio("right"); this.playLocalAudio("right");
pg.event.emit("mouse_add"); pg.event.emit("mouse_08_add");
} }
private setTouchPos(e) { private setTouchPos(e) {
...@@ -366,12 +372,12 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -366,12 +372,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
private initStart() { private initStart() {
this.layout_start.active = true; this.layout_start.active = true;
cc.find("layout_top/label_title", this.node).getComponent(cc.Label).string = Game.getIns().title; cc.find("layout_top/label_title", this.node).getComponent(cc.Label).string = Game.getIns().title;
pg.event.emit("mouse_num", Game.getIns().getCardInfo().length); pg.event.emit("mouse_08_num", Game.getIns().getCardInfo().length);
let start_ske = cc.find("layout_start/start_ske", this.node); let start_ske = cc.find("layout_start/start_ske", this.node);
pg.load.loadDB(start_ske, { ske: Game.getIns().aniEnter.ske.url, tex: Game.getIns().aniEnter.tex.url, png: Game.getIns().aniEnter.png.url }).then((animationName) => { pg.load.loadDB(start_ske, { ske: Game.getIns().aniEnter.ske.url, tex: Game.getIns().aniEnter.tex.url, png: Game.getIns().aniEnter.png.url }).then((animationName) => {
if (animationName && animationName != "") { if (animationName && animationName != "") {
let db = start_ske.getComponent(dragonBones.ArmatureDisplay); let db = start_ske.getComponent(dragonBones.ArmatureDisplay);
let anis = db.getAnimationNames("armatureName"); let anis = db.getAnimationNames(db.armatureName);
db.playAnimation(anis[0], 0); db.playAnimation(anis[0], 0);
cc.tween(start_ske).by(1, { x: -500 }).call(() => { cc.tween(start_ske).by(1, { x: -500 }).call(() => {
pg.audio.playAudioByUrl(Game.getIns().startAudio).then(() => { pg.audio.playAudioByUrl(Game.getIns().startAudio).then(() => {
......
...@@ -12,16 +12,16 @@ import pg from "../tool/pg"; ...@@ -12,16 +12,16 @@ import pg from "../tool/pg";
const { ccclass, property } = cc._decorator; const { ccclass, property } = cc._decorator;
@ccclass @ccclass
export default class NewClass extends cc.Component { export default class Ngt_star_08 extends cc.Component {
// LIFE-CYCLE CALLBACKS: // LIFE-CYCLE CALLBACKS:
onLoad() { onLoad() {
pg.event.on("mouse_add", (isRight = true) => { pg.event.on("mouse_08_add", (isRight = true) => {
this.showBigStar(isRight); this.showBigStar(isRight);
}); });
pg.event.on("mouse_num", (max: number) => { pg.event.on("mouse_08_num", (max: number) => {
this.initStar(max); this.initStar(max);
}); });
pg.event.on("mouse_add_error", (isRight = true) => { pg.event.on("mouse_08_add_error", (isRight = true) => {
this.showErrorStar(); this.showErrorStar();
}); });
} }
...@@ -124,7 +124,7 @@ export default class NewClass extends cc.Component { ...@@ -124,7 +124,7 @@ export default class NewClass extends cc.Component {
star.x = 0; star.x = 0;
star.y = 0; star.y = 0;
star.scale = 1 / bigStarBg.scale; star.scale = 1 / bigStarBg.scale;
pg.event.emit("mouse_num_game_end") pg.event.emit("mouse_08_num_game_end")
} }
showBigStar(isRight) { showBigStar(isRight) {
if (!this.bigStarArr || this.bigStarArr.length <= 0) { if (!this.bigStarArr || this.bigStarArr.length <= 0) {
...@@ -170,7 +170,7 @@ export default class NewClass extends cc.Component { ...@@ -170,7 +170,7 @@ export default class NewClass extends cc.Component {
.delay(0.6) .delay(0.6)
.to(0.8, { scale: 0 }, { easing: 'quadOut' }) .to(0.8, { scale: 0 }, { easing: 'quadOut' })
.call(() => { .call(() => {
pg.event.emit("mouse_num_game_end") pg.event.emit("mouse_08_num_game_end")
// this.playAudio(this.starCountClip); // this.playAudio(this.starCountClip);
}) })
.start(); .start();
......
{ {
"ver": "1.0.8", "ver": "1.0.8",
"uuid": "cbcab305-7bef-41fe-93cd-896a850b6cf4", "uuid": "7ff4d822-9f35-42b2-a94e-b984fc46c882",
"isPlugin": false, "isPlugin": false,
"loadPluginInWeb": true, "loadPluginInWeb": true,
"loadPluginInNative": true, "loadPluginInNative": true,
......
...@@ -4590,6 +4590,9 @@ declare namespace cc { ...@@ -4590,6 +4590,9 @@ declare namespace cc {
forward: Vec3; forward: Vec3;
pageIdx: any; pageIdx: any;
data: any; data: any;
star: Node;
starBig: Node;
star_wrong: Node;
/** /**
@param name name @param name name
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