예제 #1
0
        public void Reload()
        {
            if (this.Ammo != this.MagazineSize && this.Reloading != true)
            {
                Sound sound = SoundHolder.GetInstance().Get(SoundIdentifier.Reload);
                sound.Volume = SoundVolume.GetInstance().GetVolume();
                sound.Play();

                this.ChangeAmmo(-this.Ammo);
                this.ReloadTimer.Restart();
                this.Reloading = true;
            }
        }
예제 #2
0
        public void Visit(Component element)
        {
            Button temp = (Button)element;

            if (temp.CheckText() == "<")
            {
                SoundVolume.GetInstance().ChangeVolume(-5);
                OurLogger.Log("Lowering volume");
            }
            else if (temp.CheckText() == ">")
            {
                SoundVolume.GetInstance().ChangeVolume(5);
                OurLogger.Log("Increasing volume");
            }
        }
예제 #3
0
 public void Accept(IVisitor visitor)
 {
     if (this.ChangeTimer.ElapsedTime.AsMilliseconds() > 200)
     {
         this.ChangeTimer.Restart();
         Button textCheck = (Button)children[selectedChild];
         if (textCheck.CheckText() == "Settings")
         {
             //OurLogger.Log("Testing visit");
             visitor.Visit(temp[tempSelected]);
         }
         if (5 <= tempSelected && tempSelected <= 6)
         {
             CompositeUI tempComposite = (CompositeUI)temp[8];
             Button      volumeText    = (Button)tempComposite.children[0];
             volumeText.SetText(SoundVolume.GetInstance().GetVolume().ToString());
         }
     }
 }