123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- import { _decorator, Component, Node, sys } from 'cc';
- import { GameCfg } from 'db://assets/script/Config/GameCfg';
- import { mainscene } from 'db://assets/script/mainscene';
- import { AudioManager } from 'db://assets/script/Manager/AudioMgr';
- import EventMgr from 'db://assets/script/Manager/EventMgr';
- import { User } from 'db://assets/script/Manager/LocalDataMgr';
- import PlatformService from 'db://assets/script/Platform/PlatformService';
- import { gamecfg } from '../dtta/interfaceMgr';
- const { ccclass, property } = _decorator;
- @ccclass('page_result')
- export class page_result extends Component {
- @property(Node)
- arr_node_allpage: Node[] = [];
- data: gamecfg = null;
- Init(isWin: boolean) {
- this.node.active = false
- this.scheduleOnce(() => {
- this.arr_node_allpage[isWin ? 1 : 0].active = true;
- AudioManager.instance.playBundleAudio(isWin ? "victory" : "fail")
- this.node.active = true
- if (GameCfg.CurUnit > 3 && GameCfg.CurUnit % 2 == 0) {
- PlatformService.getInstance().platformApi.showInsertAd(() => { }, () => { })
- }
- }, 1)
- }
- OnClickExit() {
- EventMgr.ins.dispatchEvent("back_chooselevel")
- this.node.destroy()
- }
- OnClickNext() {
- EventMgr.ins.dispatchEvent("goto_nextlevel")
- this.node.destroy()
- }
- OnClickShare() {
- PlatformService.getInstance().platformApi.recordedGameScreenStop()
- PlatformService.getInstance().platformApi.shareRecordedGameScreen()
- }
- OnClickRestart() {
- EventMgr.ins.dispatchEvent("restart_game")
- this.node.destroy()
- }
- OnClickAddtime() {
- if (sys.Platform.BYTEDANCE_MINI_GAME == sys.platform) {
- mainscene.instance.ge.track(
- "ad_show", //追踪事件的名称
- {
- version: "123",
- ad_position: "结算时加时",
- level_id: this.data.unit
- } //需要上传的事件属性
- );
- }
- PlatformService.getInstance().platformApi.loadAndShowVideoAd(() => {
- if (sys.Platform.BYTEDANCE_MINI_GAME == sys.platform) {
- mainscene.instance.ge.track(
- "ad_showend", //追踪事件的名称
- {
- version: "123",
- ad_position: "结算时加时",
- level_id: this.data.unit
- } //需要上传的事件属性
- );
- }
- EventMgr.ins.dispatchEvent("add_time")
- this.node.destroy()
- })
- }
- }
|