Types of script

    There are three main types of script in Xenko: startup scripts, synchronous scripts, and asynchronous scripts.

    When you write your script, inherit from the type of script with the behavior that best fits your needs.

    Example:

    Synchronous scripts are initialized, then updated every frame, and finally canceled (when the script is removed).

    • The code performing the update goes in the method.
    • The code performing the cancellation goes in the Cancel method.The following script performs updates every frame, no matter what:
    • Asynchronous code goes in the function.

    • Code performing the cancellation goes in the Cancel method.