Welcome,
Guest
. Please
login
or
register
.
April 21, 2026, 12:00:29 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Multiple UI Root added on ApplicationLoad of same scene
« previous
next »
Print
Pages: [
1
]
Author
Topic: Multiple UI Root added on ApplicationLoad of same scene (Read 6821 times)
zenmaster
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 20
Multiple UI Root added on ApplicationLoad of same scene
«
on:
August 13, 2014, 12:53:14 PM »
Hi All,
We reset the game by reloading the same scene. After several resets, our screen goes grey.
We found 4 UI Roots in the game? 3 of which were the default ones. We are unable to reliably repeat this problem.
Thanks,
Kevin
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Multiple UI Root added on ApplicationLoad of same scene
«
Reply #1 on:
August 14, 2014, 07:01:25 AM »
All I can suggest is make sure you have the latest version of NGUI. Beyond that I'd need more info if I was to be of any help.
Logged
zenmaster
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 20
Re: Multiple UI Root added on ApplicationLoad of same scene
«
Reply #2 on:
February 22, 2016, 10:35:35 PM »
Happens with all versions of NGUI.
Never solved it but our hack worked until this week.
We named our 2d Gui camera "UI Root-init-game"
GameObject nguiRootGO = GameObject.Find("UI Root" );
if( nguiRootGO != null ) {
GameObject.DestroyImmediate( nguiRootGO );
Debug.Log( "GameObject.DestroyImmediate( nguiRootGO )" );
}
Now the added UI Root is inactive so it doesn't find it.
Our GUI camera is not being displayed when this default UI Root is added.
If we name ours "UI Root", it removes our camera when the mysterious default "UI Root" is added.
It feels like when you add a NGUI component and it adds a UI Root for you if it didn't appear in Hierarchy?
Logged
zenmaster
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 20
Re: Multiple UI Root added on ApplicationLoad of same scene
«
Reply #3 on:
February 23, 2016, 12:33:08 AM »
Put a breakpoint at NGUITools
GameObject go = NGUITools.AddChild(null, false);
This was called from our.
void
OnDestroy
(
)
{
Debug
.
Log
(
"Removing this stops the UI Roots from being created?"
)
;
liveWellModel
.
ChangeInContents
-=
changeInContentsHandler
;
/*
foreach( FishView view in fishViews ) {
// Destroy( view.gameObject );
// forum says it takes care of unparenting too
NGUITools.Destroy( view.gameObject );
} */
}
NO UI Roots created when comment out.
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Multiple UI Root added on ApplicationLoad of same scene
«
Reply #4 on:
February 25, 2016, 09:44:14 PM »
NGUI's widgets look for a panel on a parent object. If there is no panel, NGUI will create a UI for you.
Bottom line is, ensure you actually are adding the widget to something that has a panel above it.
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Multiple UI Root added on ApplicationLoad of same scene