reckfellENGINE

C#: names and types at API boundaries

Direct calls, MethodName/PropertyName, .NET arrays and exact C# declarations.

On this page

Start from the C# declaration

The reference displays declarations from the installed SDK. That declaration determines the name, types, argument order and return value. Dynamic invocation does not make arbitrary C# functions or unsupported data types engine-callable.

TaskRule
Invoke your C# methodboundary.Add(3) is an ordinary typed operation
Invoke through engine CallUse ScriptBoundary.MethodName.Add and Variant-compatible arguments
Access through Get/SetUse the corresponding PropertyName
Handle a packed numeric arrayFollow the declaration, for example int[].Length
Use signal result dataCheck its declaration and argument types, then EmitSignal/ToSignal
ScriptBoundary.cs
C#
using Reckfell;

public partial class ScriptBoundary : Entity
{
    public int Count { get; private set; }

    public bool Add(int amount)
    {
        if (amount <= 0 || Count > int.MaxValue - amount) return false;
        Count += amount;
        return true;
    }

    public bool ShowOnChild(string text)
    {
        Label? label = GetEntityOrNull<Label>("Status");
        if (!ReckfellObject.IsInstanceValid(label)) return false;
        label!.Text = text;
        return true;
    }
}

The fixture calls Add(2), then Call(ScriptBoundary.MethodName.Add, 3), producing Count = 5. HasMethod("Add") is true; HasMethod("add") is false. Managed method names are case-sensitive. Built-in native string names may differ from C# names: use the owning class's cache rather than globally replacing snake_case with PascalCase inside strings.

Where model conversion is explicit

.NET and engine containers are not interchangeable merely because their names match. System.Collections.Generic.Dictionary is suitable for local calculation; Export and Variant require supported representations. InventoryLedger.Snapshot makes this boundary explicit.

Variant.Int holds a 64-bit integer even when its source C# type is int. Validate the range before narrowing input. C# structs such as Vector2 are values: assign a modified property copy back. See math for inverse transforms under scale.

If Call/Get/Set fails unexpectedly, check the build, attached script instance, name cache and actual VariantType. Prefer direct C# access when types are known so the compiler can catch mistakes before runtime.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.