Table of Contents

Interface ILuaFile

Namespace
Cobilas.GodotEngine.GDLua.Interfaces
Assembly
com.cobilas.godot.lua.dll

Defines operations for interacting with Lua files and their contents.

public interface ILuaFile

Remarks

Provides methods to read, write, and invoke elements within Lua script files.

Methods

GetField(string)

Retrieves a field from the Lua file by its path.

LuaField GetField(string pathField)

Parameters

pathField string

The path to the field in the Lua file.

Returns

LuaField

A LuaField containing the field data.

InvokeFunction(string, params object[])

Invokes a function defined in the Lua file.

object[] InvokeFunction(string methodName, params object[] args)

Parameters

methodName string

The name of the function to invoke.

args object[]

The arguments to pass to the function.

Returns

object[]

An array of objects containing the function's return values.

LuaTableToObject<T>(string)

Converts a Lua table to an object of the specified type.

LuaField LuaTableToObject<T>(string pathField)

Parameters

pathField string

The path to the Lua table in the file.

Returns

LuaField

A LuaField containing the converted table data.

Type Parameters

T

The target type to convert the Lua table to.

LuaTableToObject<T>(string, ref T)

Converts a Lua table to an object and assigns it to the provided reference.

void LuaTableToObject<T>(string pathField, ref T value)

Parameters

pathField string

The path to the Lua table in the file.

value T

The reference variable to assign the converted table data to.

Type Parameters

T

The type of the object to assign.

SetField(string, object)

Sets the value of a field in the Lua file.

void SetField(string pathField, object value)

Parameters

pathField string

The path to the field in the Lua file.

value object

The value to assign to the field.