Beispiel #1
0
    private void ShowDescInfo(string unitType)
    {
        var info = UnitConfiguration.GetDefaultConfig(unitType);

        if (Need > 1)
        {
            Title.text = string.Format("{2} {0}{3} {1} {4}", SCMText.T(info.DisplayName + " "), Need,
                                       SCMText.T("解锁"), SCMText.T("将消耗"), SCMText.T("积分 "));
        }
        else
        {
            Title.text = string.Format("{2} {0}{3} {1} {4}", SCMText.T(info.DisplayName + " "), Need,
                                       SCMText.T("解锁"), SCMText.T("将消耗"), SCMText.T("积分"));
        }

        AttackType01.text = info.CanAttackGround ? "<color=green>是</color>" : "<color=red>否</color>";
        AttackType02.text = info.CanAttackAir ? "<color=green>是</color>" : "<color=red>否</color>";
        Cost.text         = info.Cost.ToString();
        GasCost.text      = info.GasCost.ToString();

        AttackPower.text  = info.CanAttackGround ? info.AttackPower[0].ToString() : "";
        AttackPower.text += info.CanAttackAir && info.CanAttackGround ? ", " : "";
        AttackPower.text += info.CanAttackAir ? info.AttackPower[1].ToString() : "";

        ConstructingTime.text = info.ConstructingTime.ToString() + "s";
        MaxHp.text            = info.MaxHp.ToString();
        Defence.text          = info.Defence.ToString();

        Desc.text = info.Desc;
    }
Beispiel #2
0
    public void ShowUserInfo()
    {
        var meInfo = GameCore.Instance.MeInfo;

        User.transform.Find("Name").GetComponent <Text>().text    = GameCore.Instance.MeInfo.Name;
        User.transform.Find("WinCnt").GetComponent <Text>().text  = SCMText.T("胜") + string.Format(":<color=green>{0}</color>", meInfo.WinCount.ToString());
        User.transform.Find("LoseCnt").GetComponent <Text>().text = SCMText.T("负") + string.Format(":<color=red>{0}</color>", meInfo.LoseCount.ToString());

        // Icon
        Sprite img = Resources.Load <Sprite>(@"Texture\AvatarUI\" + meInfo.CurAvator);

        if (null != img)
        {
            User.transform.Find("Icon").GetComponent <Image>().sprite = img;
        }
        else
        {
            User.transform.Find("Icon").gameObject.SetActive(false);
        }

        var total = meInfo.WinCount + meInfo.LoseCount;

        User.transform.Find("Rate").GetComponent <Text>().text = SCMText.T("胜率") + string.Format(":{0}", total <= 0 ? " - " : (int)(meInfo.WinCount * 100 / total) + "%");

        var left = meInfo.Integration - meInfo.IntegrationCost;

        // 解锁积分
        IntegrationVal.text = left.ToString();
    }
Beispiel #3
0
    public void Show(UserInfo[] infos)
    {
        base.Show();

        Clear();
        ResetPos();

        UserName1.text = infos[0].Name;
        UserName2.text = infos[1].Name;

        var total1 = infos[0].WinCount + infos[0].LoseCount;
        var total2 = infos[1].WinCount + infos[1].LoseCount;

        UserRate1.text = SCMText.T("胜率") + string.Format(":{0}", total1 <= 0 ? " - " : (int)(infos[0].WinCount * 100 / total1) + "%");
        UserRate2.text = SCMText.T("胜率") + string.Format(":{0}", total2 <= 0 ? " - " : (int)(infos[1].WinCount * 100 / total2) + "%");

        SetAvatarInfo(infos);
        BuildAllItems(infos);

        isScroll    = true;
        elapsedTime = 0;
    }