This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Migration
Migrating to UNIGINE 2.0
C++ API Migration
Migrating from UNIGINE 2.0 to UNIGINE 2.1
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Scheduler Class

The Scheduler class provides scheduling of the periodic call of the function or group of functions and their automatic time spreading. The call frequency can vary from 1 to 60 times per second.

The Scheduler class implementation can be found in the data/framework/game/scheduler.h file.

Scheduler Class

Members


Scheduler ()

Constructor. Creates a new Scheduler class instance.

void update (float ifps)

Updates a scheduler.

Arguments

  • float ifps - Inverse frame duration in seconds.

void setPeriodicUpdate (variable instanse, string function, int frequency, int priority, variable arg0 = 0, variable arg1 = 0, variable arg2 = 0, variable arg3 = 0)

Sets the periodic update for the function.

Arguments

  • variable instanse - User class instance, for which the function is called. If the function is static, pass the NULL value.
  • string function - Function name.
  • int frequency - Frequency of the function call. The frequency takes on the values from 1 to 60.
  • int priority - Priority of the function call.
  • variable arg0 - Function argument, optional.
  • variable arg1 - Function argument, optional.
  • variable arg2 - Function argument, optional.
  • variable arg3 - Function argument, optional.

void removePeriodicUpdate (variable instanse, string function, int num_args = 0)

Removes the periodic update of the function.

Arguments

  • variable instanse - User class instance, for which the function is called. If the function is static, pass the NULL value.
  • string function - Function name.
  • int num_args = 0 - Number of function arguments.
Last update: 2017-07-03
Build: ()