Example #1
0
 void Awake()
 {
     openAnim         = GetComponent <Animator>();
     openAnim.enabled = false;
     itemLoot         = GetComponent <ItemLoot>();
     chestState       = ChestState.closed;
 }
Example #2
0
 //---------------------------------------------------------------
 void OnTriggerEnter2D(Collider2D col)
 {
     if (col.gameObject.GetComponent <GoldCoin>())
     {
         int goldCoinVal = col.GetComponent <GoldCoin>().GetGoldCoinValue();
         inventory.AddCoin(goldCoinVal);
         col.GetComponent <GoldCoin>().CoinDestroy();
     }
     else if (col.GetComponent <ItemLoot>())
     {
         ItemLoot droppedLoot = col.GetComponent <ItemLoot>();
         Item     itemInLoot  = droppedLoot.GetDroppedItem();
         rewardToObtain.AddToUltimateReward(itemInLoot);
         droppedLoot.ItemLootDestroyed();
     }
 }
Example #3
0
 public void AddItemLoot(ItemLoot ItemLoot)
 {
     lock (this.ItemLoot)
         this.ItemLoot.Add(ItemLoot);
 }