This commit is contained in:
2026-05-19 17:39:03 +07:00
parent bf0ebe447d
commit 5da832bb57
559 changed files with 69543 additions and 1 deletions

View File

@@ -0,0 +1,28 @@
using UnityEngine;
using UnityEditor.AssetImporters;
namespace Rive
{
internal static class ImageOobAssetExtensions
{
public const string PNG = "png";
public const string JPG = "jpg";
public const string JPEG = "jpeg";
public const string WEBP = "webp";
public static readonly string[] ImageExtensions = new[] { PNG, JPG, JPEG, WEBP };
}
[ScriptedImporter(2, new string[] { ImageOobAssetExtensions.WEBP }, new string[] { ImageOobAssetExtensions.PNG, ImageOobAssetExtensions.JPG, ImageOobAssetExtensions.JPEG, ImageOobAssetExtensions.WEBP })]
public class ImageAssetImporter : ScriptedImporter
{
public override void OnImportAsset(AssetImportContext ctx)
{
byte[] bytesToAssign = System.IO.File.ReadAllBytes(ctx.assetPath);
ImageOutOfBandAsset file = OutOfBandAsset.Create<ImageOutOfBandAsset>(bytesToAssign);
ctx.AddObjectToAsset("rive-image", file);
ctx.SetMainObject(file);
}
}
}