大侠
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

31 lines
702 B

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;
}
}
}