Getting if an Event Instance is paused

I want to check if an EventInstance object is paused. I’ve seen that I need to use the
EventObject.getPaused(), but I need to send an out parameter and I’m not familiar with them.
What am I supposed to do?

                bool aux_BoardMusic = SoundManager.instance.Music_Board.getPaused();
                if (aux_BoardMusic)
                {
                    SoundManager.instance.Music_Board.setPaused(false);
                }

The “out” only indicates the variable (output) on which the get value will be written.
So I think the right syntax should rather be something like:

SoundManager.instance.Music_Board.getPaused(aux_BoardMusic);

I’m not a Unity nor a C# user, though. There could be some subtleties about variable declaration and type that I’m not aware of…

You can either use a previously declared variable:

bool isPaused;
RESULT r = SoundManager.instance.Music_Board.getPaused(out isPaused);
if(r == RESULT.OK)
    Debug.Log("IsPaused: " + isPaused);

Or even (since recently) declare it during the call itself:

RESULT r = SoundManager.instance.Music_Board.getPaused(out bool isPaused);

1 Like