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.
82 lines
2.6 KiB
82 lines
2.6 KiB
import AppPlatform from "../../../FrameWork/Util/AppPlatform";
|
|
import Common5 from "../../../Platform/th/Common5";
|
|
import TTAPI from "../../../Platform/tt/TTAPI";
|
|
import PrefabManage from "../../PrefabManager/PrefabManage";
|
|
|
|
const { ccclass, property } = cc._decorator;
|
|
|
|
@ccclass
|
|
export default class Result_fail2 extends cc.Component {
|
|
@property(cc.Node)
|
|
fuHuoNode: cc.Node = null;
|
|
@property(cc.Node)
|
|
failNode: cc.Node = null;
|
|
|
|
|
|
fuHuoCallFunc = null
|
|
restartCallFunc = null
|
|
exitCallFunc = null
|
|
protected start(): void {
|
|
TTAPI.stopRecord_custom()
|
|
}
|
|
initView(fuHuoLeftTimes,callFunc1,callFunc2,callFunc3){
|
|
this.fuHuoCallFunc = callFunc1
|
|
this.restartCallFunc = callFunc2
|
|
this.exitCallFunc = callFunc3
|
|
if(fuHuoLeftTimes > 0){
|
|
this.failNode.active = false
|
|
this.fuHuoNode.active = true
|
|
}else{
|
|
this.failNode.active = true
|
|
this.fuHuoNode.active = false
|
|
}
|
|
|
|
}
|
|
onBtnClose(){
|
|
Common5.playEffectCustom("cainiaoxiaoxiao","sound/UI按钮")
|
|
this.node.removeFromParent()
|
|
this.node.destroy()
|
|
this.exitCallFunc && this.exitCallFunc()
|
|
}
|
|
onBtnNoClick(){
|
|
Common5.playEffectCustom("cainiaoxiaoxiao","sound/UI按钮")
|
|
this.failNode.active = true
|
|
this.fuHuoNode.active = false
|
|
}
|
|
onBtnFuHuoClick(){
|
|
Common5.playEffectCustom("cainiaoxiaoxiao","sound/UI按钮")
|
|
let tab = {
|
|
onClose: (finish)=>{
|
|
if (finish) {
|
|
Common5.ReportDY("inLevel", "游戏-AD-复活");
|
|
TTAPI.startRecord_custom()
|
|
this.fuHuoCallFunc && this.fuHuoCallFunc()
|
|
this.node.removeFromParent()
|
|
this.node.destroy()
|
|
}
|
|
else {
|
|
Common5.showTips_custom("广告未观看完");
|
|
}
|
|
},onFailed:()=>{
|
|
|
|
}
|
|
}
|
|
AppPlatform.playVideo_custom(tab)
|
|
}
|
|
onBtnShareClick(){
|
|
Common5.playEffectCustom("cainiaoxiaoxiao","sound/UI按钮")
|
|
TTAPI.shareRecord_custom(() => {
|
|
this.node.removeFromParent()
|
|
this.node.destroy()
|
|
this.exitCallFunc && this.exitCallFunc()
|
|
}, () => {
|
|
PrefabManage.showTextTips("录屏分享功能调用失败,请稍后再试!");
|
|
})
|
|
}
|
|
onBtnRestartClick(){
|
|
Common5.playEffectCustom("cainiaoxiaoxiao","sound/UI按钮")
|
|
this.restartCallFunc && this.restartCallFunc()
|
|
this.node.removeFromParent()
|
|
this.node.destroy()
|
|
}
|
|
}
|
|
|