Skip to content

BasicScript

LtFlash edited this page Sep 27, 2016 · 6 revisions

Description

BasicScript represents the simplest form of a script. It allows to create scripts which don't need complicated mechanism of initialization (like in CalloutScriptBase). This script inherits from ScriptBase.

Source code

Inheritance Hierarchy

  • ScriptBase
    • BasicScript

Members

Functions

Access Name Description
public void SetScriptFinished(bool completed) Sets HasFinished to true, sets Completed property to value of completed, calls End() and stops the execution of the script.

Example

class MyScript : BasicScript
{
    public override void Initialize()
    {
        //create entities etc.
    }

    public override void Process()
    {
        //code
        if(missionCompleted) SetScriptFinished(true);
    }

    public override void End()
    {
        //free your resources here
    }
}

Remarks

  • When you want to finish the script don't call End() directly. Use SetScriptFinished(bool) instead.
Clone this wiki locally