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);
        }
    }
    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;
                }
            }
        }
    }
Beispiel #3
0
    /// <summary>
    /// 设置基本属性界面
    /// </summary>
    public void SetBelleAttrData()
    {
        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;
        }
        if (null == curBelleData)
        {
            return;
        }

//         Tab_CommonItem commItem = TableManager.GetCommonItemByID(belleTab.BelleItemID, 0);
//         if (commItem != null)
//             m_bellePic.spriteName = commItem.Icon;
//         //美人等级
//         m_belleLevel.text = StrDictionary.GetClientDictionaryString("#{1308}", BelleData.GetBelleDescByColorLevel(curBelleData.colorLevel), curBelleData.subLevel);
//         m_belleLevel.color = BelleData.GetBelleColorByColorLevel(curBelleData.colorLevel);

        //  UpdateEvalutionInfo();
        curBelleData.UpdateAttrMap();
        int nextAttrTypeIndex      = curBelleData.GetNextLevelAttrType(curBelleData.orgLevel + 1);
        int nextAttrValue          = curBelleData.GetNextLevelAttrValue(curBelleData.orgLevel + 1);
        Tab_BelleLevelup belleLevL = TableManager.GetBelleLevelupByID(curBelleData.id * Belle.ID_FACTOR + curBelleData.orgLevel, 0);

        if (null == belleLevL)
        {
            return;
        }
        //美人属性值
        for (int i = 0; i < belleTab.getAttrTypeCount(); i++)
        {
            m_shrapPic[i].gameObject.SetActive(false);
            m_defaultText[i].gameObject.SetActive(true);
            m_nextValues[i].text    = "";
            m_attrTypeNames[i].text = Utils.GetAttrTypeString(belleTab.GetAttrTypebyIndex(i));

            int closeValue = 0;
            //亲密值
            if (belleTab.GetAttrTypebyIndex(i) == belleTab.CloseAddAttrType)
            {
                closeValue = curBelleData.closeAddValue;
            }
            //非第六条属性,受颜色等级控制
            if (i != belleTab.getAttrTypeCount() - 1)
            {
                if (i < curBelleData.colorLevel)
                {
                    m_attrValues[i].text = "+" + (belleLevL.GetAttrValuebyIndex(i) /*+ closeValue*/);
                }
                else
                {
                    m_attrValues[i].text = "+" + (belleTab.GetAttrValuebyIndex(i) /*+ closeValue*/);
                }
            }
            else //第六条属性,不受颜色等级控制
            {
                m_attrValues[i].text = "+" + ((curBelleData.IsMaxLevel()? belleLevL.GetAttrValuebyIndex(i):belleTab.GetAttrValuebyIndex(i)) /*+ closeValue*/);
                m_attrTypeNames[i].gameObject.SetActive(false);
            }

            //亲密值
            if (i == 0)
            {
                m_closeValueText.text = StrDictionary.GetClientDictionaryString("#{10817}", closeValue);
                m_closeValueText.gameObject.SetActive(closeValue > 0);
            }

            if (belleTab.getAttrTypeCount() - 1 != i && nextAttrTypeIndex == i)
            {
                //  LogModule.DebugLog("nextAttrType ===    " + nextAttrType + "   BelleTab.getAttrTypeByIndex " + i + "  " + belleTab.GetAttrTypebyIndex(i));
                if (i < curBelleData.colorLevel && nextAttrValue > 0)
                {
                    m_nextValues[i].text = "+" + nextAttrValue.ToString();
                    m_shrapPic[i].gameObject.SetActive(true);
                }
                else
                {
                    m_nextValues[i].text = "";
                }
            }
            else
            {
                m_shrapPic[i].gameObject.SetActive(false);
                m_nextValues[i].text = "";
            }

            if (null != curBelleData && bOwned)
            {
                if (i != belleTab.getAttrTypeCount() - 1)
                {
                    m_attrTypeNames[i].color = i < curBelleData.colorLevel ? m_ColorHighlight : m_ColorDisable;
                    m_attrValues[i].color    = i < curBelleData.colorLevel ? m_ColorHighlight : m_ColorDisable;
//                     m_nextValues[i].color = i < curBelleData.colorLevel ? m_ColorHighlight : m_ColorDisable;

                    m_defaultText[i].gameObject.SetActive(i >= curBelleData.colorLevel);
                }
                else
                {
                    m_attrTypeNames[i].color = curBelleData.IsMaxLevel() ? m_ColorHighlight : m_ColorDisable;
                    m_attrValues[i].color    = curBelleData.IsMaxLevel() ? m_ColorHighlight : m_ColorDisable;
//                     m_nextValues[i].color = curBelleData.IsMaxLevel() ? m_ColorHighlight : m_ColorDisable;
                    m_defaultText[i].gameObject.SetActive(!curBelleData.IsMaxLevel());
                }
            }
            else
            {
                m_attrTypeNames[i].color = m_ColorDisable;
                m_attrValues[i].color    = m_ColorDisable;
//                 m_nextValues[i].color = m_ColorDisable;
                m_shrapPic[i].gameObject.SetActive(false);
                m_defaultText[i].gameObject.SetActive(true);
                m_nextValues[i].text = "";
            }
        }
        //回调的时候等级变化,需要设置战力值
        //   SetCombatValue();
        //触发更新Item数量
        //据策划说,没有第六条属性
        m_attrTypeNames[5].gameObject.SetActive(false);
        m_attrValues[5].gameObject.SetActive(false);
        m_nextValues[5].gameObject.SetActive(false);
        m_shrapPic[5].gameObject.SetActive(false);
        m_defaultText[5].gameObject.SetActive(false);
        //
    }
Beispiel #4
0
    public void UpdateEvalutionInfo()
    {
        if (null == BelleInfoWindow.Instance())
        {
            return;
        }

        Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;

        if (null == belleTab)
        {
            return;
        }

        Belle curBelleData = null;

        if (BelleData.OwnedBelleMap.ContainsKey(belleTab.Id))
        {
            curBelleData = BelleData.OwnedBelleMap[belleTab.Id];
        }
        if (null == curBelleData)
        {
            return;
        }
        int belleSubItemId     = belleTab.BelleItemID;
        int belleTotalSubCount = 0;
        int belleCoinCount     = 0;
        Tab_BelleLevelup curTabBelleLevelup = TableManager.GetBelleLevelupByID(curBelleData.id * Belle.ID_FACTOR + curBelleData.orgLevel, 0);

        if (null != curTabBelleLevelup && curTabBelleLevelup.getConsumeTypeCount() > 0)
        {
            belleTotalSubCount = curTabBelleLevelup.GetConsumeNumbyIndex(0);
            belleCoinCount     = curTabBelleLevelup.GetConsumeNumbyIndex(1);
        }

        if (GameManager.gameManager.PlayerDataPool == null)
        {
            return;
        }
        Games.Item.GameItemContainer backPack = GameManager.gameManager.PlayerDataPool.BackPack;
        if (backPack == null)
        {
            return;
        }
        int belleSubItemCount = backPack.GetItemCountByDataId(belleSubItemId);
        int have = 0; int need = 0;

        GetBelleFragmentNum(out have, out need);
        m_curBelleItemCount.text = have.ToString() + "/" + need.ToString();
        if (need > 0)
        {
            BelleFragmentUS.transform.localScale = new Vector3((float)have / need, 1f, 1f);
        }
        Tab_CommonItem commItem = TableManager.GetCommonItemByID(belleTab.BelleItemID, 0);

        if (commItem != null)
        {
            m_curBelleItemIcon.spriteName = commItem.Icon;
        }
        if (belleSubItemCount < belleTotalSubCount)
        {
            m_curBelleEvaluteLab.text = StrDictionary.GetClientDictionaryString("#{10812}");
            messageBtn.functionName   = "OnGetItem";
            evoRedTipObj.gameObject.SetActive(false);
            if (BelleConfig.GetBelleEvoBitByIndex(belleTab.Id))
            {
                BelleConfig.SetBelleEvoCountByBit(belleTab.Id, '0');
            }
        }
        else
        {
            m_curBelleEvaluteLab.text = StrDictionary.GetClientDictionaryString("#{10813}");
            messageBtn.functionName   = "OnEvolutionClick";
            evoRedTipObj.gameObject.SetActive(!curBelleData.IsMaxLevel());
        }

        BelleData.m_belleEvoCount = BelleConfig.GetBelleEvoCount();
        //最大等级的一个判断


        m_EvaluBtnObj.SetActive(!curBelleData.IsMaxLevel());
        m_EvaluMaxLabel.gameObject.SetActive(curBelleData.IsMaxLevel());
    }
Beispiel #5
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);
                        }
                    }
                }
            }
        }
    }
Beispiel #6
0
    public void UpdateBelleFragmentInfo()
    {
        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;
            }

            //碎片信息
            UpdateEvalutionInfo();
            {
                m_curTimer = 1;
                //小红点更新
                objBelleCloseTip.gameObject.SetActive(BelleData.IsCanCloseFree());
                UpdateTickBand();
                UpdateCloseTimeLabel();
                UpdateCloseProcessBar();
                //单个条目红点的更新
                if (BelleInfoWindow.Instance() != null)
                {
                    BelleInfoWindow.Instance().UpdateCloseRedTipState();
                }
            }
            SetCombatValue();
            //最大等级的一个判断
            m_EvaluBtnObj.SetActive(!curBelleData.IsMaxLevel());
            m_EvaluMaxLabel.gameObject.SetActive(curBelleData.IsMaxLevel());

            m_belleDescText.text = belleTab.Introduction;
            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);
                        }
                    }
                }
            }
        }
    }