import { _decorator, CCString, Component, Label, Node } from 'cc'; const { ccclass, property } = _decorator; @ccclass('LabelLoading') export class LabelLoading extends Component { @property(Label) label: Label = null; @property time:number = 0.2; @property(CCString) tipis:string = "加载中" @property([CCString]) tips:string[]=[] tindex: number = 0; start() { this.schedule(this.renderString, this.time) this.renderString(); } renderString() { this.label.string = this.tipis+ this.tips[this.tindex]; this.tindex++; if (this.tindex >= this.tips.length) { this.tindex = 0; } } }