LoginSignup
2
1

More than 1 year has passed since last update.

[TextMeshPro] text.textInfo.linkInfo.Lengthが間違った値を返す

Last updated at Posted at 2022-05-23

TextMeshProに

<style=name>太郎</style>こんにちは。<style=flag1/><link=msgptr:0/>

のような文字列を渡すと、linkタグを拾ってくれます。その情報は
text.textInfo.linkInfoに格納されるのですが、正しいLink情報だけ拾ってくるためには
text.textInfo.linkCountを参照する必要があります。

つまりtext.textInfo.linkInfo.Lengthで取得しようとすると間違った値を返すことがあります。
どうやらこのバッファは一度サイズが大きくなるとそのままのサイズが維持され、後ろのほうには過去に取得したlinkInfoが入ったままになるようです。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1