Beispiel #1
0
		public override void Initialize(InitializeParameters p)
		{
			base.Initialize(p);

            GameEngine.Instance.PauseLevelSoundEffects += HandleSystemPause;
            GameEngine.Instance.StopLevelSoundEffects += HandleSystemStop;

			PerfMon.Start("Other-Sfx");

			this.soundFile = (XSoundResource)this.FindGlobal(this.FileId);

			if (this.soundFile == null)
				throw new InvalidOperationException(string.Format("Sound effect resource with id '{0}' was not found", this.FileId));

			this.soundFile.CheckOutInstance(this);
		
			PerfMon.Stop("Other-Sfx");
        }
Beispiel #2
0
        public override void Initialize(InitializeParameters p)
        {
            base.Initialize(p);

            GameEngine.Instance.PauseLevelSoundEffects += HandleSystemPause;
            GameEngine.Instance.StopLevelSoundEffects  += HandleSystemStop;

            PerfMon.Start("Other-Sfx");

            this.soundFile = (XSoundResource)this.FindGlobal(this.FileId);

            if (this.soundFile == null)
            {
                throw new InvalidOperationException(string.Format("Sound effect resource with id '{0}' was not found", this.FileId));
            }

            this.soundFile.CheckOutInstance(this);

            PerfMon.Stop("Other-Sfx");
        }