예제 #1
0
 public void ClearPlayerPickups()
 {
     for (int i = player.ownedItems.Count - 1; i >= 0; i--)
     {
         ItemBase item = player.ownedItems[i];
         item.ClearEffects();
         player.ownedItems.Remove(item);
         Destroy(item);
     }
 }
예제 #2
0
    void Update()
    {
        for (int i = ownedItems.Count - 1; i >= 0; i--)
        {
            ItemBase item = ownedItems[i];

            if (item.State == ItemBase.ItemState.Using)
            {
                item.OnUsing();
            }
            else if (item.State == ItemBase.ItemState.Consumed && item.CheckIfFinished())
            {
                item.ClearEffects();
                ownedItems.Remove(item);
                Destroy(item);
            }
            else
            {
                item.UpdateEffects();
            }
        }
    }