示例#1
0
    private void SetUI()
    {
        MyHead.LblDefanNum.text      = m_oldBuildInfo.m_DefensePower.ToString();
        MyHead.LblAfterDefanNum.text = m_buildInfo.m_DefensePower.ToString();

        MyHead.LblHpNum.text      = m_oldBuildInfo.m_hp.ToString();
        MyHead.LblAfterHpNum.text = m_buildInfo.m_hp.ToString();

        if (MyHead.AfterItem != null)
        {
            GameObject go = NDLoad.LoadWndItem("CanvasItem", MyHead.AfterItem.transform);
            if (go)
            {
                CanvasItem item = go.GetComponent <CanvasItem>();
                if (item)
                {
                    item.SetCanvasItem(m_buildInfo, false);
                    item.HiddenTrapNumLabel();
                }
            }
        }
        if (MyHead.PreItem != null)
        {
            GameObject go = NDLoad.LoadWndItem("CanvasItem", MyHead.PreItem.transform);
            if (go)
            {
                CanvasItem item = go.GetComponent <CanvasItem>();
                if (item)
                {
                    item.SetCanvasItem(m_oldBuildInfo, false);
                    item.HiddenTrapNumLabel();
                }
            }
        }

        SetSkill();
    }
示例#2
0
    /// <summary>
    /// 计算升星之后硬度增加.
    /// </summary>
    private void SetBuildProperty()
    {
        //硬度.
        float iSolidGrow     = 0;
        float iIntensityGrow = 0;
        float iTenacityGrow  = 0;

        buildingM.GetStarInfoGrow(m_backUpInfo, ref iSolidGrow, ref iIntensityGrow, ref iTenacityGrow);
        MyHead.LblSolidNum.text  = iSolidGrow.ToString("0.00");
        MyHead.LblTenaNum.text   = iTenacityGrow.ToString("0.00");
        MyHead.LblStrengNum.text = iIntensityGrow.ToString("0.00");

        if (MyHead.AfterItem != null)
        {
            GameObject go = NDLoad.LoadWndItem("CanvasItem", MyHead.AfterItem.transform);
            if (go)
            {
                CanvasItem item = go.GetComponent <CanvasItem>();
                if (item)
                {
                    item.SetCanvasItem(m_build, false);
                    item.HiddenTrapNumLabel();
                }
            }
        }
        if (MyHead.PreItem != null)
        {
            GameObject go = NDLoad.LoadWndItem("CanvasItem", MyHead.PreItem.transform);
            if (go)
            {
                CanvasItem item = go.GetComponent <CanvasItem>();
                if (item)
                {
                    item.SetCanvasItem(m_backUpInfo, false);
                    item.HiddenTrapNumLabel();
                }
            }
        }

        float iAfterSolidGrow     = 0;
        float iAfterIntensityGrow = 0;
        float iAfterTenacityGrow  = 0;

        buildingM.GetStarInfoGrow(m_build, ref iAfterSolidGrow, ref iAfterIntensityGrow, ref iAfterTenacityGrow);
        MyHead.LblSolidAfterNum.text  = iAfterSolidGrow.ToString("0.00");
        MyHead.LblTenaAfterNum.text   = iAfterTenacityGrow.ToString("0.00");
        MyHead.LblStrengAfterNum.text = iAfterIntensityGrow.ToString("0.00");

        int oriStar = buildingM.GetMinBuildStar(m_build.BuildType);

        BuildInfo oriInfo = new BuildInfo();

        oriInfo.BuildType = m_build.BuildType;
        oriInfo.StarLevel = oriStar;

        float oriSolidGrow     = 0;
        float oriIntensityGrow = 0;
        float oriTenacityGrow  = 0;

        buildingM.GetStarInfoGrow(oriInfo, ref oriSolidGrow, ref oriIntensityGrow, ref oriTenacityGrow);

        float iSolidAddNum = (iAfterSolidGrow - oriSolidGrow) + (iAfterSolidGrow - iSolidGrow) * (m_build.Level - 1);

        float iSTenaAddNum = (iAfterTenacityGrow - oriTenacityGrow) + (iAfterTenacityGrow - iTenacityGrow) * (m_build.Level - 1);

        float iStrengAddNum = (iAfterIntensityGrow - oriIntensityGrow) + (iAfterIntensityGrow - iIntensityGrow) * (m_build.Level - 1);

        MyHead.LblSolidAfterAddNum.text  = "(" + NGUIUtil.GetStringByKey(10000077) + "+" + iSolidAddNum.ToString("0.00") + ")";
        MyHead.LblTenaAfterAddNum.text   = "(" + NGUIUtil.GetStringByKey(10000079) + "+" + iSTenaAddNum.ToString("0.00") + ")";
        MyHead.LblStrengAfterAddNum.text = "(" + NGUIUtil.GetStringByKey(10000078) + "+" + iStrengAddNum.ToString("0.00") + ")";
    }