コード例 #1
0
ファイル: Game.cs プロジェクト: jhollingworth/Mortal-Songbat
        protected override void BeginRun()
        {
            base.BeginRun();

            Sounds = SoundManager.Instance.RegisterSoundGroup("Sounds", @"data/sounds/Wave Bank.xwb", @"data/sounds/Sound Bank.xsb");

            //    start by showing the GarageGames splash screen
            var splashScreen = new GuiMainMenu() ;
            GUICanvas.Instance.SetContentControl(splashScreen);

            //var playGUI = new GuiPlay();
            //GUICanvas.Instance.SetContentControl(playGUI);

            //Instance.SceneLoader.Load(@"data\levels\levelData.txscene");
        }
コード例 #2
0
        /// <summary>
        /// Removes the sound group that was registered with the specified SoundBank path from the hash.
        /// </summary>
        /// <param name="path">The path that the SoundGroup was registered under. Either the common path name in the case of the single-string
        /// register, or the path to the SoundBank (with the .xsb extention) in the case of the two-string register.</param>
        public virtual void UnregisterSoundGroup(SoundGroup group)
        {
            // clear and remove the specified sound group from the hash
            if (_soundGroups.ContainsValue(group))
            {
                if (!group.SoundBank.IsDisposed)
                    group.SoundBank.Dispose();

                if (!group.WaveBank.IsDisposed)
                    group.WaveBank.Dispose();

                _soundGroups.Remove(group);
            }
        }
コード例 #3
0
        /// <summary>
        /// Create and register a SoundGroup based on the specified SoundBank and WaveBank paths.
        /// </summary>
        /// <param name="name">The name to register the sound bank with.</param>
        /// <param name="soundBankPath">The path to the .xsb file.</param>
        /// <param name="waveBankPath">The path to the .xWb file.</param>
        public virtual SoundGroup RegisterSoundGroup(string name, string waveBankPath, string soundBankPath)
        {
            if (!_soundGroups.Contains(name))
            {
                SoundGroup newGroup = new SoundGroup(soundBankPath, waveBankPath);

                if (newGroup != null && newGroup.SoundBank != null && newGroup.WaveBank != null)
                    _soundGroups.Add(name, newGroup);

                return newGroup;
            }

            return null;
        }