uLua v2.2.0
A Lua Modding Framework for Unity.
|
A script loader to load scripts from assets in Unity from within the Lua context. Scripts will be loaded from a subdirectory of Assets/Resources. More...
Public Member Functions | |
ScriptLoader (string AssetsPath) | |
Initializes a new instance of the uLua.ScriptLoader class. More... | |
override object | LoadFile (string file, Table globalContext) |
Opens a file for reading the script code. It can return either a string, a byte[] or a Stream. If a byte[] is returned, the content is assumed to be a serialized (dumped) bytecode. If it's a string, it's assumed to be either a script or the output of a string.dump call. If a Stream, autodetection takes place. More... | |
override bool | ScriptFileExists (string file) |
Checks if a given file exists. More... | |
A script loader to load scripts from assets in Unity from within the Lua context. Scripts will be loaded from a subdirectory of Assets/Resources.
This class is used by the loadfile and require functions in Lua.
|
inline |
Initializes a new instance of the uLua.ScriptLoader class.
AssetsPath | The path, relative to Assets/Resources. For example if your scripts are stored under Assets/Resources/Scripts/, you should pass the value "Scripts/". |
|
inline |
Opens a file for reading the script code. It can return either a string, a byte[] or a Stream. If a byte[] is returned, the content is assumed to be a serialized (dumped) bytecode. If it's a string, it's assumed to be either a script or the output of a string.dump call. If a Stream, autodetection takes place.
file | The file. |
globalContext | The global context. |
System.Exception | UnityAssetsScriptLoader.LoadFile : Cannot load + file |
|
inline |
Checks if a given file exists.
file | The file. |