12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- import { _decorator, Component, Node } from 'cc';
- import ch_sign from 'db://assets/ch/sign/sign';
- import { UINotify } from 'db://assets/module_basic/ui_notify/UINotify';
- import { Hall } from 'db://assets/Scripts/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]);
- }
- }
- }
|