咸鱼的反击
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.
 
 
 
xianyudefanji/assets/Scripts/SCommon/daoyeBtnScript.ts

59 lines
1.9 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 TaskManager, { MainTaskIdEnum } from "../JuQingChat/TaskManager";
import InterfaceManager from "../Manager/InterfaceManager";
import PrefabManage, { GameType } from "../PrefabManager/PrefabManage";
const {ccclass, property} = cc._decorator;
@ccclass
export default class daoyeBtnScript extends cc.Component {
// LIFE-CYCLE CALLBACKS:
// onLoad () {}
start () {
let isHaveKaiye = InterfaceManager.getHaveKaiye(GameType.GDaoYeShouGou)
let daoYeList = InterfaceManager.getDaoyeList()
if(isHaveKaiye && daoYeList.length>0){
this.node.active = true
}else{
this.node.active = false
}
}
clickBtnDaoye(){
let daoyeJiaohuo = User.getDaoyeJiaoHuo()
if(daoyeJiaohuo == true){
let mainTaskInfo:any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
// if(mainId == MainTaskIdEnum.MainTask_203 || MainTaskIdEnum.MainTask_204){
// PrefabManage.loadPrefabByType(GameType.GDaoYeShouGou)
// return
// }
PrefabManage.showTextTips('美女商人暂时外出/请耐心等待')
}else{
let isHaveKaiye = InterfaceManager.getHaveKaiye(GameType.GDaoYeShouGou)
if(isHaveKaiye){
PrefabManage.loadPrefabByType(GameType.GDaoYeShouGou)
}else{
PrefabManage.showTextTips('等待第6个剧情解锁')
}
}
}
// update (dt) {}
}