コード例 #1
0
ファイル: MusicManager.cs プロジェクト: uchr/LD44
        /// <summary>
        /// Searches for the specified music player with a matching name.
        /// </summary>
        /// <returns>
        /// A reference to a music player, if found. Null reference otherwise.
        /// </returns>
        /// <remarks>
        /// <para>If multiple banks have music players with a matching name, primary music bank will be checked first.
        /// Within a bank, the first occurrence of found music player will be used.</para>
        /// </remarks>
        public static MusicPlayer GetMusicPlayer(string name)
        {
            if (shutdown)
            {
                return(null);
            }

            // Check primary bank first
            MusicBank primaryBank = bankManager.PrimaryBank;

            if (primaryBank != null && primaryBank.ContainsAsset(name))
            {
                return(primaryBank.GetMusicPlayer(name));
            }

            // Check other banks
            for (int i = 0; i < bankManager.Banks.Count; i++)
            {
                MusicBank bank = bankManager.Banks[i];

                // Skip primary bank
                if (bank == primaryBank)
                {
                    continue;
                }

                if (bank.ContainsAsset(name))
                {
                    return(bank.GetMusicPlayer(name));
                }
            }

            return(null);
        }
コード例 #2
0
ファイル: MusicManager.cs プロジェクト: uchr/LD44
        /// <summary>
        /// Registers new music bank.
        /// </summary>
        /// <param name="bank">A reference to a music bank to register.</param>
        /// <returns>
        /// True, if music bank was succesfully registered. False otherwise.
        /// </returns>
        public static bool RegisterBank(MusicBank bank)
        {
            if (shutdown)
            {
                return(false);
            }

            return(bankManager.RegisterBank(bank));
        }
コード例 #3
0
ファイル: MusicBankInspector.cs プロジェクト: uchr/LD44
 public void OnEnable()
 {
     bank = target as MusicBank;
 }
コード例 #4
0
ファイル: MusicPlayer.cs プロジェクト: uchr/LD44
 internal MusicPlayer(MusicBank bank_, string name_)
 {
     bank = bank_;
     name = name_;
 }
コード例 #5
0
ファイル: Playlist.cs プロジェクト: uchr/LD44
 internal Playlist(MusicBank bank_, string name_)
 {
     bank = bank_;
     name = name_;
 }