zoukankan      html  css  js  c++  java
  • callback

    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().

  • 相关阅读:
    Redis主从复制
    POI导出给指定单元格添加背景色
    Mybatis的resultMap使用
    前后端分离
    日常总结
    java环境变量配置
    Java线程池七个参数详解
    java中常见的锁
    Linux定时任务
    SQL语句的整理
  • 原文地址:https://www.cnblogs.com/wzheng/p/3893401.html
Copyright © 2011-2022 走看看