Lua: Dot vs Colon Syntax Explained
In Lua both dot . and colon : separate identifiers. But when to use which? Dot Syntax Nothing out of the ordinary: In fact, besides the missing semicolon ; this would be legal C# code. Colon Syntax So why is…
In Lua both dot . and colon : separate identifiers. But when to use which? Dot Syntax Nothing out of the ordinary: In fact, besides the missing semicolon ; this would be legal C# code. Colon Syntax So why is…
Use Case You need to create a LunyScript subclass with an associated Lua script. Create Asset Menu The Create Asset menu has been extended. Under the Scripting category you will find two new options: Choose Empty LunyScript to create a…
Use Case Your C# LunyScript subclass needs to expose Lua script values to other C# scripts. Lua Implementation Your Lua script defines a script.currentHealth value that you wish to make available in C#: C# Implementation You can implement a C#…
Use Case Your C# script needs to expose values to the Lua script before it even runs its Awake() function. C# Implementation The OnBeforeScriptAwake() method, when overridden in your LunyScript subclass, runs just before the script’s Awake() function. Use it…