IAutoResetWaitable

The return value of the SetEffect() API

NameSpace
Accessibility

Ami.BroAudio

public

Public Methods

Method
Return
Parameters
Description

Until

Func<bool> condition

Wait until the given condition is met

While

Func<bool> condition

Wait while the given condition is true

ForSeconds

float seconds

Wait by the given time

🔔This can be used as a yield return in Coroutine, for example:

private bool _isUnderWater = false;

public void EnterWater(bool isEnter)
{
    _isUnderWater = isEnter;
    if(isEnter)
    {
        StartCoroutine(SetUnderWaterEffect());
    }
}

private IEnumerator SetUnderWaterEffect()
{
    yield return BroAudio.SetEffect(Effect.LowPass())
                        .WaitWhile(() => _isUnderWater = true);
}

Last updated