示例#1
0
        void OnClickRole(GameObject go = null)
        {
            //属性数据
            var attributeData = ConfigAttributeManager.Instance().allDatas;
            //角色数据
            var roleData          = ConfigRoleManager.Instance().allDatas[roleId];
            var roleAttributeData = roleData.attributes[0];

            var attributeSb = new System.Text.StringBuilder();

            for (int i = 0; i < 7; i++)
            {
                attributeSb.Append($"{attributeData[i].name}:{roleAttributeData[i].ToString()}  ");
            }

            string skillDesc = null;

            if (roleData.skillId != 0)
            {
                var datas = ConfigSkillManager.Instance().allDatas[roleData.skillId];
                skillDesc = $"{datas.name}:{datas.desc}";
            }

            string cooperName = ConfigCooperationManager.Instance().allDatas[roleData.cooperId].name;
            string proName    = ConfigProfessionManager.Instance().allDatas[roleData.proId].name;

            string content = $"<size=50><color={ConstConfig.levelColor[roleData.cost]}>{roleData.name}</color></size>\n<color=#8A3468>{cooperName} {proName}</color>\n\n{attributeSb.ToString()}\n\n{skillDesc}";

            ViewManager.Get <WndTips>("WndTips").ShowInfo(content);
        }
示例#2
0
    protected override void InitDesc()
    {
        System.Text.StringBuilder namesb = new System.Text.StringBuilder("\n");

        var allRoles = ConfigRoleManager.Instance().allDatas;

        foreach (var role in allRoles.Values)
        {
            if (role.cooperId == id)
            {
                namesb.Append($"<color={ConstConfig.levelColor[role.cost]}>[{role.name}]</color> ");
            }
        }


        ConfigCooperation cooperData = ConfigCooperationManager.Instance().allDatas[GetId()];
        var attriData = ConfigAttributeManager.Instance().allDatas;
        var sb        = new System.Text.StringBuilder();

        string type = null;

        if (cooperData.type == 1)
        {
            type = " ";
        }
        else if (cooperData.type == 2)
        {
            type = "% ";
        }

        for (int i = 0; i < cooperData.counts.Length; i++)
        {
            sb.Append($"<color=blue>人口:</color>{cooperData.counts[i]}\n");
            foreach (var v in cooperData.attributes)
            {
                sb.Append($"<color=yellow>{ attriData[v.Key].name}:</color>{v.Value[i]}{type}");
            }
            int range = cooperData.range[i];
            if (range == 1)
            {
                sb.Append("\n<color=blue>范围:</color>只对该羁绊的角色生效\n");
            }
            else if (range == 2)
            {
                sb.Append("\n<color=blue>范围:</color>对我方所有角色生效\n");
            }
        }
        sb.Append(namesb);

        desc = sb.ToString();
    }