Пример #1
0
    public Buff(int id, Role role, Role from)
    {
        _id  = id;
        _tpl = TemplateManager.GetBuff(_id);
        if (_tpl == null)
        {
            Debug.LogError("未找到Buff模板,id=" + _id);
        }
        _role = role;
        _from = from;
        Vector2 pt = Vector2.zero;

        if (_tpl.Resposition == 1)
        {
            pt = _role.GetBuffPosition();
        }
        else if (_tpl.Resposition == 2)
        {
            pt = _role.GetHeadPosition(true);
        }
        if (!_tpl.Res.Trim().Equals(""))
        {
            _effect = _role.AddFlipEffect(SystemConsts.SKILL_BUFF_PREFIX + _tpl.Res, pt);
        }

        _affectIndex = 0;
        _affectCount = 0.0f;

        Refresh(_from);
    }