123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- import { _decorator, Button, Component, Node, Sprite, SpriteAtlas, tween } from 'cc';
- import { EventCustom } from '../../Common/Scripts/EventCustom';
- const { ccclass, property } = _decorator;
- @ccclass('MmCardItem')
- export class MmCardItem extends Component {
- @property(Node)
- CardB: Node = null;
- @property(Node)
- CardO: Node = null;
- @property(Sprite)
- CardVSp: Sprite = null;
- @property(SpriteAtlas)
- CardImgs: SpriteAtlas = null;
- _openTime: number = 5;
- _isO: boolean = false;;
- _cardV: number;
- set CardV(a: number) {
- this._cardV = a;
- this.CardB.active = true;
- this.CardO.active = false;
- this.CardVSp.node.active = false;
- this.CardVSp.spriteFrame = this.CardImgs.getSpriteFrame(this._cardV + "");
- this._isO = false;
- }
- start() {
- }
- clicked() {
- let e = new EventCustom("CardClick", true, this.node);
- this.node.dispatchEvent(e);
- }
- update(deltaTime: number) {
- }
- }
|