diff --git a/Assets/Fungus/Scripts/Editor/LuaScriptedImporter.cs b/Assets/Fungus/Scripts/Editor/LuaScriptedImporter.cs new file mode 100644 index 00000000..b21a7a61 --- /dev/null +++ b/Assets/Fungus/Scripts/Editor/LuaScriptedImporter.cs @@ -0,0 +1,17 @@ +using UnityEngine; +using UnityEditor.Experimental.AssetImporters; +using System.IO; + +namespace Fungus.EditorUtils +{ + [ScriptedImporter(1, "lua")] + public class LuaScriptedImporter : ScriptedImporter + { + public override void OnImportAsset(AssetImportContext ctx) + { + TextAsset lua = new TextAsset(File.ReadAllText(ctx.assetPath)); + ctx.AddObjectToAsset("main", lua); + ctx.SetMainObject(lua); + } + } +} \ No newline at end of file