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
pathFieldstringThe path to the field in the Lua file.
Returns
InvokeFunction(string, params object[])
Invokes a function defined in the Lua file.
object[] InvokeFunction(string methodName, params object[] args)
Parameters
methodNamestringThe name of the function to invoke.
argsobject[]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
pathFieldstringThe path to the Lua table in the file.
Returns
Type Parameters
TThe 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
pathFieldstringThe path to the Lua table in the file.
valueTThe reference variable to assign the converted table data to.
Type Parameters
TThe 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)