Commit 5b665696 authored by 徐行's avatar 徐行

结束传出数据

parent 8be14c7c
...@@ -5,6 +5,7 @@ import { AudioMgr } from '../../../../startFolder/script/common/AudioMgr'; ...@@ -5,6 +5,7 @@ import { AudioMgr } from '../../../../startFolder/script/common/AudioMgr';
import { Utils } from '../../../../startFolder/script/common/Utils'; import { Utils } from '../../../../startFolder/script/common/Utils';
import { VIEW_DEF } from '../../../../startFolder/script/common/ViewDef'; import { VIEW_DEF } from '../../../../startFolder/script/common/ViewDef';
import { viewMgr, VIEW_INDEX } from '../../../../startFolder/script/common/ViewMgr'; import { viewMgr, VIEW_INDEX } from '../../../../startFolder/script/common/ViewMgr';
import { GameEndDataItf, GameEndDataItf_1, htmlSendDataMgr } from '../../../../startFolder/script/HtmlSendDataMgr';
import { BeginCountdownView } from '../../commonView/script/BeginCountdownView'; import { BeginCountdownView } from '../../commonView/script/BeginCountdownView';
import { ChallengeSuccView } from '../../commonView/script/ChallengeSuccView'; import { ChallengeSuccView } from '../../commonView/script/ChallengeSuccView';
import { GameDescView } from '../../commonView/script/GameDescView'; import { GameDescView } from '../../commonView/script/GameDescView';
...@@ -277,6 +278,19 @@ export class VHFillNumCtr extends Component { ...@@ -277,6 +278,19 @@ export class VHFillNumCtr extends Component {
node.getComponent(ScoreFailView)?.setData(1, "C"); node.getComponent(ScoreFailView)?.setData(1, "C");
}, VIEW_INDEX.TOP); }, VIEW_INDEX.TOP);
} }
//把数据发给包裹游戏的容器
let score = Math.floor(this.totalTime - this.costTime);
let sendOutData: GameEndDataItf_1 = {
gameId: 2222222,
gameScore: score < 0 ? 0 : score,
gameEvaluation: this.getGrade(),
durTime: Math.floor(this.costTime * 1000),
totalTime: Math.floor(this.costTime * 1000),
finishRate: score < 0 ? 0 : score,
type: "cocos_game"
}
htmlSendDataMgr.sendDataOut(JSON.stringify(sendOutData));
//************************** */
} }
getGrade() { getGrade() {
......
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