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

分支2.0获取文本高度不正确 #25

Open
EricCai1991 opened this issue Dec 15, 2018 · 2 comments
Open

分支2.0获取文本高度不正确 #25

EricCai1991 opened this issue Dec 15, 2018 · 2 comments

Comments

@EricCai1991
Copy link

rt

@EricCai1991
Copy link
Author

分支2.0为什么获取到的宽高都是错的。。。

@EricCai1991
Copy link
Author

public override void SetVerticesDirty()
{
    base.SetVerticesDirty();
    if (!_inlineManager)
    {
        _inlineManager = GetComponentInParent<InlineManager>();
        if(!_inlineManager)
            _outputText = m_Text;
        return;
    }
    var settings = GetGenerationSettings(Vector2.zero);
    //设置新文本
    _outputText = GetOutputText();
}

在InlineText.cs文件,修改这里,直接赋值之后拿宽高,发现_inlineManager根本还没初始化,所以一直拿到的是初始的text

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

1 participant