Last active
August 3, 2018 23:28
-
-
Save sassembla/dd9a5de1826aa190ff583164fe9c537c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Text textComponent みたいなものに対して | |
// TextGenerator generator = new TextGenerator(); みたいなのをグローバルで取得しておいて使い回すことができる | |
// invalidate first. | |
generator.Invalidate(); | |
// set content to prefab. | |
var defaultText = textComponent.text; | |
textComponent.text = text; | |
var setting = textComponent.GetGenerationSettings(new Vector2(viewWidth, float.PositiveInfinity)); | |
generator.Populate(text, setting); | |
var lineCount = generator.lineCount; | |
var lines = generator.lines;// 各行の情報、行の高さとかspacingの高さが取れる |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
これに対して、TMProは
https://gist.github.com/sassembla/a51fc0d85672e2f3233607c9e0b6cac6