Beispiel #1
0
 // Update is called once per frame
 void Update()
 {
     if (im.GetAbilitySlot1())
     {
         if (ability_item != null)
         {
             ability_item.OnDestroy();
         }
         active_slot = 0;
         (AbilityItem item, int item_count) = ability_items.GetFirstOwnedItem(active_slot);
         ability_item = item;
         if (ability_item != null)
         {
             ability_item.Start();
         }
         UpdateSelectedSlotUI(active_slot);
     }
     else if (im.GetAbilitySlot2())
     {
         if (ability_item != null)
         {
             ability_item.OnDestroy();
         }
         active_slot = 1;
         (AbilityItem item, int item_count) = ability_items.GetFirstOwnedItem(active_slot);
         ability_item = item;
         if (ability_item != null)
         {
             ability_item.Start();
         }
         UpdateSelectedSlotUI(active_slot);
     }
     else if (im.GetAbilitySlot3())
     {
         if (ability_item != null)
         {
             ability_item.OnDestroy();
         }
         active_slot = 2;
         (AbilityItem item, int item_count) = ability_items.GetFirstOwnedItem(active_slot);
         ability_item = item;
         if (ability_item != null)
         {
             ability_item.Start();
         }
         UpdateSelectedSlotUI(active_slot);
     }
     else if (im.GetAbilitySlot4())
     {
         if (ability_item != null)
         {
             ability_item.OnDestroy();
         }
         active_slot = 3;
         (AbilityItem item, int item_count) = ability_items.GetFirstOwnedItem(active_slot);
         ability_item = item;
         if (ability_item != null)
         {
             ability_item.Start();
         }
         UpdateSelectedSlotUI(active_slot);
     }
     if (shared_item != null)
     {
         shared_item.Update();
     }
     if (ability_item != null)
     {
         ability_item.Update();
     }
 }