Ejemplo n.º 1
0
    /// <summary>
    /// 点击添加宝宝
    /// </summary>
    void OnChoosePartnerClick()
    {
        NewPlayerGuidLogic.CloseWindow();
        FellowContainer container = GameManager.gameManager.PlayerDataPool.FellowContainer;

        if (container == null)
        {
            return;
        }

        List <Fellow> babylist = FellowTool.FellowCanBreedingFilter(container);

        //List<Fellow> babylist = FellowTool.FellowBabyFilter(container);

        if (babylist.Count <= 0)
        {
            GUIData.AddNotifyData("#{10330}");
            return;
        }

        m_FellowIndexBuffer = m_FellowIndex;

        m_PartnerChooseWindow.SetActive(true);
        ShowChooseBabyFellow(babylist);
    }
Ejemplo n.º 2
0
    private List <Data> GetDataListFellow_3()
    {
        List <Data> res = new List <Data>();

        FellowContainer container = GameManager.gameManager.PlayerDataPool.FellowContainer;

        if (container == null)
        {
            return(res);
        }

        List <Fellow> babylist = new List <Fellow>();
//        int nFellowCount = container.GetFellowCount();
        List <Fellow> fellowList = FellowTool.FellowSort(container);

        if (M_OPEN_TYPE == OPEN_TYPE.NORMAL)
        {
            for (int i = 0; i < fellowList.Count; ++i)
            {
                //有效槽位
                Fellow fellow = fellowList[i];
                if (fellow.IsValid())
                {
                    babylist.Add(fellow);
                }
            }
        }
        else if (M_OPEN_TYPE == OPEN_TYPE.PROPAGATE)
        {
            babylist = FellowTool.FellowCanBreedingFilter(container);
        }


        if (babylist.Count <= 0)
        {
            return(res);
        }

        for (int i = 0; i < babylist.Count; i++)
        {
            Data data = new Data();
            data.guid = babylist[i].Guid;
            res.Add(data);
        }
        return(res);
    }
Ejemplo n.º 3
0
    void UpdateChooseFellowInfo(bool forward)
    {
        FellowContainer container = GameManager.gameManager.PlayerDataPool.FellowContainer;

        if (container == null)
        {
            return;
        }

        List <Fellow> babylist = FellowTool.FellowCanBreedingFilter(container);

        if (babylist.Count <= 0)
        {
            return;
        }

        Fellow updatefellow = null;

        if (forward)
        {
            for (int i = (m_FellowIndexBuffer + 1) % babylist.Count; i < babylist.Count; i++)
            {
                Fellow fellow = babylist[i];
                if (false == fellow.IsValid())
                {
                    continue;
                }

                if (m_BabyFellowBuffer == null)
                {
                    updatefellow        = fellow;
                    m_FellowIndexBuffer = i;
                    break;
                }
                else
                {
                    if (fellow.Guid != m_BabyFellowBuffer.Guid)
                    {
                        updatefellow        = fellow;
                        m_FellowIndexBuffer = i;
                        break;
                    }
                }
            }
        }
        else
        {
            for (int i = (m_FellowIndexBuffer + babylist.Count - 1) % babylist.Count; i >= 0; i--)
            {
                Fellow fellow = babylist[i];
                if (false == fellow.IsValid())
                {
                    continue;
                }

                if (m_BabyFellowBuffer == null)
                {
                    updatefellow        = fellow;
                    m_FellowIndexBuffer = i;
                    break;
                }
                else
                {
                    if (fellow.Guid != m_BabyFellowBuffer.Guid)
                    {
                        updatefellow        = fellow;
                        m_FellowIndexBuffer = i;
                        break;
                    }
                }
            }
        }

        if (updatefellow == null || false == updatefellow.IsValid() || false == updatefellow.IsBabyFellow())
        {
            return;
        }

//         m_PartnerChooseIcon.spriteName = updatefellow.GetIcon();
//         m_PartnerChooseNameLabel.text = updatefellow.Name;
//         m_PartnerChooseLevelLabel.text = "LV" + updatefellow.Level.ToString();
//         m_PartnerChooseCombatValueLabel.text = updatefellow.GetCombatValue().ToString();
//         m_PartnerChooseProcreateLabel.text = updatefellow.ProcreateCount.ToString();
//         m_PartnerChooseLuckyLabel.text = updatefellow.Lucky.ToString();

        m_BabyFellowBuffer = updatefellow;
    }