FMod
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user