26 lines
606 B
C#
26 lines
606 B
C#
|
|
#if UNITY_2018_1_OR_NEWER
|
|||
|
|
|
|||
|
|
using UnityEngine;
|
|||
|
|
#if UNITY_2020_2_OR_NEWER
|
|||
|
|
using UnityEditor.AssetImporters;
|
|||
|
|
#else
|
|||
|
|
using UnityEditor.Experimental.AssetImporters;
|
|||
|
|
#endif
|
|||
|
|
using System.IO;
|
|||
|
|
|
|||
|
|
namespace WeChatWASM.MDV
|
|||
|
|
{
|
|||
|
|
[ScriptedImporter( 1, "markdown" )]
|
|||
|
|
public class MarkdownAssetImporter : ScriptedImporter
|
|||
|
|
{
|
|||
|
|
public override void OnImportAsset( AssetImportContext ctx )
|
|||
|
|
{
|
|||
|
|
var md = new TextAsset( File.ReadAllText( ctx.assetPath ) );
|
|||
|
|
ctx.AddObjectToAsset( "main", md );
|
|||
|
|
ctx.SetMainObject( md );
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#endif
|