import { _decorator, Component, Node } from 'cc'; import ch_sign from '../../../ch/sign/sign'; import { UINotify } from '../../../module_basic/ui_notify/UINotify'; import { Hall } from '../../hall/Hall'; const { ccclass, property } = _decorator; @ccclass('Sign_Reward') export class Sign_Reward extends Component { @property(Node) Mask: Node = null; @property([Number]) type: number[] = []; @property([Number]) num: number[] = []; start() { } async show(day: number) { let state = await ch_sign.getInstance().checkSigineState(day); console.log(day + ':' + state); this.Mask.active = state == 1; } add_Item(flag: boolean) { for (let i = 0; i < this.type.length; i++) { let Num=flag?(this.num[i]*2).toString():this.num[i].toString() switch(this.type[i]) { case 1: UINotify.show('获得消除印章'+'X'+Num); break; case 2: UINotify.show('获得洗牌卡'+'X'+Num); break; case 3: UINotify.show('获得清空'+'X'+Num); break; } Hall.getInstance().player.add_item(this.type[i], flag?this.num[i]*2:this.num[i]); } } }