35 lines
971 B
C#
35 lines
971 B
C#
using FMOD.Studio;
|
|
using FMODUnity;
|
|
|
|
namespace AibisDream.Kit
|
|
{
|
|
public static class FModEx
|
|
{
|
|
public static bool IsPlaying(this EventInstance instance)
|
|
{
|
|
if (!instance.isValid()) return false;
|
|
|
|
instance.getPlaybackState(out var playbackState);
|
|
return playbackState == PLAYBACK_STATE.PLAYING;
|
|
}
|
|
|
|
public static PLAYBACK_STATE GetPlayBackState(this EventInstance instance)
|
|
{
|
|
instance.getPlaybackState(out var playbackState);
|
|
return playbackState;
|
|
}
|
|
|
|
public static EventDescription GetDescription(this EventInstance instance)
|
|
{
|
|
instance.getDescription(out var description);
|
|
return description;
|
|
}
|
|
|
|
public static bool IsEventExist(string eventPath)
|
|
{
|
|
var result = RuntimeManager.StudioSystem.getEvent(eventPath, out _);
|
|
|
|
return result == FMOD.RESULT.OK;
|
|
}
|
|
}
|
|
} |