コード例 #1
0
    private void ShowForedinationHead()    //魔灵未激活状态 宿命也能够显示
    {
        Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;
        int       count    = ForeordinationHead.Length;

        for (int i = 0; i < count; ++i)
        {
            if (ForeordinationHead[i] != null)
            {
                if (i < belleTab.getAffectionConditonValueCount())
                {
                    int id = belleTab.GetAffectionConditonValuebyIndex(i);
                    ForeordinationHead[i].SetActive(true);
                    bool      isHas          = BelleData.OwnedBelleMap.ContainsKey(id);
                    Tab_Belle affectionbelle = TableManager.GetBelleByID(id, 0);
                    if (affectionbelle != null)
                    {
                        Tab_CommonItem cItem = TableManager.GetCommonItemByID(affectionbelle.BelleItemID, 0);
                        if (cItem != null)
                        {
                            UISprite us = ForeordinationHead[i].GetComponent <UISprite>();
                            if (us != null)
                            {
                                us.spriteName = Games.GlobeDefine.GlobeVar.QualityColorGrid[cItem.Quality - 1];
                                if (isHas)
                                {
                                    us.color = Games.GlobeDefine.GlobeVar.BUTTONCOLER;
                                }
                                else
                                {
                                    us.color = Games.GlobeDefine.GlobeVar.BUTTONGRAY;
                                }
                            }
                            Transform tf = ForeordinationHead[i].transform.Find("Head");
                            if (tf != null)
                            {
                                UISprite usc = tf.GetComponent <UISprite>();
                                if (usc != null)
                                {
                                    usc.spriteName = cItem.Icon;
                                    if (isHas)
                                    {
                                        usc.color = Games.GlobeDefine.GlobeVar.BUTTONCOLER;
                                    }
                                    else
                                    {
                                        usc.color = Games.GlobeDefine.GlobeVar.BUTTONGRAY;
                                    }
                                }
                            }
                        }
                    }
                }
                else
                {
                    ForeordinationHead[i].SetActive(false);
                }
            }
        }
    }
コード例 #2
0
    //获取当前可以显示的美人列表,当前阵上的那个美人单独处理
    public List <SelectBelleData> GetSelectBelleListByBelleId()
    {
        List <SelectBelleData> selectBelleDataList = new List <SelectBelleData>();

        foreach (int belleId in TableManager.GetBelle().Keys)
        {
            if (BelleData.OwnedBelleMap.ContainsKey(belleId))
            {
                SelectBelleData selectBelleData = new SelectBelleData();
                selectBelleData.CleanUp();
                selectBelleData.belleID  = belleId;
                selectBelleData.matrixId = BelleData.OwnedBelleMap[belleId].matrixID;
                BelleData.OwnedBelleMap[belleId].UpdateAttrMap();
                selectBelleData.combatValue = BelleData.GetPowerNum(BelleData.OwnedBelleMap[belleId].attrMap);
                bool isAdd = true;
                for (int i = 0; i < hasInMatirxBelles.Count; i++)
                {
                    //已经在当前阵上上阵的就不添加了。
                    if (hasInMatirxBelles[i] == belleId)
                    {
                        isAdd = false;
                    }
                    //羁绊关系添加
                    Tab_Belle _belleTab = TableManager.GetBelleByID(hasInMatirxBelles[i], 0);
                    if (null != _belleTab)
                    {
                        for (int j = 0; j < _belleTab.getAffectionConditonTypeCount(); j++)
                        {
                            if (BELLE_AFFECTION_TYPE == _belleTab.GetAffectionConditonTypebyIndex(j))
                            {
                                int belleIdRelation = _belleTab.GetAffectionConditonValuebyIndex(j);
                                if (belleIdRelation == belleId)
                                {
                                    selectBelleData.isRelationship = true;
                                }
                            }
                        }
                    }
                }
                if (isAdd)
                {
                    selectBelleDataList.Add(selectBelleData);
                }
            }
        }
        selectBelleDataList.Sort();
        return(selectBelleDataList);
    }
コード例 #3
0
    public List <SelectBelleData> GetSelectBellelistByBelleIds(List <int> belleIds)
    {
        List <SelectBelleData> selectBelleDataList = new List <SelectBelleData>();

        if (belleIds == null && belleIds.Count == 0)
        {
            return(selectBelleDataList);
        }
        foreach (int belleId in TableManager.GetBelle().Keys)
        {
            if (BelleData.OwnedBelleMap.ContainsKey(belleId))
            {
                SelectBelleData selectBelleData = new SelectBelleData();
                selectBelleData.CleanUp();
                selectBelleData.belleID     = belleId;
                selectBelleData.matrixId    = BelleData.OwnedBelleMap[belleId].matrixID;
                selectBelleData.combatValue = BelleData.GetPowerNum(BelleData.OwnedBelleMap[belleId].attrMap);
                for (int i = 0; i < belleIds.Count; i++)
                {
                    Tab_Belle _belleTab = TableManager.GetBelleByID(belleIds[i], 0);
                    if (null != _belleTab)
                    {
                        for (int j = 0; j < _belleTab.getAffectionConditonTypeCount(); j++)
                        {
                            if (BELLE_AFFECTION_TYPE == _belleTab.GetAffectionConditonTypebyIndex(j))
                            {
                                int belleIdRelation = _belleTab.GetAffectionConditonValuebyIndex(j);
                                if (belleIdRelation == belleId)
                                {
                                    selectBelleData.isRelationship = true;
                                }
                            }
                        }
                    }
                }

                selectBelleDataList.Add(selectBelleData);
            }
        }
        selectBelleDataList.Sort();
        return(selectBelleDataList);
    }
コード例 #4
0
    public void ForeordinationClickPress(GameObject go)
    {
        int index;

        if (go != null && int.TryParse(go.name, out index) && ForeordinationTips != null)
        {
            Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;
            if (null != belleTab)
            {
                --index;
                if (index > -1 && index < belleTab.getAffectionConditonValueCount())
                {
                    int id = belleTab.GetAffectionConditonValuebyIndex(index);

                    bool      isHas          = BelleData.OwnedBelleMap.ContainsKey(id);
                    Tab_Belle affectionbelle = TableManager.GetBelleByID(id, 0);
                    if (affectionbelle != null)
                    {
                        Tab_CommonItem cItem = TableManager.GetCommonItemByID(affectionbelle.BelleItemID, 0);
                        if (cItem != null)
                        {
                            Transform tf = ForeordinationTips.transform.Find("Item");
                            if (tf != null)
                            {
                                UISprite us = tf.GetComponent <UISprite>();
                                if (us != null)
                                {
                                    us.spriteName = Games.GlobeDefine.GlobeVar.QualityColorGrid[cItem.Quality - 1];
                                    if (isHas)
                                    {
                                        us.color = Games.GlobeDefine.GlobeVar.BUTTONCOLER;
                                    }
                                    else
                                    {
                                        us.color = Games.GlobeDefine.GlobeVar.BUTTONGRAY;
                                    }
                                }
                            }
                            tf = ForeordinationTips.transform.Find("Item/Head");
                            if (tf != null)
                            {
                                UISprite usc = tf.GetComponent <UISprite>();
                                if (usc != null)
                                {
                                    usc.spriteName = cItem.Icon;
                                    if (isHas)
                                    {
                                        usc.color = Games.GlobeDefine.GlobeVar.BUTTONCOLER;
                                    }
                                    else
                                    {
                                        usc.color = Games.GlobeDefine.GlobeVar.BUTTONGRAY;
                                    }
                                }
                            }
                            tf = ForeordinationTips.transform.Find("belleName");
                            if (tf != null)
                            {
                                UILabel ul = tf.GetComponent <UILabel>();
                                if (ul != null)
                                {
                                    ul.text = affectionbelle.Name;
                                }
                            }
                            tf = ForeordinationTips.transform.Find("ForeordinationName");
                            if (tf != null)
                            {
                                UILabel ul = tf.GetComponent <UILabel>();
                                if (ul != null)
                                {
                                    ul.text = belleTab.GetAffectionNamebyIndex(index);
                                }
                            }
                            tf = ForeordinationTips.transform.Find("Property");
                            if (tf != null)
                            {
                                UILabel ul = tf.GetComponent <UILabel>();
                                if (ul != null)
                                {
                                    ul.text = belleTab.GetAffectionDescbyIndex(index);
                                }
                            }
                        }
                    }
                }
            }
        }
        if (ForeordinationTips != null)
        {
            ForeordinationTips.SetActive(true);
        }
    }
コード例 #5
0
    public void SetRelationshipInfo()
    {
        if (null == BelleInfoWindow.Instance())
        {
            return;
        }

        Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;

        if (null == belleTab)
        {
            return;
        }

        Belle curBelleData = null;
        bool  bOwned       = false;

        if (BelleData.OwnedBelleMap.ContainsKey(belleTab.Id))
        {
            curBelleData = BelleData.OwnedBelleMap[belleTab.Id];
            bOwned       = true;
        }

        for (int i = 0; i < m_belleNames.Length; i++)
        {
            if (i < belleTab.getAffectionGainsTypeCount())
            {
                Tab_Belle targetBelle = TableManager.GetBelleByID(belleTab.GetAffectionConditonValuebyIndex(i), 0);
                if (null == targetBelle)
                {
                    continue;
                }

                UnityEngine.Object belleTextureObj = ResourceManager.LoadResource(BelleData.GetBelleBigTextureName(targetBelle), typeof(Texture)) as Texture;
                if (null != belleTextureObj)
                {
                    m_bellePics[i].mainTexture = belleTextureObj as Texture;
                    // m_bellePics[i].color = m_ColorDisable;
                }
                //目标美人图片
                //  Tab_CommonItem commItem = TableManager.GetCommonItemByID(targetBelle.BelleItemID, 0);
                // if (commItem != null)
                //     m_bellePics[i].spriteName = commItem.Icon;
                //目标美人名字
                m_belleNames[i].text  = targetBelle.Name;
                m_belleNames[i].color = m_ColorDisable;

                //当前美人情缘名称
                m_relationNames[i].text  = belleTab.GetAffectionNamebyIndex(i);
                m_relationNames[i].color = m_ColorDisable;

                //当前美人加成属性描述
                m_attrDescs[i].text  = belleTab.GetAffectionDescbyIndex(i);
                m_attrDescs[i].color = m_ColorDisable;

                if (null != curBelleData && bOwned)
                {
                    int curBelleMatrixID = curBelleData.matrixID;
                    if (curBelleMatrixID < 0)
                    {
                        continue;
                    }

                    if (!BelleData.OwnedMatrixMap.ContainsKey(curBelleMatrixID))
                    {
                        continue;
                    }

                    if (!BelleData.OwnedMatrixMap[curBelleMatrixID].isActive)
                    {
                        continue;
                    }

                    bool bActive = false;

                    // 同上阵
                    int targetBelleID = belleTab.GetAffectionConditonValuebyIndex(i);
                    if (BelleData.OwnedBelleMap.ContainsKey(targetBelleID))
                    {
                        if (BelleData.OwnedBelleMap[targetBelleID].matrixID == curBelleData.matrixID)
                        {
                            bActive = true;
                        }
                    }

                    m_belleNames[i].color    = bActive ? m_belleNameHighlight : m_ColorDisable;
                    m_relationNames[i].color = bActive ? m_relationNameHightlight : m_ColorDisable;
                    m_attrDescs[i].color     = bActive ? m_attrDescHightlight : m_ColorDisable;
                }
            }
        }
    }
コード例 #6
0
    public List <RecommondBelleData> GetRecommondBellesByBelleId(List <int> belleIds)
    {
        List <int> retBelles = new List <int>();
        List <RecommondBelleData> RecommBelleDataList = new List <RecommondBelleData>();

        if (belleIds == null || belleIds.Count == 0)
        {
            return(RecommBelleDataList);
        }

        //find has relationship belleIds with belleIds that has in Matrix and is owned!
        HashSet <int> hasRelationShipSets = new HashSet <int>();

        for (int i = 0; i < belleIds.Count; i++)
        {
            Tab_Belle _belleTab = TableManager.GetBelleByID(belleIds[i], 0);
            if (null != _belleTab)
            {
                for (int j = 0; j < _belleTab.getAffectionConditonTypeCount(); j++)
                {
                    if (BELLE_AFFECTION_TYPE == _belleTab.GetAffectionConditonTypebyIndex(j))
                    {
                        int belleId = _belleTab.GetAffectionConditonValuebyIndex(j);
                        if (BelleData.OwnedBelleMap.ContainsKey(belleId) && !retBelles.Contains(belleId) && !belleIds.Contains(belleId))
                        {
                            retBelles.Add(belleId);
                            if (!hasRelationShipSets.Contains(belleId))
                            {
                                hasRelationShipSets.Add(belleId);
                            }
                        }
                    }
                }
            }
        }

        //在加上那些跟当前美人没有亲密关系,但拥有的美人但没有上阵的
        foreach (var belle in BelleData.OwnedBelleMap)
        {
            if (!retBelles.Contains(belle.Value.id) && !belleIds.Contains(belle.Value.id) && belle.Value.matrixID == -1 && belle.Value.matrixIndex == -1)
            {
                retBelles.Add(belle.Value.id);
            }
        }

        //Debug 一下数据////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        string str = "";

        for (int i = 0; i < retBelles.Count; i++)
        {
            str += retBelles[i] + " ";
        }
        LogModule.DebugLog(str);
        if (retBelles.Count > 0)
        {
            for (int i = 0; i < retBelles.Count; i++)
            {
                if (BelleData.OwnedBelleMap.ContainsKey(retBelles[i]))
                {
                    RecommondBelleData _recommonData = new RecommondBelleData();
                    _recommonData.CleanUp();
                    Belle _belle = BelleData.OwnedBelleMap[retBelles[i]];
                    _recommonData.BelleID         = _belle.id;
                    _recommonData.isMatrix        = _belle.matrixID != -1 ? 1 : 0;
                    _recommonData.hasRelationship = hasRelationShipSets.Contains(retBelles[i])? 1 : 0;
                    _belle.UpdateAttrMap();
                    _recommonData.combatValue = BelleData.GetPowerNum(_belle.attrMap);
                    if (!RecommBelleDataList.Contains(_recommonData))
                    {
                        RecommBelleDataList.Add(_recommonData);
                    }
                }
            }
        }
        RecommBelleDataList.Sort();
        return(RecommBelleDataList);
    }
コード例 #7
0
    public void SetData()
    {
        InitTab();
        if (BelleInfoWindow.Instance() != null)
        {
            Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;

            if (null == belleTab)
            {
                //LogModule.ErrorLog("BelleInfoWindow.Instance().CurSellectedBelleData is null!");
                return;
            }

            Belle curBelleData = null;
            if (BelleData.OwnedBelleMap.ContainsKey(belleTab.Id))
            {
                curBelleData = BelleData.OwnedBelleMap[belleTab.Id];
            }

            if (null == curBelleData)
            {
                return;
            }
            //名字
            m_belleName.text  = belleTab.Name;
            m_belleName.color = BelleData.GetBelleColorByColorLevel(curBelleData.colorLevel);
            //战力
            curBelleData.UpdateAttrMap();
            m_battleValue.text = BelleData.GetPowerNum(curBelleData.attrMap).ToString();

            //品阶
            m_curBelleMainColor.text          = BelleData.GetBelleDescByColorLevel(curBelleData.colorLevel);
            m_curBelleMainColorPic.spriteName = BelleData.GetBelleColorPicByColorLevel(curBelleData.colorLevel);
            m_curBelleSubColor.text           = StrDictionary.GetClientDictionaryString("#{10811}", curBelleData.subLevel);
            m_curBelleMainColor.color         = BelleData.GetBelleColorByColorLevel(curBelleData.colorLevel);
            m_curBelleSubColor.color          = BelleData.GetBelleColorByColorLevel(curBelleData.colorLevel);

            //碎片信息
            UpdateEvalutionInfo();
            //半身像
            UnityEngine.Object belleTextureObj = ResourceManager.LoadResource(BelleData.GetBelleBigTextureName(belleTab), typeof(Texture)) as Texture;
            if (null != belleTextureObj)
            {
                m_bellePic.mainTexture = belleTextureObj as Texture;
            }

            //属性界面
            BelleAttrInfoWindow belleAttrInfoWindow = m_belleAttrWin.GetComponent <BelleAttrInfoWindow>();
            if (belleAttrInfoWindow != null)
            {
                belleAttrInfoWindow.SetBelleAttrData();
            }
            UpdateCloseState();

            SetCombatValue();

            //最大等级的一个判断
            m_EvaluBtnObj.SetActive(!curBelleData.IsMaxLevel());
            m_EvaluMaxLabel.gameObject.SetActive(curBelleData.IsMaxLevel());

            m_belleDescText.text = belleTab.Introduction;
            int count = ForeordinationHead.Length;
            for (int i = 0; i < count; ++i)
            {
                if (ForeordinationHead[i] != null)
                {
                    if (i < belleTab.getAffectionConditonValueCount())
                    {
                        int id = belleTab.GetAffectionConditonValuebyIndex(i);
                        ForeordinationHead[i].SetActive(true);
                        bool      isHas          = BelleData.OwnedBelleMap.ContainsKey(id);
                        Tab_Belle affectionbelle = TableManager.GetBelleByID(id, 0);
                        if (affectionbelle != null)
                        {
                            Tab_CommonItem cItem = TableManager.GetCommonItemByID(affectionbelle.BelleItemID, 0);
                            if (cItem != null)
                            {
                                UISprite us = ForeordinationHead[i].GetComponent <UISprite>();
                                if (us != null)
                                {
                                    us.spriteName = Games.GlobeDefine.GlobeVar.QualityColorGrid[cItem.Quality - 1];
                                    if (isHas)
                                    {
                                        us.color = Games.GlobeDefine.GlobeVar.BUTTONCOLER;
                                    }
                                    else
                                    {
                                        us.color = Games.GlobeDefine.GlobeVar.BUTTONGRAY;
                                    }
                                }
                                Transform tf = ForeordinationHead[i].transform.Find("Head");
                                if (tf != null)
                                {
                                    UISprite usc = tf.GetComponent <UISprite>();
                                    if (usc != null)
                                    {
                                        usc.spriteName = cItem.Icon;
                                        if (isHas)
                                        {
                                            usc.color = Games.GlobeDefine.GlobeVar.BUTTONCOLER;
                                        }
                                        else
                                        {
                                            usc.color = Games.GlobeDefine.GlobeVar.BUTTONGRAY;
                                        }
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        ForeordinationHead[i].SetActive(false);
                    }
                }
            }
            if (HeadTone != null)
            {
                Tab_CommonItem cItem = TableManager.GetCommonItemByID(belleTab.BelleItemID, 0);
                if (cItem != null)
                {
                    UISprite us = HeadTone.GetComponent <UISprite>();
                    if (us != null)
                    {
                        us.spriteName = Games.GlobeDefine.GlobeVar.QualityColorGrid[belleTab.Quality - 1];
                    }
                    Transform tf = HeadTone.transform.Find("Head");
                    if (tf != null)
                    {
                        UISprite us1 = tf.GetComponent <UISprite>();
                        if (us1 != null)
                        {
                            us1.spriteName = cItem.Icon;
                        }
                    }
                    tf = HeadTone.transform.Find("tone");
                    if (tf != null)
                    {
                        UISprite us2 = tf.GetComponent <UISprite>();
                        if (us2 != null)
                        {
                            us2.spriteName = BelleData.GetBelleColorPicByColorLevel(BelleData.OwnedBelleMap[belleTab.Id].colorLevel);
                        }
                    }
                }
            }
        }
    }