觉醒时刻
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.
 
 
 

73 lines
2.1 KiB

import Common5 from "../../../Platform/th/Common5";
import TaskManager, { MainTaskIdEnum } from "../../JuQingChat/TaskManager";
import NewGuideScript from "../../NewGuide/NewGuideScript";
import PrefabManage, { GameType } from "../../PrefabManager/PrefabManage";
import GameBase from "../../SCommon/GameBase";
const { ccclass, property } = cc._decorator;
@ccclass
export default class TouZiXieYiShu extends GameBase {
@property(cc.Label)
jianzhuStr: cc.Label = null
@property(cc.Label)
moneyStr: cc.Label = null
@property(cc.Node)
gaiZhang: cc.Node = null
@property(cc.Sprite)
heTong: cc.Sprite = null
@property([cc.SpriteFrame])
spFrameTab: cc.SpriteFrame[] = []
callFunc = null
onDestroy() {
super.onDestroy()
}
onLoad() {
super.onLoad()
}
initView(index, money, callFunc) {
this.scheduleOnce(() => {
this.gaiZhang.active = true
this.gaiZhang.getComponent(sp.Skeleton).setAnimation(0, '盖章', false)
this.gaiZhang.getComponent(sp.Skeleton).setCompleteListener(() => {
this.gaiZhang.getComponent(sp.Skeleton).setCompleteListener(null)
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
if (mainId == MainTaskIdEnum.MainTask_304) {
let node = this.node.getChildByName("blueBtn");
this.guideView([node]);
}
})
}, 1)
// this.heTong.spriteFrame = this.spFrameTab[index]
this.jianzhuStr.string = index
this.moneyStr.string = `${Common5.getNumberChangeHanzi(money, '1')}`
this.callFunc = callFunc
}
onBtnSure() {
this.node.removeFromParent()
this.callFunc && this.callFunc()
}
guideView(nodeArray) {
PrefabManage.loadPrefabByType(GameType.GuideMskNode, this.node, (prefab) => {
let guideNodeArray = nodeArray
let firstNode = guideNodeArray.shift()
prefab.getComponent(NewGuideScript).setBindNode(firstNode, guideNodeArray)
})
}
}