17 lines
490 B
C#
17 lines
490 B
C#
using System.IO;
|
|
using UnityEditor;
|
|
using UnityEditor.AssetImporters;
|
|
using UnityEditor.Experimental.AssetImporters;
|
|
using UnityEngine;
|
|
|
|
[ScriptedImporter(1, "tsv")]
|
|
public class TsvImporter : ScriptedImporter
|
|
{
|
|
public override void OnImportAsset(AssetImportContext ctx)
|
|
{
|
|
var textAsset = new TextAsset(File.ReadAllText(ctx.assetPath));
|
|
ctx.AddObjectToAsset(Path.GetFileNameWithoutExtension(ctx.assetPath), textAsset);
|
|
ctx.SetMainObject(textAsset);
|
|
}
|
|
}
|