logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class UnityAudioPlayerSourceState

    Runtime metadata tracked per pooled UnityEngine.AudioSource so the audio player can make priority-based replacement decisions without trying to infer everything from the UnityEngine.AudioSource alone.
    One instance is kept per slot, parallel to the service's AudioSource[] pool.

    Inheritance
    object
    UnityAudioPlayerSourceState
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.AudioPlayer.Infrastructure.Services
    Assembly: Serenity.UnityAudioPlayer.Infrastructure.dll
    Syntax
    public class UnityAudioPlayerSourceState

    Constructors

    UnityAudioPlayerSourceState(AudioSource)

    Initializes a new state bound to the given source.

    Declaration
    public UnityAudioPlayerSourceState(AudioSource source)
    Parameters
    Type Name Description
    AudioSource source

    The pooled audio source this state describes.

    Fields

    CanBeReplaced

    Declaration
    public bool CanBeReplaced
    Field Value
    Type Description
    bool

    Whether the currently playing sound may be reassigned to a higher-priority sound.

    ClipId

    Declaration
    public string ClipId
    Field Value
    Type Description
    string

    Id of the clip currently assigned to the source (for logging/diagnostics).

    Priority

    Declaration
    public int Priority
    Field Value
    Type Description
    int

    Serenity priority of the currently playing sound. Higher = more important.

    PriorityPolicy

    Declaration
    public AudioPriorityPolicy PriorityPolicy
    Field Value
    Type Description
    AudioPriorityPolicy

    Policy of the currently playing sound (kept for diagnostics/future use).

    Sequence

    Declaration
    public long Sequence
    Field Value
    Type Description
    long

    Monotonically increasing start order used to break priority ties. A lower value means the sound started earlier (is older).

    Source

    Declaration
    public AudioSource Source
    Field Value
    Type Description
    AudioSource

    The pooled audio source this state describes.

    In this article
    © 2026 Serenity. All Rights Reserved