UMI does not work when setting object inactive in Start()
I am using UMI in my project. At some place it works and other it does not. I literally copied the whole gameobject with Text input field and attached UMI script, place it higher in UI elements hierarchy and it works. While inside other element it does not work. Worse, I can not see what is the difference as inside other element it is working. I am not sure if this is some problem with some cached behavior or what gives.
In green where it works, in red where it does not. Unfortunetely I can not find a difference - ie why it behaves like this.
I traced it down to my script attached to the container. Here is the culprit:
public void Start(){
//Close(); //close settings panel at the start -> this caused the UMI to NOT work
}
public void Close(){
gameObject.SetActive(false);
}
It is very strange - when I manually mark the object in the editor not active and later open it with another button, the UMI still works. When I make the object inactive inside Start() function in the script attached to the object, it does not.
It looks like UMI starts initialization and doesn't complete it because you are disabling the component at Start.
The problem is that initialization here happens in the coroutine. If you turn it off at startup, the coroutine will turn off and there may be problems when trying again. Is it possible to make initialization not tied to monobeh or in some separate service?
Is it possible to make initialization not tied to monobeh or in some separate service?
It is unlikely that this is possible. UMI waits for the TMP component to be created, gets its size and creates native fields.
Yes, but when you turn it off before initialization, this process now breaks. It looks like by design, if initialization is interrupted, when you turn it on again, it should repeat the initialization attempt, but now it just stops working