* initAsync * Called after all core objects have been constructed. * @return {Promise} Promise resolved when this component has completed initialization
()
| 64 | * @return {Promise} Promise resolved when this component has completed initialization |
| 65 | */ |
| 66 | initAsync() { |
| 67 | if (this._initPromise) return this._initPromise; |
| 68 | |
| 69 | for (const id of this.dependencies) { |
| 70 | if (!this.context.systems[id]) { |
| 71 | return Promise.reject(`Cannot init: ${this.id} requires ${id}`); |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | const assets = this.context.systems.assets; |
| 76 | const prerequisites = assets.initAsync(); |
| 77 | |
| 78 | return this._initPromise = prerequisites |
| 79 | .then(() => assets.loadAssetAsync('tagging_discarded')) |
| 80 | .then(d => this._discardTags = d); |
| 81 | } |
| 82 | |
| 83 | |
| 84 | /** |
nothing calls this directly
no test coverage detected