mirror of
https://github.com/MartinKral/Slash-The-Hordes
synced 2026-02-14 12:22:42 +00:00
Upgrader, LevelUpSkill
This commit is contained in:
@@ -1,14 +1,21 @@
|
||||
import { Component } from "cc";
|
||||
import { Animation, Component, _decorator } from "cc";
|
||||
import { delay } from "../Utils/AsyncUtils";
|
||||
|
||||
const { property } = _decorator;
|
||||
|
||||
export abstract class ModalWindow<TParam, TResult> extends Component {
|
||||
@property(Animation) private animation: Animation;
|
||||
|
||||
private result: TResult;
|
||||
private isDismissed = false;
|
||||
|
||||
public async runAsync(params?: TParam): Promise<TResult> {
|
||||
this.setup(params);
|
||||
this.animation?.play("open");
|
||||
while (!this.isDismissed) await delay(100);
|
||||
this.animation?.play("close");
|
||||
|
||||
await delay(500);
|
||||
return this.result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user