Added lua exporting
This commit is contained in:
17
Editor/LuaImporter.cs
Normal file
17
Editor/LuaImporter.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using UnityEngine;
|
||||
using System.IO;
|
||||
using UnityEditor.AssetImporters;
|
||||
|
||||
namespace SplashEdit.EditorCode
|
||||
{
|
||||
[ScriptedImporter(1, "lua")]
|
||||
class LuaImporter : ScriptedImporter
|
||||
{
|
||||
public override void OnImportAsset(AssetImportContext ctx)
|
||||
{
|
||||
var asset = new TextAsset(File.ReadAllText(ctx.assetPath));
|
||||
ctx.AddObjectToAsset("Text", asset);
|
||||
ctx.SetMainObject(asset);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user