Jump to content

[SOLVED] Frame-By-Frame Updates for Non-World Scripts


photo

Recommended Posts

Is it possible to create custom classes that have their own update(), flush(), and render() functions that are automatically called by the engine without having to explicitly calling them from the world script?

Link to comment

At least there always has to be one explict invocation from world or system script update(), flush() or render() functions. But you could define a centralized CustomObjectManager and a CustomObjectBase class where both classes implement update/flush/ender() functions.

 

Within CustumObjectBase constructor/destructor each instance simply registers/deregisters itself at CustumObjectManager. On invocation of CustomObjectManager::update/flush/render() from within world/system script the manager simply invocates CustomObjectBase::update/flush/render() on all registered instances.

 

Your actual custom classes only have to inherit CustomObjectBase and overwrite update/flush/render() functions as required. These implementations will then be invoked automatically by CustomObjectManager.

  • Like 1
Link to comment

Hey, Mandee.

 

No, there is no custom class update(), flush() or render() functions implicitly called from engine.

 

But, as Ulf said, you can do this in Unigine Script by creating your own class hierarchy. Also, you can split your objects to subsystems and write a something like a manager to them, which will update(), flush() or render() objects properly.

Link to comment
×
×
  • Create New...