/// <summary>
 /// 侠客图标显示
 /// </summary>
 void ShowSwordsManIcon()
 {
     if (m_SwordsMan == null)
     {
         return;
     }
     if (m_SpriteIcon != null)
     {
         m_SpriteIcon.spriteName = m_SwordsMan.GetIcon();
     }
     if (m_SpriteQuality != null)
     {
         m_SpriteQuality.spriteName = SwordsMan.GetQualitySpriteName((SwordsMan.SWORDSMANQUALITY)m_SwordsMan.Quality);;
     }
 }
    public void UpdateSwordsManInfo()
    {
        if (null == m_LableName)
        {
            return;
        }
        if (null == m_LabelLevelValue)
        {
            return;
        }
        if (null == m_LabelDesc)
        {
            return;
        }
        SwordsManContainer Container = GameManager.gameManager.PlayerDataPool.GetSwordsManContainer(m_PackType);

        if (Container == null)
        {
            return;
        }
        SwordsMan oSwordsMan = Container.GetSwordsManByGuid(m_SwordsManGuid);

        if (oSwordsMan == null)
        {
            return;
        }

        m_LableName.text       = oSwordsMan.Name;
        m_LabelLevelValue.text = oSwordsMan.Level.ToString();
        m_LabelDesc.text       = oSwordsMan.GetTips();
        if (m_SpriteIcon != null)
        {
            m_SpriteIcon.spriteName = oSwordsMan.GetIcon();
        }
        if (m_SpriteQuality != null)
        {
            m_SpriteQuality.spriteName = SwordsMan.GetQualitySpriteName((SwordsMan.SWORDSMANQUALITY)oSwordsMan.Quality);;
        }
        ShowSwordsManExp();
        ShowSwordsManEffect();
    }
Esempio n. 3
0
    /// <summary>
    /// 设置侠客信息
    /// </summary>
    public void SetData(SwordsMan oSwordsMan)
    {
        if (oSwordsMan == null)
        {
            ClearUp();
            return;
        }
        m_oSwordsMan = oSwordsMan;
        m_Status     = Status.STATUS_ENABLE;
        if (null == m_IconSprite)
        {
            return;
        }
        if (null == m_QualitySprite)
        {
            return;
        }

        if (m_LableLevel != null)
        {
            m_LableLevel.text = "LV" + m_oSwordsMan.Level.ToString();
        }
        m_IconSprite.spriteName    = m_oSwordsMan.GetIcon();
        m_QualitySprite.spriteName = SwordsMan.GetQualitySpriteName((SwordsMan.SWORDSMANQUALITY)m_oSwordsMan.Quality);
        OnSelectStateChange();

        //m_LabelLevelValue.text = m_oSwordsMan.Level.ToString();
        //m_LabelDesc.text = m_oSwordsMan.GetTips();
        //m_LabelCurEffect.text = m_oSwordsMan.GetCombatValue().ToString();
        //m_LabelExp.text = m_oSwordsMan.Exp.ToString();

        //int nMaxExp = m_oSwordsMan.MaxExp;
        //if (nMaxExp > 0)
        //{
        //    float fSlider = (float)m_oSwordsMan.Exp / (float)nMaxExp;
        //    m_SliderExp.value = fSlider;
        //}
    }
    /// <summary>
    ///
    /// </summary>
    public void UpdateSwordsManEquipPack()
    {
        SwordsManContainer oSwordsManContainer = GameManager.gameManager.PlayerDataPool.GetSwordsManContainer(SwordsManContainer.PACK_TYPE.TYPE_EQUIPPACK);

        if (null == oSwordsManContainer)
        {
            LogModule.ErrorLog("UpdateSwordsManEquipPack::oSwordsManContainer is null");
            return;
        }
        int nCombatValue = 0;

        for (int i = 0; i < m_SwordsManIcons.Length && i < m_SwordsManQualitys.Length && i < m_SwordsManLock.Length && i < m_SlotLock.Length && i < m_SwordsManLevel.Length && i < m_LabelSlots.Length; i++)
        {
            if (i < oSwordsManContainer.ContainerSize)
            {
                SwordsMan oSwordsMan = oSwordsManContainer.GetSwordsMan(i);
                if (null == oSwordsMan)
                {
                    LogModule.ErrorLog("OnLoadSwordsManItem::oSwordsMan is null");
                    break;
                }
                m_SlotLock[i].SetActive(false);
                if (oSwordsMan.IsValid())
                {
                    m_SwordsManIcons[i].SetActive(true);
                    m_SwordsManIcons[i].GetComponent <UISprite>().spriteName    = oSwordsMan.GetIcon();
                    m_SwordsManQualitys[i].GetComponent <UISprite>().spriteName = SwordsMan.GetQualitySpriteName((SwordsMan.SWORDSMANQUALITY)oSwordsMan.Quality);
                    m_SwordsManQualitys[i].SetActive(true);

                    m_SwordsManLevel[i].gameObject.SetActive(true);
                    m_SwordsManLevel[i].text = StrDictionary.GetClientDictionaryString("#{2673}", oSwordsMan.Level);

                    if (oSwordsMan.Locked)
                    {
                        m_SwordsManLock[i].SetActive(true);
                    }
                    else
                    {
                        m_SwordsManLock[i].SetActive(false);
                    }
                    nCombatValue = nCombatValue + oSwordsMan.GetCombatValue();
                }
                else
                {
                    m_SwordsManQualitys[i].SetActive(false);
                    m_SwordsManIcons[i].SetActive(false);
                    m_SwordsManLock[i].SetActive(false);
                    m_SwordsManLevel[i].gameObject.SetActive(false);
                }
                m_LabelSlots[i].gameObject.SetActive(false);
            }
            else
            {
                //需要解锁

                m_SlotLock[i].SetActive(true);
                m_SwordsManQualitys[i].SetActive(false);
                m_SwordsManIcons[i].SetActive(false);
                m_LabelSlots[i].gameObject.SetActive(true);
                m_SwordsManLevel[i].gameObject.SetActive(false);
                Tab_SwordsEquipPackUnlock SwordsManUnLockTable = TableManager.GetSwordsEquipPackUnlockByID(i + 1, 0);
                if (SwordsManUnLockTable != null)
                {
                    //string strUnLock = SwordsManUnLockTable.NeedLevel.ToString() + "级开放";
                    string strUnLock = StrDictionary.GetClientDictionaryString("#{2674}", SwordsManUnLockTable.NeedLevel);
                    m_LabelSlots[i].text = strUnLock;
                }
            }
        }
        if (m_LabelCombatValue != null)
        {
            m_LabelCombatValue.text = nCombatValue.ToString();
        }
    }