-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unknown parent #3
Comments
Can confirm issue. I'm also having problems even with default json code what are inside CommunityEntity.UI.cs. When run default code first time - everything ok, button have text and all works. But after close it and open again - i'm getting in console "AddUI: Unknown parent: Button88", and button don't have text anymore. After reconnect to server you again can see text on button first time, but not second etc. |
Confirmed as well. |
Also confirm that the problem. |
Agree with that! Need to be fixed! |
Further investigation shows that the UI is not properly being destroyed at all. I did some testing on the naming of each component and it seems that if you generate a random name every time the server sends the UI it will 100% always show up. So instead calling it something static such as "TestPanel7766" you should make it unique every time it gets called like "TestPanel7766" | "TestPanel7767" | "TestPanel7768" and so on. This is only a temp solution for those that requires it to work asap. |
Latest update haven't fixed this error. |
I made a Pull Request to fix the issue but was turned down so lets hope they can find a similar fix at least! :) |
@garrynewman Will this be ever fixed? :) |
@virtyvoid This is not directly a 'real' memory leak. The list that stores the GameObject of each UI component is not being removed from the list. The reason for generating a random name with every UI call is because the list already has the old name stored. |
@ZuenTheMan Well, thanks for clarifying, i've read your article too. |
This issue is fixed with my PR, tested it in Unity already |
You have more of a rewrite all the original code instead of fixing the single dictionary list that is causing the issue. Also why change how the current JSON works? UI can easily be nested under parent UI by using "name" and "parent". [edit] |
The way it was stored made no sense, had to completely change it Commented about your issue on the PR |
Latest updates broke my UI.. I have problems with error 'Unknown parent'. My json:
[
{
"name": "MainPanel",
"components": [
{
"type": "UnityEngine.UI.Image"
},
{
"type": "RectTransform",
"anchormin": "0.2 0.2",
"anchormax": "0.8 0.8"
}
]
},
{
"name": "ActivePanel",
"parent": "MainPanel",
"components": [
{
"type": "UnityEngine.UI.Button",
"command": "....."
},
{
"type": "RectTransform",
"anchormin": "0.2 0.2",
"anchormax": "0.8 0.8"
}
]
},
{
"name": "TitlePanel",
"parent": "ActivePanel",
"components": [
{
"type": "UnityEngine.UI.Text",
"text": ".....",
"align": "MiddleCenter",
"fontSize": 32
}
]
}
]
Error: 'AddUI: Unknown parent: ActivePanel'
P.S. It's not real json (real is too big), but an example.
Previously all was okay, but with new updates it's not working.
The text was updated successfully, but these errors were encountered: