Skip to content

Execute Code

Nathan edited this page May 1, 2021 · 9 revisions

For the power users out there, I've included the ability for runtime compilation of your own code to act as an action!

Whenever you add a new Execute C# code action, you will be greeted with the following code snippet:

using System;

public class CPHInline
{
    public bool Execute()
    {
        // your main code goes here
        return true;
    }
}

For every execute code sub-action, this is the minimum that must be present for it to function.

You can also have an Init and a Dispose method that will be called when your code is first compiled, and when it is destroyed, so if you need to do any initialization steps, or cleanup steps, you'll be able to, THESE TWO METHODS ARE OPTIONAL.

You will want to add the following for init:

public void Init()
{
    // place your init code here
}

And the following for dispose:

public void Dispose()
{
    // place your dispose code here
}

Clone this wiki locally