Example #1
0
 void CheckMagicOrbCheckBox(CheckBox checkBox, Type magicType, List <MagicOrb> orbs)
 {
     if (checkBox.Checked)
     {
         MagicOrb orb = new MagicOrb(magicType);
         orbs.Add(orb);
     }
 }
Example #2
0
 public override void OnFixedUpdate()
 {
     if (C.isTransitioning)
         return;
     if (initDelay > 0)
     {
         if (stateCount > initDelay)
         {
             initDelay = 0;
             stateCount = 0;
         }
         return;
     }
     if (loaded)
     {
         if (!(Mathf.Abs(this.x - world.player.x) < distance*16 &&
             Mathf.Abs(this.y - world.player.y) < distance*16))
             stateCount = 0;
         if (stateCount > .5f)
         {
             MagicOrb a = new MagicOrb(this, world);
             a.SetTarget(world.player);
             a.SetPosition(this.GetPosition());
             world.addObject(a);
             a.MoveToFront();
             loaded = false;
             sprite.SetElementByName("Magic Turret/turret_magic_02");
             stateCount = 0;
         }
     }
     else
     {
         if (stateCount > interval)
         {
             sprite.SetElementByName("Magic Turret/turret_magic_01");
             loaded = true;
             stateCount = 0;
         }
     }
     base.OnFixedUpdate();
 }