Search Results for

    Show / Hide Table of Contents

    Class MusicManager

    Manages the music playlists for the game. Handles the initialization, playback, and shuffling of music tracks based on the active scene.

    Inheritance
    object
    MusicManager
    Namespace: Music
    Assembly: cs.temp.dll.dll
    Syntax
    public class MusicManager : MonoBehaviour

    Fields

    Instance

    A singleton instance of the MusicManager class. Ensures only one instance of the MusicManager exists at a time.

    Declaration
    public static MusicManager Instance
    Field Value
    Type Description
    MusicManager

    playlists

    A list of playlists available in the game.

    Declaration
    public List<Playlist> playlists
    Field Value
    Type Description
    List<><Playlist>

    songPrefab

    The prefab used to create audio sources for playing songs.

    Declaration
    public GameObject songPrefab
    Field Value
    Type Description
    GameObject

    Methods

    GetActiveSceneNotTitleScreen()

    Gets the name of the currently active scene, excluding the "Title Screen".

    Declaration
    public static string GetActiveSceneNotTitleScreen()
    Returns
    Type Description
    string

    The name of the active scene, or "Title Screen" if no other scene is active.

    StartPlaylist()

    Starts the music playlist for the current active scene.

    Declaration
    public void StartPlaylist()

    StartPlaylist(string)

    Starts the music playlist for a specific scene.

    Declaration
    public void StartPlaylist(string scene)
    Parameters
    Type Name Description
    string scene

    The name of the scene for which to start the playlist.

    In This Article
    Back to top Example Unity documentation footer