UNPKG

the-world-engine

Version:

three.js based, unity like game engine for browser

26 lines (25 loc) 540 B
import { GameObjectBuilder } from "./hierarchy_object/GameObjectBuilder"; export class Instantiater { L; I=0; N=0; constructor(e) { this.L = e; } generateId() { const e = this.I; this.I += 1; return e; } generateEventId() { const e = this.N; this.N += 1; return e; } buildGameObject(e, t, r, n) { return new GameObjectBuilder(this.L, e, t, r, n); } buildPrefab(e, t, r, n, i) { return new t(this.L, e, r, n, i); } }