Пример #1
0
        internal void SetData(BuffInst buffInst)
        {
            BuffTemplate templet = BuffTemplateData.GetData(buffInst.tplId);

            if (templet == null)
            {
                return;
            }
            img.url = ResPath.GetUiImagePath(PackageName.BATTLE, templet.szImg);
            switch (templet.nType)
            {
            case BuffType.ADD_ARMOR_ROUND_END:
            case BuffType.MULTI_ARMOR:
                txtValue.text    = buffInst.effectVal.ToString();
                txtValue.visible = true;
                break;

            case BuffType.MAGIC_SWORD:      //幻剑
                txtValue.text    = buffInst.effectVal.ToString();
                txtValue.visible = true;
                break;

            default:
                txtValue.text    = buffInst.leftBout.ToString();
                txtValue.visible = buffInst.leftBout > 0;
                break;
            }
        }
Пример #2
0
 /// <summary>
 /// 使用敌人数据初始化
 /// </summary>
 /// <param name="enemyInstance"></param>
 public void Init(EnemyInstance enemyInstance)
 {
     instId = enemyInstance.instId;
     rootContainer.touchChildren = false;
     pgsHp.max     = pgsHp.value = enemyInstance.maxHp;
     imgAvatar.url = ResPath.GetUiImagePath(PackageName.BATTLE, "guaiwu");   //todo 从敌人模板表读取外观
     SetBuffInstList(enemyInstance.lstBuffInst);
 }
Пример #3
0
 internal void SetData(RelicBase relicBase)
 {
     _relicBase = relicBase;
     _template  = RelicTemplateData.GetData(relicBase.tplId);
     if (_template == null)
     {
         return;
     }
     imgRelic.url = ResPath.GetUiImagePath(PackageName.RELIC, _template.szImg);
 }
Пример #4
0
    /// <summary>
    /// 获取BUFF提示
    /// </summary>
    /// <param name="buffInst"></param>
    /// <returns></returns>
    internal static TipStruct GetBuffTip(BuffInst buffInst)
    {
        BuffTemplate template = BuffTemplateData.GetData(buffInst.tplId);

        if (template == null)
        {
            return(null);
        }
        TipStruct tipStruct = new TipStruct()
        {
            name    = template.szName,
            desc    = template.szDesc,
            iconUrl = ResPath.GetUiImagePath(PackageName.BATTLE, template.szImg)
        };

        return(tipStruct);
    }
Пример #5
0
    /// <summary>
    /// 获取回合行为提示
    /// </summary>
    /// <param name="boutAction"></param>
    /// <returns></returns>
    internal static TipStruct GetActionTip(BoutAction boutAction)
    {
        switch (boutAction.enemyAction)
        {
        case EnemyAction.ATTACK:
            var attackTip = new TipStruct()
            {
                name    = GameText.ACTION_ATTACK,
                iconUrl = ResPath.GetUiImagePath(PackageName.BATTLE, "sword_icon"),
                desc    = string.Format(GameText.BATTLE_5, boutAction.iValue)
            };
            return(attackTip);

        default:
            Debug.LogError("unhandle enemy action type:" + boutAction.enemyAction);
            break;
        }
        return(null);
    }