Hi all,
i have some question about the lifecycle of an event. I’m using FMOD integrated in unity and i’m writing in C#.
1-I wanted to stop an event when it has finished playing. I don’t really understand how i can manage a sound that plays a sound in a loop. I want to command my event to “finish what you are playing and exit the loop”, but i can’t really figure out how i can do this.
2-I thought i should use the “getPlaybackState()” to debug and solve my problem, but when i print the playBackState of my event while playing i always get “STOPPED”. From what i’ve seen in documentation, “STOPPED” is when an event is not playng, but i can ear the sound of the event, and it’s why i really think i’m missing something.
The playback state is “STOPPED” also for an event that is playing a sound that is not looping.
My code is:
void Start ()
{
eventInst = FMOD_StudioSystem.instance.GetEvent (asset);
eventInst.set3DAttributes (FMOD.Studio.UnityUtil.to3DAttributes (gameObject));
eventInst.getPlaybackState (out s);
eventInst.start();
}
void Update(){
Debug.Log(s);
}
Anybody has any solution, suggestion or documentation to help me?
Thanks,
Simone