UNPKG

the-world-engine

Version:

three.js based, unity like game engine for browser

26 lines (25 loc) 796 B
import { GameObjectBuilder } from "./GameObjectBuilder"; /** * this class is used to define a prefab * do not override constructor it's break the engine */ export class Prefab { _private__instantiater; _private__gameObjectBuilder; constructor(engineGlobalObject, name, localPosition, localRotation, localScale) { this._private__instantiater = engineGlobalObject.instantiater; this._private__gameObjectBuilder = new GameObjectBuilder(engineGlobalObject, name, localPosition, localRotation, localScale); } /** * get global engine object */ get instantiater() { return this._private__instantiater; } /** * get game object builder */ get gameObjectBuilder() { return this._private__gameObjectBuilder; } }