少年修仙传客户端代码仓库
client_Wu Xijin
2018-10-23 a974a2621a6dcb90b8fe52b23d075814873c0960
System/Strengthening/GodBeastSlidingList.cs
@@ -42,6 +42,7 @@
        private List<GodBeastBagClass> GodBeastBagList = new List<GodBeastBagClass>();
        private List<int> DeleteIndexList = new List<int>();
        private int Quality = 10;
        private int GetJumpIndex = 0;//获取跳转下标
        PlayerPackModel _playerPack;
        PlayerPackModel playerPack { get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); } }
        GodBeastModel godBeastModel { get { return ModelCenter.Instance.GetModel<GodBeastModel>(); } }
@@ -385,7 +386,7 @@
            int childCode = 0;
            for (childCode = 0; childCode < cell.transform.childCount; childCode++)
            {
                int ItemPos = childCode + 1;
                GodBeastChildNodes GodBeastChildNodes = cell.transform.GetChild(childCode).GetComponent<GodBeastChildNodes>();
                int cellCount = (cell.transform.childCount) * gridlineIndex + (childCode + 1);
                if (cellCount > 100)
@@ -401,7 +402,7 @@
                GodBeastChildNodes.ButtonDown.RemoveAllListeners();
                if (cellCount - 1 < GodBeastBagList.Count)
                {
                    int index = cellCount - 1;
                    int index = cellCount - 1;
                    GodBeastChildNodes.ItemCell.gameObject.SetActive(true);
                    GodBeastBagClass godBeastBagClass = GodBeastBagList[index];
                    ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptDogzItem, godBeastBagClass.Index);
@@ -409,13 +410,22 @@
                    {
                        return;
                    }
                    if (godBeastModel.Absorption_Dic.ContainsKey(godBeastBagClass.Index))
                    {
                        GodBeastChildNodes.ChoosenImg.SetActive(true);
                        if (itemModel.EquipPlace <= 0 && itemModel.itemInfo.ItemCount>1)
                        if (itemModel.EquipPlace <= 0 && itemModel.itemInfo.ItemCount > 1)
                        {
                            GodBeastChildNodes.NumberNow.gameObject.SetActive(true);
                            GodBeastChildNodes.NumberNow.text = godBeastModel.Absorption_Dic[godBeastBagClass.Index].ToString();
                            GodBeastChildNodes.NumberNow.text = godBeastModel.Absorption_Dic[godBeastBagClass.Index].ToString() + "/" + itemModel.itemInfo.ItemCount;
                        }
                    }
                    else
                    {
                        if (itemModel.EquipPlace <= 0 && itemModel.itemInfo.ItemCount > 1)
                        {
                            GodBeastChildNodes.NumberNow.gameObject.SetActive(true);
                            GodBeastChildNodes.NumberNow.text = itemModel.itemInfo.ItemCount.ToString();
                        }
                    }
                    GodBeastChildNodes.GetGodBeastIndex(godBeastBagClass.Index);
@@ -451,16 +461,33 @@
                            {
                                godBeastModel.Crystal_ItemModel = itemModel;
                                godBeastModel.ItemInde = godBeastBagClass.Index;
                                GetJumpIndex = godBeastBagClass.Index;
                                m_ScrollerController.JumpIndex(JumpIndex());
                                godBeastModel.ItemPos = ItemPos;
                                WindowCenter.Instance.Open<CrystalSelectionWin>();
                            }
                            }
                        }
                        godBeastModel.AbsorbEventUpdate();
                    });
                }
            }
        }
        private int JumpIndex()
        {
            int jumpIndex = 0;
            for (int i = 0; i < GodBeastBagList.Count; i++)
            {
                if (GodBeastBagList[i].Index == GetJumpIndex)
                {
                    jumpIndex= Mathf.CeilToInt((float)(i+1) / 3);
                }
            }
            if (jumpIndex >= 1)
            {
                jumpIndex -= 1;
            }
            return jumpIndex;
        }
    }
}