16 lines
552 B
TypeScript
16 lines
552 B
TypeScript
import { _decorator, Animation, Component, Node } from 'cc';
|
|
import Utils from '../Utilities';
|
|
const { ccclass, property } = _decorator;
|
|
|
|
@ccclass('StartScreenController')
|
|
export class StartScreenController extends Component {
|
|
@property({ type: Animation, visible: true })
|
|
private _animation: Animation;
|
|
|
|
protected async start() {
|
|
this._animation.play();
|
|
await Utils.waitUntil(() => !this._animation.getState(this._animation.defaultClip.name).isPlaying);
|
|
this._animation.play(this._animation.clips[1].name);
|
|
}
|
|
}
|