public int GetMaxCount() { //lz-2016.10.13 错误 #3912 空对象 if (null == rootNode || null == rootNode.ms) { return(1); } Pathea.Replicator replicator = GetReplicator(); if (null == replicator) { return(rootNode.ms.m_productItemCount); } //lz-2016.08.10 MaxProductCount材料最多可以支持造多少组Product,这里还要乘上这组Product的数量 int count = replicator.MaxProductCount(rootNode.ms.id) * rootNode.ms.m_productItemCount; int stackNum = ItemAsset.ItemProto.GetStackMax(rootNode.GetItemID()); //lz-2016.08.03 蒲及说如果合成的物品堆叠数为1限制最大数量为一个常数个 if (stackNum == 1) { count = Mathf.Min(count, ColonyConst.FACTORY_COMPOUND_GRID_COUNT); } else { //lz-2016.08.03 堆叠数大于1的限制最多制造数为 一个常数个*堆叠数 count = Mathf.Min(count, ColonyConst.FACTORY_COMPOUND_GRID_COUNT * stackNum); } return(0 == count ? 1 : count); }
void _setCompundInfo(int id) { UIGraphNode rootNode = FactoryReplicator.m_MiddleContent.graphCtrl.rootNode; if (rootNode.mCtrl.mContentSprites[0].gameObject.activeSelf) { int m_id = rootNode.GetItemID(); ItemProto item = ItemProto.GetItemData(m_id); m_RightGridItem.SetCotent(item.icon); m_RightGridItem.SetToolTipInfo(ListItemType.mItem, m_id); } else { m_RightGridItem.SetCotent(rootNode.mCtrl.mContentTexture.mainTexture); m_RightGridItem.SetToolTipInfo(ListItemType.mItem, rootNode.GetItemID()); } FactoryReplicator.m_RightContent.countInput.text = rootNode.ms.m_productItemCount.ToString(); }
private void SetBottomInfo() { UIGraphNode rootNode = mGraphCtrl.rootNode; if (rootNode.mCtrl.mContentSprites[0].gameObject.activeSelf) { int m_id = rootNode.GetItemID(); ItemProto item = ItemProto.GetItemData(m_id); mButtomGrid.SetCotent(item.icon); mButtomGrid.SetToolTipInfo(ListItemType.mItem, m_id); } else { mButtomGrid.SetCotent(rootNode.mCtrl.mContentTexture.mainTexture); mButtomGrid.SetToolTipInfo(ListItemType.mItem, rootNode.GetItemID()); } mBottomCountLb.text = rootNode.ms.m_productItemCount.ToString(); }