class GameGAME_TEMPLATESource
Members 1
ScriptModule GameScriptGAME_TEMPLATEMethods 25
ScriptModule GetScriptModule()GAME_TEMPLATEvoid SetDebug(bool isDebug)GAME_TEMPLATEvoid OnEvent(EventType eventTypeId, Param params)GAME_TEMPLATECalled when some system event occur.
eventTypeId- event type.
params- Param object, cast to specific param class to get parameters for particular event.
void OnUpdate(float timeslice)GAME_TEMPLATECalled on World update
timeslice- time elapsed from last call
proto native bool SetWorldFile(string path, bool reload)GAME_TEMPLATESets world file to be loaded. Returns false if file doesn't exist.
path- Path to the ent file
reload- Force reload the world
proto native owned string GetWorldFile()GAME_TEMPLATEReturns path of world file loaded
bool OnGameStart()GAME_TEMPLATEEvent which is called right before game starts (all entities are created and initialized). Returns true if the game can start.
void OnGameEnd()GAME_TEMPLATEEvent which is called right before game end.
void ShowLoadingAnim()GAME_TEMPLATECreates loading screen
void HideLoadingAnim()GAME_TEMPLATEHides loading screen
void UpdateLoadingAnim(float timeslice, float progress)GAME_TEMPLATEUsed for updating the loading screen
timesliceprogress- loading progress between 0 and 1
proto native IEntity SpawnEntity(typename typeName)GAME_TEMPLATESafely instantiate the entity and calls EOnInit if the entity sets event mask EntityEvent.INIT.
typename- Name of entity's type to instantiate.
Returns: instantiated entity
proto native IEntity SpawnEntityTemplate(vobject templateResource)GAME_TEMPLATESafely instantiate the entity from template (with all components) and calls EOnInit if the entity sets event mask EntityEvent.INIT.
templateResource- Template resource of the entity to instantiate.
Returns: instantiated entity
proto native GenericComponent SpawnComponentTemplate(IEntity owner, vobject templateResource)GAME_TEMPLATESafely instantiate the component from template, insert it to entity and calls EOnInit if the component sets event mask EntityEvent.INIT.
owner- Entity which will own the component
templateResource- Template resource of the component to instantiate.
Returns: instantiated component
proto native IEntity FindEntity(string name)GAME_TEMPLATEproto native WorkspaceWidget GetWorkspace()GAME_TEMPLATEproto native void RequestClose()GAME_TEMPLATESetting request flag for engine to exit the game
proto native void RequestReload()GAME_TEMPLATESetting request flag for the engine to reinitialize the game Doesn't do anything in Workbench
proto native owned string GetBuildVersion()GAME_TEMPLATEReturns version of the game
proto native owned string GetBuildTime()GAME_TEMPLATEReturns date and time when the game was built
proto native GenericWorldEntity GetWorldEntity()GAME_TEMPLATEReturns World entity when in game or in play mode in WE. NULL otherwise.
proto native InputManager GetInputManager()GAME_TEMPLATEShow 1 more
, WorldsMenu.EOnPostFrame()proto native MenuManager GetMenuManager()GAME_TEMPLATEproto native int GetTickCount()GAME_TEMPLATE