mirror of
https://github.com/MartinKral/Slash-The-Hordes
synced 2025-12-08 13:49:29 +00:00
app root changes
This commit is contained in:
13
assets/Scripts/AppRoot/AppRootUtils.ts
Normal file
13
assets/Scripts/AppRoot/AppRootUtils.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { delay } from "../Services/Utils/AsyncUtils";
|
||||
import { AppRoot } from "./AppRoot";
|
||||
|
||||
export async function requireAppRootAsync(): Promise<void> {
|
||||
console.log("Waiting for app root");
|
||||
while (AppRoot.Instance == null) await delay(10);
|
||||
|
||||
AppRoot.Instance.node.setSiblingIndex(1000); // render on top
|
||||
AppRoot.Instance.node.active = false; // forces engine to reorder by hierarchy
|
||||
AppRoot.Instance.node.active = true;
|
||||
|
||||
console.log("App root ready");
|
||||
}
|
||||
Reference in New Issue
Block a user