Current version 2.0.08.26

Documentation

Quick Start

Test the demonstration scene, create an AudioCue, and play it from a component or C# code.

This guide first verifies the complete included example. It then creates the smallest reusable AudioCue setup.

Open the demonstration scene

Open:

Assets/AudioCueToolkit/Samples/Demo/Scene/Demo.unity

Enter Play Mode and interact with the objects using the pointer. The scene demonstrates click and hover playback, one-shot interactions, animated playback events, attached footsteps, fixed-position sounds, and an interaction counter.

If the scene is pink, configure URP before judging the sample visuals. The audio runtime can still be used in another render pipeline.

Create an AudioCue

Use either method:

  1. Select Create AudioCue in Tools > AudioCue > Welcome.
  2. Use Assets > Create > Paper Lynx Studio > AudioCue > Audio Cue.

Select the new asset and drag one or more AudioClip assets into the Variants drop area.

For the first cue:

  1. Keep Selection Mode set to Random No Repeat.
  2. Select a variant in the list.
  3. In the Variant tab, set Start, End, Fade In, and Fade Out.
  4. Use Play to preview the selected range.
  5. In Playback, set Volume, Pitch Range, Delay, and Loop Mode.
  6. Leave the spatial override and equalizer disabled for a simple 2D sound.

Add the manager

Open Tools > AudioCue > Welcome and select Add AudioManager, or add:

Assets/AudioCueToolkit/Runtime/Prefabs/AudioManager.prefab

Keep exactly one enabled manager. The manager prefab persists between scenes by default.

Play with a component

  1. Add AudioCue > Audio Cue Player to a GameObject.
  2. Assign the AudioCue asset.
  3. Enable Play On Enable or call Play from project code or a UnityEvent.
  4. Enable Follow Transform for a moving positional sound.
  5. Use the Events tab to connect Started, Paused, Resumed, Completed, and Stopped callbacks.

Use PlayFromEvent for a persistent parameterless UnityEvent listener. UnityEvents can also call Pause, Resume, Stop, or StopImmediate.

Add a trigger volume

  1. Add a Collider to the same GameObject and enable Is Trigger.
  2. Add Audio Cue Trigger.
  3. Assign the AudioCuePlayer.
  4. Configure Layers and the optional tag filter.
  5. Enable Once Per Entry to play only when the first accepted collider enters.
  6. Enable Stop On Exit when playback should stop after the last accepted collider leaves.

Normal Unity trigger rules apply: both participants need Colliders and at least one participant needs a Rigidbody.

Add a pointer interaction

  1. Add a Collider to the interactive GameObject.
  2. Add Audio Cue Mouse Trigger.
  3. Assign the AudioCuePlayer.
  4. Enable Play On Hover, Play On Click, or both.
  5. Enable Play Only Once if the interaction must not retrigger during the component's lifetime.
  6. Assign Pointer Camera or tag the active scene camera as MainCamera.

The adapter raycasts from the active Input System pointer. Mouse, pen, and touchscreen primary presses are supported.

Play from code

using PaperLynxStudio.AudioCueToolkit;
using UnityEngine;

public sealed class AudioExample : MonoBehaviour
{
    [SerializeField] private AudioCue _cue;

    public void Play()
    {
        if (AudioManager.Instance == null)
            return;

        AudioHandle handle = AudioManager.Instance.Play(_cue);
        if (handle.IsValid)
            Debug.Log($"Audio started in state {handle.State}.");
    }
}

Play uses the manager position. Use a fixed position for a one-shot world sound:

AudioHandle handle = AudioManager.Instance.PlayAt(_cue, impactPoint);

Use a Transform for a moving sound:

AudioHandle handle = AudioManager.Instance.PlayAttached(_cue, movingTarget);

Keep the returned handle when individual control is required:

if (handle.IsValid)
    handle.Pause();

if (handle.State == AudioPlaybackState.Paused)
    handle.Resume();

handle.Stop(0.25f);

Continue with AudioCue Authoring for every asset setting and Runtime API for integration details.