コード例 #1
0
        public void PlayBackgroundMusic(string filename, bool loop = false)
        {
            if (null == filename)
            {
                return;
            }

            SharedMusic.Open(FullPath(filename), filename.GetHashCode());
            SharedMusic.Play(loop);
        }
コード例 #2
0
        /**
         * @brief Play background music
         * @param pszFilePath The path of the background music file,or the FileName of T_SoundResInfo
         * @param bLoop Whether the background music loop or not
         */

        public void PlayBackgroundMusic(string pszFilePath, bool bLoop)
        {
            if (null == pszFilePath)
            {
                return;
            }

            SharedMusic.Open(FullPath(pszFilePath), pszFilePath.GetHashCode());
            SharedMusic.Play(bLoop);
        }