You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
101 lines
3.0 KiB
101 lines
3.0 KiB
// Learn TypeScript:
|
|
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
|
|
// Learn Attribute:
|
|
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
|
|
// Learn life-cycle callbacks:
|
|
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html
|
|
|
|
import User from "../../FrameWork/User/User";
|
|
import AppPlatform from "../../FrameWork/Util/AppPlatform";
|
|
import Common5 from "../../Platform/th/Common5";
|
|
import TaskManager from "../JuQingChat/TaskManager";
|
|
|
|
const { ccclass, property } = cc._decorator;
|
|
|
|
@ccclass
|
|
export default class taskState extends cc.Component {
|
|
|
|
@property(cc.Node)
|
|
successNode: cc.Node = null
|
|
@property(cc.Label)
|
|
successLabel: cc.Label = null
|
|
@property(cc.Node)
|
|
failNode: cc.Node = null
|
|
@property(cc.Label)
|
|
failLabel: cc.Label = null
|
|
successCallBack: any;
|
|
failCallBack1: any;
|
|
failCallBack2: any;
|
|
// @property
|
|
// text: string = 'hello';
|
|
|
|
|
|
|
|
// LIFE-CYCLE CALLBACKS:
|
|
|
|
// onLoad () {}
|
|
|
|
start() {
|
|
Common5.showInterstitialAd()
|
|
}
|
|
|
|
showSuccess(successLabel, callback) {
|
|
this.successLabel.string = successLabel
|
|
this.successCallBack = callback
|
|
this.successNode.active = true
|
|
// Common5.playRemoteAudioEffect("remotesound/effect/成功音")
|
|
Common5.playRemoteAudioEffect('sound/diandiandian/战斗胜利')
|
|
}
|
|
|
|
showFail(failLabel, callback1, callback2) {
|
|
this.failLabel.string = failLabel
|
|
this.failCallBack1 = callback1
|
|
this.failCallBack2 = callback2
|
|
this.failNode.active = true
|
|
// Common5.playRemoteAudioEffect("remotesound/effect/失败音")
|
|
Common5.playRemoteAudioEffect('sound/diandiandian/战斗失败')
|
|
}
|
|
|
|
onTouch1() {
|
|
//Common5.playEffect("sound/按键点击")
|
|
if (this.successCallBack) {
|
|
this.successCallBack()
|
|
}
|
|
this.node.removeFromParent()
|
|
this.node.destroy()
|
|
}
|
|
|
|
onTouch2() {
|
|
//Common5.playEffect("sound/按键点击")
|
|
if (this.failCallBack1) {
|
|
this.failCallBack1()
|
|
}
|
|
this.node.removeFromParent()
|
|
this.node.destroy()
|
|
}
|
|
|
|
onTouch3() {
|
|
//Common5.playEffect("sound/按键点击")
|
|
let tab = {
|
|
onClose: (finish) => {
|
|
if (finish) {
|
|
User.setShowAdNum(User.getShowAdNum() + 1)
|
|
Common5.ReportDY("inLevel", `任务${TaskManager.getCurUnLockMainTaskId()}-AD-剧情选择直接通关`)
|
|
// Common5.ReportDY("inLevel", '对话-AD-直接通关');
|
|
if (this.failCallBack2) {
|
|
this.failCallBack2()
|
|
}
|
|
this.node.removeFromParent()
|
|
this.node.destroy()
|
|
}
|
|
else {
|
|
Common5.showTips_custom("广告未观看完");
|
|
}
|
|
}, onFailed: () => {
|
|
|
|
}
|
|
}
|
|
AppPlatform.playVideo_custom(tab)
|
|
}
|
|
// update (dt) {}
|
|
}
|
|
|