ABout to try scene and script merger
This commit is contained in:
Vendored
+24
@@ -5,6 +5,24 @@
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/**
|
||||
* An array-like proxy over one of an asset entry's events.
|
||||
* Assign a function to a numbered slot to subscribe; assign `null` to
|
||||
* unsubscribe that slot.
|
||||
*
|
||||
* @example
|
||||
* entry.onLoaded[0] = () => Console.print('loaded!');
|
||||
* entry.onLoaded[0] = null; // unsubscribe
|
||||
*/
|
||||
interface AssetEventProxy {
|
||||
readonly length: number;
|
||||
0: (() => void) | null;
|
||||
1: (() => void) | null;
|
||||
2: (() => void) | null;
|
||||
3: (() => void) | null;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
/**
|
||||
* A live reference to an entry in the asset cache.
|
||||
* Holds a lock that keeps the entry alive; the lock is released automatically
|
||||
@@ -26,6 +44,12 @@ interface AssetEntry {
|
||||
* is not yet loaded.
|
||||
*/
|
||||
readonly texture: Texture | undefined;
|
||||
/** Event proxy — subscribe up to 4 callbacks for when loading completes. */
|
||||
readonly onLoaded: AssetEventProxy;
|
||||
/** Event proxy — subscribe up to 4 callbacks for when the entry is disposed. */
|
||||
readonly onUnloaded: AssetEventProxy;
|
||||
/** Event proxy — subscribe up to 4 callbacks for when loading fails. */
|
||||
readonly onError: AssetEventProxy;
|
||||
/**
|
||||
* Blocks until the entry reaches `LOADED` (or `ERROR`).
|
||||
* Returns `this` for chaining.
|
||||
|
||||
Reference in New Issue
Block a user