123456789101112131415161718192021222324252627282930313233 |
- import { _decorator, Component, Node, Sprite, SpriteFrame } from 'cc';
- import { EventCustom } from '../../scripts/Common/EventCustom';
- const { ccclass, property } = _decorator;
- @ccclass('BullFighter')
- export class BullFighter extends Component {
- @property(SpriteFrame)
- BFSpa: SpriteFrame = null;
- @property(SpriteFrame)
- BFSpb: SpriteFrame = null;
- _t: number;
- set T(a: number) {
- this._t = a;
- this.getComponent(Sprite).spriteFrame = a == 0 ? this.BFSpa : this.BFSpb;
- }
- start() {
- }
- onClick() {
- let e = new EventCustom("BullFighterSelected", true, this.node);
- this.node.dispatchEvent(e);
- }
- update(deltaTime: number) {
- }
- }
|