BroAudio
Quick StartScripting APIAsset Store
  • Overview
    • Introduction
    • Getting Started
    • Compatibility
  • Core Features
    • Library Manager
      • Create The Library
      • Design The Sound
        • 🔊Volume
        • 🎚️Fading
        • 🔁Looping
        • 🎲Randomization
        • 💪Velocity
        • 🎛️Spatial & Mix
    • Audio Player
      • Music Player
      • Dominator Player
    • Playback Group
    • Audio Effect
    • No-Code Components
      • Sound Source
      • Sound Volume
      • Spectrum Analyzer
    • Addressables
    • Customization
  • Designs
    • Audio Mixer
  • Tools
    • Audio Clip Editor
    • Audio Effect Editor
    • Useful Attrubutes
  • Reference
    • Scripting API
      • Class
        • BroAudio
        • SoundSource
        • BroAdvice
      • Interface
        • IAudioPlayer
        • IMusicPlayer
        • IPlayerEffect
        • IAutoResetWaitable
        • IAudioSourceProxy
      • Struct
        • SoundID
        • Effect
        • Fading
      • Enums
        • BroAudioType
        • EffectType
        • StopMode
        • Transition
        • Ease
    • Unity API Integration
    • Audio Terminology
    • Technical Details
  • Others
    • Release Notes
    • Known Issues
      • Duplicate SoundID Issue
    • Roadmap
    • Support & Contact
Powered by GitBook
On this page
  1. Reference
  2. Scripting API
  3. Interface

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 11 months ago

WaitUntil
WaitWhile
WaitForSeconds