예제 #1
0
        static void StartStand(HordeStand stand)
        {
            ActiveStand = stand;

            if (IsPlaying)
            {
                if (!string.IsNullOrWhiteSpace(stand.SFXStart))
                {
                    SoundHandler.PlaySound3D(new SoundDefinition(stand.SFXStart), stand.Position, 2500, 1.0f);
                }

                if (!string.IsNullOrWhiteSpace(stand.SFXStart))
                {
                    StandSFXLoop = SoundHandler.PlaySound3D(new SoundDefinition(stand.SFXLoop), stand.Position, 2500, 0.5f, true);
                }

                if (stand.Messages != null && stand.Messages.Length > 0)
                {
                    messageIndex = 0;
                    NextMessage();
                    if (stand.Messages.Length > 1 && stand.Duration > 0)
                    {
                        messageTimer.SetInterval(stand.Duration * TimeSpan.TicksPerSecond / (stand.Messages.Length - 1));
                        messageTimer.Start();
                    }
                }
            }
        }
예제 #2
0
        static void Endstand()
        {
            if (ActiveStand == null)
            {
                return;
            }

            if (StandSFXLoop != null)
            {
                SoundHandler.StopSound(StandSFXLoop);
            }

            var stand = ActiveStand;

            ActiveStand = null;
            if (IsPlaying)
            {
                if (!string.IsNullOrWhiteSpace(stand.SFXStart))
                {
                    SoundHandler.PlaySound3D(new SoundDefinition(stand.SFXStop), stand.Position);
                }
            }
            messageTimer.Stop();
        }