コード例 #1
0
    public static string GetCooperName(int roleId)
    {
        var datas    = ConfigRoleManager.Instance().allDatas[roleId];
        int cooperId = datas.cooperId;

        return(ConfigCooperationManager.Instance().allDatas[cooperId].name);
    }
コード例 #2
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);
        }
コード例 #3
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();
    }
コード例 #4
0
    //构造方法里根据id赋予初始数据
    //将其初始化,可由外调用
    public override void Init(int id)
    {
        configData = ConfigCooperationManager.Instance().allDatas[id];
        maxCount   = configData.counts[configData.counts.Length - 1];

        name       = configData.name;
        attributes = configData.attributes;
        range      = configData.range;
        type       = configData.type;

        InitDesc();

        //下面的代码可以让羁绊回到出厂设置
        effectIndex = -1;
        etlCount    = 0;
        roles.Clear();
    }