예제 #1
0
 void RecieveShopItem(IDroppableData dropItem)
 {
     if (_model.Item == null)
     {
         App.Instance.FarmModel.ShopInventory.Items[dropItem.Data.Id].Spend();
         if (OnFarmItemRecieved != null)
         {
             ShopItem shopItem = dropItem.Data as ShopItem;
             OnFarmItemRecieved.Invoke(shopItem.FarmItemId);
         }
     }
     OnRecieved();
 }
예제 #2
0
        void RecieveProduct(IDroppableData dropItem)
        {
            if (_model.Item == null)
            {
                return;
            }

            if (OnProductRecieved != null)
            {
                OnProductRecieved.Invoke(dropItem.Data as Product);
            }

            OnRecieved();
        }
예제 #3
0
        public void OnDroppedObject(IDroppableData dropItem)
        {
            if (dropItem == null || dropItem.Data == null)
            {
                return;
            }

            if (dropItem.Data.Type == UserRepository.SHOP)
            {
                RecieveShopItem(dropItem);
            }
            else if (dropItem.Data.Type == UserRepository.PRODUCTS)
            {
                RecieveProduct(dropItem);
            }
        }