Editor: Create LunyScript Assets
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:
- Empty Lua Script
- Empty LunyScript (C# + Lua)

Choose Empty LunyScript to create a companion pair of C# and Lua script files.
Created Assets
After entering the asset name in Project view, both a C# and a Lua script asset will appear:

Usage Example
Add the C# component to a GameObject. The companion Lua script will automatically be assigned:

If you run this scene, the LunyShellExplosion.lua will execute and log a message:

This is done by the sample Start()
function in the Lua script:
function script.Start()
print("Hello, " .. script.name .. ".lua on " .. tostring(script.gameObject))
end