TwinTurbine/Assets/Proxima/Editor/PfxImporter.cs
2024-05-12 17:20:19 +02:00

22 lines
587 B
C#

using UnityEngine;
using UnityEditor.AssetImporters;
using System.IO;
#if !UNITY_2022_1_OR_NEWER
using UnityEditor.Experimental.AssetImporters;
#endif
namespace Proxima.Editor
{
[ScriptedImporter(1, "pfx")]
internal class PfxImporter : ScriptedImporter
{
public override void OnImportAsset(AssetImportContext ctx)
{
var asset = ScriptableObject.CreateInstance<PfxAsset>();
asset.Bytes = File.ReadAllBytes(ctx.assetPath);
ctx.AddObjectToAsset("main obj", asset);
ctx.SetMainObject(asset);
}
}
}