mirror of
https://github.com/MartinKral/Slash-The-Hordes
synced 2025-10-09 08:36:14 +00:00
Upgrader, LevelUpSkill
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
import { CCString, _decorator } from "cc";
|
||||
import { delay } from "../Utils/AsyncUtils";
|
||||
import { ModalWindow } from "./ModalWindow";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass("LevelUpModalWindow")
|
||||
export class LevelUpModalWindow extends ModalWindow<string, string> {
|
||||
@property(CCString) private testField: string;
|
||||
|
||||
protected async setup(params: string): Promise<void> {
|
||||
console.log("TEST FIELD: " + this.testField + " params: " + params);
|
||||
|
||||
await delay(10000);
|
||||
this.dismiss("FInishedSuccessfuly");
|
||||
}
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "f7ac6f2a-2bea-42ec-b5d0-58976001856c",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -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