update
This commit is contained in:
29
Packages/app.rive.rive-unity/Runtime/AudioOutOfBandAsset.cs
Normal file
29
Packages/app.rive.rive-unity/Runtime/AudioOutOfBandAsset.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Rive
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an out-of-band Rive font asset.
|
||||
/// </summary>
|
||||
public class AudioOutOfBandAsset : OutOfBandAsset
|
||||
{
|
||||
protected override IntPtr LoadNative(byte[] data)
|
||||
{
|
||||
return loadAudioSource(data, (nuint)data.Length);
|
||||
}
|
||||
|
||||
protected override void UnloadNative(IntPtr nativePtr)
|
||||
{
|
||||
unrefAudioSource(nativePtr);
|
||||
}
|
||||
|
||||
#region Native Methods
|
||||
[DllImport(NativeLibrary.name)]
|
||||
private static extern IntPtr loadAudioSource(byte[] bytes, nuint byteCount);
|
||||
|
||||
[DllImport(NativeLibrary.name)]
|
||||
private static extern void unrefAudioSource(IntPtr audioSource);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user