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); } }
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); } }
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); }