Browse Source

Encapsulated scripted importer in Fungus.EditorUtils namespace

master
Matthew Barnes 5 years ago
parent
commit
219c10b464
  1. 7
      Assets/Fungus/Scripts/Editor/LuaScriptedImporter.cs

7
Assets/Fungus/Scripts/Editor/LuaScriptedImporter.cs

@ -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);
} }
}
} }
Loading…
Cancel
Save