Ejemplo n.º 1
0
 public void RemoveBuyItem(ItemObject itemObj, int count)
 {
     if (itemObj.stackCount < count)
     {
         Debug.LogError("Remove num is big than item you have.");
     }
     else if (itemObj.GetCount() > count)
     {
         itemObj.DecreaseStackCount(count);
     }
     else
     {
         mBuyItemList.Remove(itemObj);
     }
 }
Ejemplo n.º 2
0
    public void RemoveRepurchase(ItemObject itemObj, int count)
    {
        if (itemObj.GetCount() < count)
        {
            Debug.LogError("Remove num is big than item you have.");
            return;
        }

        if (itemObj.GetCount() > count)
        {
            itemObj.DecreaseStackCount(count);
        }
        else
        {
            mRepurchaseList.Remove(itemObj);
        }
    }
Ejemplo n.º 3
0
    private FarmPlantLogic _plant(ItemObject io, Vector3 pos, int index)
    {
        //PlantInfo info = PlantInfo.GetPlantInfoByItemId(io.protoId);
//		Vector3 new_pos = new Vector3(pos.x, pos.y, pos.z)
        DragArticleAgent dragItem = DragArticleAgent.PutItemByProroId(io.protoId, pos, Quaternion.identity);

        //FarmManager.Instance.CreatePlant(dragItem.itemInstanceId, info.mTypeID, pos);
        io.DecreaseStackCount(1);
        if (io.GetCount() <= 0)
        {
            ItemMgr.Instance.DestroyItem(io.instanceId);

            SetPlantSeed(index, null);
        }

        // Event
        ExcuteEvent(CSConst.eetFarm_OnPlant, index);
        return(dragItem.itemLogic as FarmPlantLogic);
    }