GameObject <T>
Index
Constructors
Properties
Methods
Constructors
constructor
Constructs a new GameObject with given params.
Type parameters
Parameters
type: string
unique name for the game object type. Use package-like names to ensure your game object name is unique
prototype: T
Returns GameObject<T>
Properties
readonlyPrototypeinternal
Prototype from which instantiated objects are created.
readonlygameobjectName
Same as GameObject.originalName, but with suffix which are used for object saving to be unique.
readonlyisDeployed
true
if current object was deployed or added directly.
readonlyisInstance
true
if current object is instance, prototype otherwise.
readonlyoriginalName
Original value passed to GameObject.constructor as type.
readonlysaverIdinternal
Used when Saver.registerObject calling inside.
Methods
deploy
Creates a new game object with specified params and registers it for saving and as an Updatable.
Parameters
rest...args: any
any arguments that are passed to GameObjectPrototype.init function
Returns GameObject<T>
Instantiated game object.
destroy
Destroys current game object.
Returns void
instantiate
- internal
Creates a new game object without deploying it; you are shouldn't do it normally, it was called by GameObject.deploy.
Returns GameObject<T>
Instantiated game object.
Class used to create and manipulate game objects. Game objects are Updatables that are being saved between game launches.