void LoadToWarehouse() { if (BeltActCall.GoodsOnBelt != null) { ObjectActCall.IsWorking = true; if (GoodsValueCall.CheckMovingState(int.Parse(BeltActCall.GoodsOnBelt.name)) == 0) { SalesValueCall.UpdateItemCount(CompanyManagerCall.PlayerCompanyName, GoodsValueCall.FindGoodsName(BeltActCall.GoodsOnBelt)); GoodsValueCall.ChangeInMapState(int.Parse(BeltActCall.GoodsOnBelt.name), false, null); Destroy(BeltActCall.GoodsOnBelt); BeltActCall.GoodsOnBelt = null; } } else { ObjectActCall.IsWorking = false; } }
public GameObject CreateGoods(string name) { int ID = 0; if ((ID = GoodsValueCall.FindGoodsID(name, false)) == -1) { Debug.Log("There is no " + name + " in Warehouse"); return(null); } foreach (var tmp in GoodsRecipeCall.RecipeArray) { GameObject newGoods = GameObject.Instantiate(GoodsPrefab); GameObject GoodsStruct = GameObject.Instantiate(Resources.Load <GameObject>("GameSystem/Goods/Object/" + name), newGoods.transform); GoodsStruct.name = name; newGoods.transform.SetParent(transform); newGoods.transform.name = ID.ToString(); GoodsValueCall.ChangeInMapState(ID, true, newGoods); return(newGoods); } Debug.Log("There is no " + name); return(null); }