using System; using Rive.Utils; using UnityEngine; namespace Rive { /// /// Represents the type of an embedded asset in a Rive asset. /// public enum EmbeddedAssetType : ushort { Unknown = 0, Image = 105, Font = 141, Audio = 406, Script = 529 } /// /// Represents information about inband/out of band asset (OOB) that is embedded/referenced in a Rive asset. /// [Serializable] public class EmbeddedAssetData { [SerializeField] private EmbeddedAssetType m_AssetType; [SerializeField] private uint m_Id; [SerializeField] private string m_Name; [SerializeField] private uint m_AssetSizeInBytes; [SerializeField] private OutOfBandAsset m_OutOfBandAsset; /// /// The type of the embedded asset. /// public EmbeddedAssetType AssetType { get { return m_AssetType; } } /// /// The unique identifier of the embedded asset. /// public uint Id { get { return m_Id; } } /// /// The name of the embedded asset. /// public string Name { get { return m_Name; } } /// /// The size of the bytes embedded in the asset. If the asset is only referenced (not embedded), this will be 0. /// public uint InBandBytesSize { get { return m_AssetSizeInBytes; } } /// /// The out of band asset that is referenced by this embedded asset. /// public OutOfBandAsset OutOfBandAsset { get { return m_OutOfBandAsset; } internal set { m_OutOfBandAsset = value; } } /// /// Creates a new EmbeddedAssetData instance. /// /// The type of the embedded asset. /// The unique identifier of the embedded asset. /// The name of the embedded asset. /// The number of bytes in the embedded asset. public EmbeddedAssetData(EmbeddedAssetType assetType, uint id, string name, uint assetSizeInBytes) { m_AssetType = assetType; m_Id = id; m_Name = name; m_AssetSizeInBytes = assetSizeInBytes; } } }