You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not as big of an issue compare to others that've seen for this project.
The Problem
Let's say you have a screen and you want to add an RTL-TMP Button. You select a Game Object to be it's parent and from the Game Object>UI you select Button-TRLTMP. I except that the button will be created as a child of the selected Game object, and what I see is that the button is created as a direct child of the canvas. It get annoying very fast especially for a lazy person like me.
Diagnostics
The problem I found is in the ContextMenu.GetOrCreateCanvasGameObject(). As the name suggest It does gives you back a Game Object With Canvas component in it. But this same function is also been used for finding a parent for the Button RTLTMP. And there lies the issue. Since this method return a Game Object with Canvas component, this is what the code assigns as a parent for the button.
Than there is another question this method is also been used in ContextMenu.PlaceUIElementRoot(). But here we are already checking is the selected Game Object has a Canvas somewhere in it's parent or not. And what we want here is a Canvas in-fact any canvas would work because the user did not selected any of the children of a canvas.
Conclusion
This "Button are not being placed as a child of my selected object" really annoyed me, because I am lazy and did not wated drag the button all the way to my desired GO's child. So I fixed it.
I couple of days I will create a PR after clearing out all the Debug.Log()s and some other small things as well. One more thing that I would like to point out that Current behaviour of creating an object is not completely align with Unity's way of doing this. I am also considering fixing that as well. But I will raise a separate PR for that.
The text was updated successfully, but these errors were encountered:
This is not as big of an issue compare to others that've seen for this project.
The Problem
Let's say you have a screen and you want to add an RTL-TMP Button. You select a Game Object to be it's parent and from the
Game Object>UI
you selectButton-TRLTMP
. I except that the button will be created as a child of the selected Game object, and what I see is that the button is created as a direct child of the canvas. It get annoying very fast especially for a lazy person like me.Diagnostics
The problem I found is in the
ContextMenu.GetOrCreateCanvasGameObject()
. As the name suggest It does gives you back a Game Object With Canvas component in it. But this same function is also been used for finding a parent for theButton RTLTMP
. And there lies the issue. Since this method return a Game Object with Canvas component, this is what the code assigns as a parent for the button.Than there is another question this method is also been used in
ContextMenu.PlaceUIElementRoot()
. But here we are already checking is the selected Game Object has a Canvas somewhere in it's parent or not. And what we want here is a Canvas in-fact any canvas would work because the user did not selected any of the children of a canvas.Conclusion
This "Button are not being placed as a child of my selected object" really annoyed me, because I am lazy and did not wated drag the button all the way to my desired GO's child. So I fixed it.
I couple of days I will create a PR after clearing out all the
Debug.Log()
s and some other small things as well. One more thing that I would like to point out that Current behaviour of creating an object is not completely align with Unity's way of doing this. I am also considering fixing that as well. But I will raise a separate PR for that.The text was updated successfully, but these errors were encountered: