pinball/assets/_Game/Scripts/UI/StartScreenController.ts

16 lines
560 B
TypeScript
Raw Normal View History

2024-04-05 03:44:35 -07:00
import { _decorator, Animation, Component, Node } from 'cc';
import Utilities 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 Utilities.waitUntil(() => !this._animation.getState(this._animation.defaultClip.name).isPlaying);
this._animation.play(this._animation.clips[1].name);
}
}