Commit 86a9a25e authored by unknown's avatar unknown

准备加入关卡成功信息发送

parent 537a65c6
......@@ -226,18 +226,6 @@ export class FaceRecognitionCtr extends Component {
node?.getComponent(ChallengeFailView);
}, VIEW_INDEX.TOP);
}
//把数据发给包裹游戏的容器
let sendOutData: GameEndDataItf = {
gameId: this.gameId,
gameScore: this.curScore,
gameEvaluation: this.getEvaluation(this.curScore),
durTime: Math.floor(this.costTime * 1000),
totalTime: Math.floor(this.costTime * 1000),
finishRate: <number><any>(this.curScore / this.succScore).toFixed(4),
type: "cocos_game"
}
htmlSendDataMgr.sendDataOut(JSON.stringify(sendOutData));
//************************** */
}
//随机生成一个人物信息
......
......@@ -376,18 +376,6 @@ export class BombDisposalExpertCtr extends Component {
node?.getComponent(ChallengeFailView);
}, VIEW_INDEX.TOP);
}
//把数据发给包裹游戏的容器
let sendOutData: GameEndDataItf = {
gameId: this.gameId,
gameScore: this.curScore,
gameEvaluation: this.getEvaluation(this.curScore),
durTime: Math.floor(this.costTime * 1000),
totalTime: Math.floor(this.costTime * 1000),
finishRate: <number><any>(this.curScore / this.succScore).toFixed(4),
type: "cocos_game"
}
htmlSendDataMgr.sendDataOut(JSON.stringify(sendOutData));
//************************** */
}
isGameOver() {
......
......@@ -149,18 +149,6 @@ export class BuyTicketCtr extends Component {
node?.getComponent(ChallengeFailView);
}, VIEW_INDEX.TOP);
}
//把数据发给包裹游戏的容器
let sendOutData: GameEndDataItf = {
gameId: this.gameId,
gameScore: this.curScore,
gameEvaluation: this.getEvaluation(this.curScore),
durTime: Math.floor(this.costTime * 1000),
totalTime: Math.floor(this.costTime * 1000),
finishRate: <number><any>(this.curScore / this.succScore).toFixed(4),
type: "cocos_game"
}
htmlSendDataMgr.sendDataOut(JSON.stringify(sendOutData));
//************************** */
}
//列出火车表
......
......@@ -313,18 +313,6 @@ export class ClassifyCtr_1 extends Component {
}, VIEW_INDEX.TOP);
find("Audio")?.getComponent(AudioCtr)?.playOneShot(this.failMus);
}
//把数据发给包裹游戏的容器
let sendOutData: GameEndDataItf = {
type: "cocos_game",
gameId: this.gameId,
gameScore: this.curScore,
gameEvaluation: this.getEvaluation(this.curScore),
durTime: curTime - this.beginTime,
totalTime: curTime - this.beginTime,
finishRate: <number><any>(this.curScore / this.succScore).toFixed(4)
}
htmlSendDataMgr.sendDataOut(JSON.stringify(sendOutData));
//************************** */
}
else {
this.timeLab.string = ClassifyUtils_1.formatTime(this.totalTime * 1000 - (curTime - this.beginTime));
......
......@@ -280,18 +280,6 @@ export class ClassifyCtr extends Component {
}, VIEW_INDEX.TOP);
find("Audio")?.getComponent(AudioCtr)?.playOneShot(this.failMus);
}
//把数据发给包裹游戏的容器
let sendOutData: GameEndDataItf = {
type: "cocos_game",
gameId: this.gameId,
gameScore: this.curScore,
gameEvaluation: this.getEvaluation(this.curScore),
durTime: curTime - this.beginTime,
totalTime: curTime - this.beginTime,
finishRate: <number><any>(this.curScore / this.succScore).toFixed(4)
}
htmlSendDataMgr.sendDataOut(JSON.stringify(sendOutData));
//************************** */
}
else {
this.timeLab.string = ClassifyUtils.formatTime(this.totalTime * 1000 - (curTime - this.beginTime));
......
import { _decorator, Component, Node, Label, director } from 'cc';
import { Utils } from '../../../../startFolder/script/common/Utils';
import { GameEndDataItf, htmlSendDataMgr } from '../../../../startFolder/script/HtmlSendDataMgr';
import { levelMgr } from '../../../../startFolder/script/LevelMgr';
const { ccclass, property } = _decorator;
......@@ -21,6 +22,19 @@ export class ChallengeSuccView extends Component {
this.countdownLab!.string = "(5)";
this.costTime = 0;
this.isClickOnce = false;
//把数据发给包裹游戏的容器
if(levelMgr.unLockCount >= levelMgr.getLevelCount(levelMgr.gameIdHead)) return;
// let sendOutData: GameEndDataItf = {
// gameId: levelMgr.gameIdHead * 100 + (),
// gameScore: this.curScore,
// gameEvaluation: this.getEvaluation(this.curScore),
// durTime: Math.floor(this.costTime * 1000),
// totalTime: Math.floor(this.costTime * 1000),
// finishRate: <number><any>(this.curScore / this.succScore).toFixed(4),
// type: "cocos_game"
// }
// htmlSendDataMgr.sendDataOut(JSON.stringify(sendOutData));
//************************** */
}
update(deltaTime: number) {
......@@ -35,13 +49,13 @@ export class ChallengeSuccView extends Component {
}
onBackBtnClick() {
if(levelMgr.unLockCount <= levelMgr.runLevel) levelMgr.unLockCount += 1;
if (levelMgr.unLockCount <= levelMgr.runLevel) levelMgr.unLockCount += 1;
levelMgr.backLevelHome();
}
onContinueBtnClick() {
if(levelMgr.unLockCount <= levelMgr.runLevel) levelMgr.unLockCount += 1;
levelMgr.runLevel += 1;
if (levelMgr.unLockCount <= levelMgr.runLevel) levelMgr.unLockCount += 1;
levelMgr.runLevel += 1;
levelMgr.loadLevel();
}
......
......@@ -181,18 +181,6 @@ export class FoodForThePartyCtr extends Component {
node?.getComponent(ChallengeFailView);
}, VIEW_INDEX.TOP);
}
//把数据发给包裹游戏的容器
let sendOutData: GameEndDataItf = {
gameId: this.gameId,
gameScore: this.curScore,
gameEvaluation: this.getEvaluation(this.curScore),
durTime: Math.floor(this.costTime * 1000),
totalTime: Math.floor(this.costTime * 1000),
finishRate: <number><any>(this.curScore / this.succScore).toFixed(4),
type: "cocos_game"
}
htmlSendDataMgr.sendDataOut(JSON.stringify(sendOutData));
//************************** */
}
//倒计时
......
......@@ -128,18 +128,6 @@ export class QuickQuizCtr extends Component {
view?.getComponent(ChallengeFailView);
}, VIEW_INDEX.TOP);
}
//把数据发给包裹游戏的容器
let sendOutData: GameEndDataItf = {
gameId: this.gameId,
gameScore: this.curScore,
gameEvaluation: this.getEvaluation(this.curScore),
durTime: Math.floor(this.costTime * 1000),
totalTime: Math.floor(this.costTime * 1000),
finishRate: <number><any>(this.curScore / this.succScore).toFixed(4),
type: "cocos_game"
}
htmlSendDataMgr.sendDataOut(JSON.stringify(sendOutData));
//************************** */
}
roundStart() {
......
......@@ -321,7 +321,7 @@
"_priority": 1073741824,
"_fov": 45,
"_fovAxis": 0,
"_orthoHeight": 414.4124472573839,
"_orthoHeight": 418.6192468619247,
"_near": 1,
"_far": 2000,
"_color": {
......
......@@ -169,18 +169,6 @@ export class SchulteCtr extends Component {
node?.getComponent(ChallengeSuccView)?.init();
find("Audio")?.getComponent(AudioCtr)?.playOneShot(this.endMus);
}, VIEW_INDEX.TOP);
//把数据发给包裹游戏的容器
let sendOutData: GameEndDataItf = {
type: "cocos_game",
gameId: this.gameId,
gameScore: <number><any>(1 / (Math.round((this.gameEndTime - this.beginTime) / 1000) / this.totalTime)).toFixed(4) * 10000,
gameEvaluation: this.getEvaluation(this.gameEndTime - this.beginTime),
durTime: this.gameEndTime - this.beginTime,
totalTime: this.gameEndTime - this.beginTime,
finishRate: 1 / <number><any>(Math.round((this.gameEndTime - this.beginTime) / 1000) / this.totalTime).toFixed(4)
}
htmlSendDataMgr.sendDataOut(JSON.stringify(sendOutData));
//************************** */
}
});
director.on("continue_game", () => {
......@@ -262,18 +250,6 @@ export class SchulteCtr extends Component {
find("Audio")?.getComponent(AudioCtr)?.playOneShot(this.endMus);
find("Audio")?.getComponent(AudioCtr)?.playOneShot(this.failMus);
}, VIEW_INDEX.TOP);
//把数据发给包裹游戏的容器
let sendOutData: GameEndDataItf = {
type: "cocos_game",
gameId: this.gameId,
gameScore: <number><any>(1 / (Math.round((this.gameEndTime - this.beginTime) / 1000) / this.totalTime)).toFixed(4) * 10000,
gameEvaluation: this.getEvaluation(this.gameEndTime - this.beginTime),
durTime: this.gameEndTime - this.beginTime,
totalTime: this.gameEndTime - this.beginTime,
finishRate: <number><any>(Math.round((this.gameEndTime - this.beginTime) / 1000) / this.totalTime).toFixed(4)
}
htmlSendDataMgr.sendDataOut(JSON.stringify(sendOutData));
//************************** */
}
this.timeLab.string = SchulteUtils.formatTime(this.totalTime * 1000 - (endTime - this.beginTime));
}
......
......@@ -228,18 +228,6 @@ export class SiHaiShiYiCtr extends Component {
node?.getComponent(ChallengeFailView);
}, VIEW_INDEX.TOP);
}
//把数据发给包裹游戏的容器
let sendOutData: GameEndDataItf = {
gameId: this.gameId,
gameScore: this.curScore,
gameEvaluation: this.getEvaluation(this.curScore),
durTime: Math.floor(this.costTime * 1000),
totalTime: Math.floor(this.costTime * 1000),
finishRate: <number><any>(this.curScore / this.succScore).toFixed(4),
type: "cocos_game"
}
htmlSendDataMgr.sendDataOut(JSON.stringify(sendOutData));
//************************** */
}
//获取每一轮应该展示的图片,注意是所有老图片加三张新图片
......
......@@ -331,18 +331,6 @@ export class TransientCtr_1 extends Component {
node?.getComponent(ChallengeFailView);
}, VIEW_INDEX.TOP);
}
//把数据发给包裹游戏的容器
let sendOutData: GameEndDataItf = {
gameId: this.gameId,
gameScore: this.curScore,
gameEvaluation: this.getEvaluation(this.curScore),
durTime: Math.floor(this.costTime * 1000),
totalTime: Math.floor(this.costTime * 1000),
finishRate: <number><any>(this.curScore / this.succScore).toFixed(4),
type: "cocos_game"
}
htmlSendDataMgr.sendDataOut(JSON.stringify(sendOutData));
//************************** */
}
isGameOver() {
......
......@@ -538,18 +538,6 @@ export class UniqueCtr_1 extends Component {
this.gameState = GameState.END;
log(`游戏已经失败`);
}
//把数据发给包裹游戏的容器
let sendOutData: GameEndDataItf = {
gameId: this.gameId,
gameScore: this.curScore,
gameEvaluation: this.getEvaluation(this.curScore),
durTime: endTime - this.beginTime,
totalTime: endTime - this.beginTime,
finishRate: <number><any>(this.curScore / this.succScore).toFixed(4),
type: "cocos_game"
}
htmlSendDataMgr.sendDataOut(JSON.stringify(sendOutData));
//************************** */
}
this.timeLab.string = UniqueUtils_1.formatTime(this.totalTime * 1000 - (endTime - this.beginTime));
}
......
......@@ -542,18 +542,6 @@ export class UniqueCtr_2 extends Component {
this.gameState = GameState.END;
log(`游戏已经失败`);
}
//把数据发给包裹游戏的容器
let sendOutData: GameEndDataItf = {
gameId: this.gameId,
gameScore: this.curScore,
gameEvaluation: this.getEvaluation(this.curScore),
durTime: endTime - this.beginTime,
totalTime: endTime - this.beginTime,
finishRate: <number><any>(this.curScore / this.succScore).toFixed(4),
type: "cocos_game"
}
htmlSendDataMgr.sendDataOut(JSON.stringify(sendOutData));
//************************** */
}
this.timeLab.string = UniqueUtils_2.formatTime(this.totalTime * 1000 - (endTime - this.beginTime));
}
......
......@@ -548,18 +548,6 @@ export class UniqueCtr extends Component {
this.gameState = GameState.END;
log(`游戏已经失败`);
}
//把数据发给包裹游戏的容器
let sendOutData: GameEndDataItf = {
gameId: this.gameId,
gameScore: this.curScore,
gameEvaluation: this.getEvaluation(this.curScore),
durTime: endTime - this.beginTime,
totalTime: endTime - this.beginTime,
finishRate: <number><any>(this.curScore / this.succScore).toFixed(4),
type: "cocos_game"
}
htmlSendDataMgr.sendDataOut(JSON.stringify(sendOutData));
//************************** */
}
this.timeLab.string = UniqueUtils.formatTime(this.totalTime * 1000 - (endTime - this.beginTime));
}
......
......@@ -37,6 +37,7 @@ class HtmlSendDataMgr {
if (HTML5 || PREVIEW) {
console.log(`xuhang发送postMessage数据:`);
console.log(data);
//@ts-ignore
window.top.postMessage(data, this.targetOrigin);
//@ts-ignore
if (typeof wx != "undefined") {
......
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