码迷,mamicode.com
首页 > 其他好文 > 详细

callback

时间:2014-08-06 01:28:50      阅读:313      评论:0      收藏:0      [点我收藏+]

标签:io   ar   cti   html   c++   htm   app   ef   

What about the callback in Unigine?

Any function from system, world or editor scripts can be called in a C++ code. UnigineScript functions that are called from an external code are known as callbacks. Via callbacks scripts can communicate with each other, as well as with the external application.

 

The sequence of function call will be as follows:

  1. The interpreter exports the runWorldFunction() function to make it available from the script.
  2. The engine is initialized, and the init() function of the script is called. This function calls the exported runWorldFunction() function.
  3. The exported runWorldFunction() function calls the callback() function from the script.
  4. The engine enters the main loop, where it calls the counter() function from the script by using the Unigine::Engine::runWorldFunction() function

在脚本中函数的调用顺序是,先调用init()函数,然后调用exportecd function runWorldFunction(),因为runWorldFunction()中调用了脚本中的函数callback(),所以runWorldFunction()会先调用callback(),也就是说在脚本中会先执行callback().

callback,布布扣,bubuko.com

callback

标签:io   ar   cti   html   c++   htm   app   ef   

原文地址:http://www.cnblogs.com/wzheng/p/3893401.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!