|
|
@ -2,13 +2,16 @@ |
|
|
|
using UnityEditor.Experimental.AssetImporters; |
|
|
|
using UnityEditor.Experimental.AssetImporters; |
|
|
|
using System.IO; |
|
|
|
using System.IO; |
|
|
|
|
|
|
|
|
|
|
|
[ScriptedImporter(1, "lua")] |
|
|
|
namespace Fungus.EditorUtils |
|
|
|
public class LuaScriptedImporter : ScriptedImporter |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
[ScriptedImporter(1, "lua")] |
|
|
|
|
|
|
|
public class LuaScriptedImporter : ScriptedImporter |
|
|
|
|
|
|
|
{ |
|
|
|
public override void OnImportAsset(AssetImportContext ctx) |
|
|
|
public override void OnImportAsset(AssetImportContext ctx) |
|
|
|
{ |
|
|
|
{ |
|
|
|
TextAsset lua = new TextAsset(File.ReadAllText(ctx.assetPath)); |
|
|
|
TextAsset lua = new TextAsset(File.ReadAllText(ctx.assetPath)); |
|
|
|
ctx.AddObjectToAsset("main", lua); |
|
|
|
ctx.AddObjectToAsset("main", lua); |
|
|
|
ctx.SetMainObject(lua); |
|
|
|
ctx.SetMainObject(lua); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |