Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

unity2019支持问题 #48

Open
uncleciba opened this issue Jan 9, 2020 · 8 comments
Open

unity2019支持问题 #48

uncleciba opened this issue Jan 9, 2020 · 8 comments

Comments

@uncleciba
Copy link

以前在unity2018上用的很好,2019出现严重问题:
2019的unity中,OnPopulateMesh(VertexHelper toFill)方法的toFill内容发生变化。

2018中,toFill里vertex的个数是原始字符串的4倍,例如,原始字符串是123,vertex就有104个。
2019中,vertex只有4
4个,也就是“翻译”后实际的顶点个数
而目前quad位置的对应算法是:tempIndex = _textBuilder.Length * 4;
是按原始字符串长度算了。
这导致后续的顶点处理都出现了错误。

@coding2233
Copy link
Owner

是2019以上的所有版本都有这个问题么

@uncleciba
Copy link
Author

uncleciba commented Jan 10, 2020 via email

@coding2233
Copy link
Owner

嗯嗯, 我会尽快看看的 。

@fzlcxy
Copy link

fzlcxy commented Jun 15, 2020

2019 那个Scene Chat Demo 默认语句发出去 显示就是错了, 就是这句

Click Send Button Send Message,[#emoji_7]&&[1#run]。

@coding2233
Copy link
Owner

@fzlcxy 我先修复看看

@mount33
Copy link

mount33 commented Dec 18, 2020

准确的说,2019中也可能出现顶点数是字符4倍的情况,当Text组件有overflow存在时,我们项目现在的做法是在富文本开头加上一对标签然后在 OnPopulateMesh 中进行判断 如果 最前面4个定点的位置全部相同则判断为 Unity没有去除富文本标签的定点信息

        toFill.PopulateUIVertex(ref verts[0], 0);
        toFill.PopulateUIVertex(ref verts[1], 1);
        toFill.PopulateUIVertex(ref verts[2], 2);
        toFill.PopulateUIVertex(ref verts[3], 3);

        if(verts[0].position == verts[1].position  && verts[2].position == verts[3].position && verts[0].position == verts[3].position) {
            removeUnityTag = false;
        }

@uncleciba
Copy link
Author

在富文本开头加上一对标签?
是人为额外加上吗
如果需要额外添加,有点破坏使用体验^_^

@mount33
Copy link

mount33 commented Dec 21, 2020

在富文本开头加上一对标签?
是人为额外加上吗
如果需要额外添加,有点破坏使用体验^_^

代码加呀,对策划是无感的~

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants