SpecialToast.ts 714 Bytes
import { DummySprite } from "../../common/CCDummyObjects";

const { ccclass, property } = cc._decorator;

export enum SpecialToastType {
    CommonValue = 0,//通用剧情数值变化
    AiErValue = 1,//艾尔专属数值变化
    GaiYinValue = 2,//该隐专属数值变化
}

@ccclass
export default class SpecialToast extends cc.Component {

    @property({ type: cc.Sprite, displayName: "Tips sprite" })
    tipsSprite: cc.Sprite = DummySprite;
    @property({ type: [cc.SpriteFrame], displayName: "Tips spriteFrames" })
    tipsSpriteFrames: cc.SpriteFrame[] = [];

    async setData(specialToastType: SpecialToastType) {
        this.tipsSprite.spriteFrame = this.tipsSpriteFrames[specialToastType];
    }
}