Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: RedvelGames on September 01, 2016, 07:30:37 AM

Title: Refresh Problem
Post by: RedvelGames on September 01, 2016, 07:30:37 AM
Hi!


We're having a weird problem. As you can see in the video, we press the K_End green button (lower-right corner of the screen), and after a black loading screen, a new scene is loaded and a new GUI appears with a background full of grass and two t-shirts in the upper side. This last GUI is incomplete, if we minimize the game and then we resume it again, the rest of the GUI appears (a grey box full of widgets over the background and behind the t-shirts). We don't have this problem in the Unity editor, only in Android mobile devices (we haven't tested this on iOS yet) and this only happens the first time after a fresh start of the game (this doesn't happen if we resume it).

We only have one camera to render the GUI (in a scene which is never unloaded or destroyed), we don't deactivate it or destroy/instantiate it at runtime.

What can we do to solve this? any hints?

Thanks in advance!
Title: Re: Refresh Problem
Post by: ArenMook on September 03, 2016, 01:59:55 AM
Is the camera set to clear color?

P.S. Your video link doesn't work.
Title: Re: Refresh Problem
Post by: RedvelGames on September 05, 2016, 03:58:39 AM
Hi, yes i have other camera clear color and same bug.

Title: Re: Refresh Problem
Post by: ArenMook on September 05, 2016, 08:27:19 AM
Do you instantiate the UI off-screen somewhere? Do you tween its scale from zero? Need more details here as to how it's created.
Title: Re: Refresh Problem
Post by: RedvelGames on September 05, 2016, 11:19:46 AM
We are not instantiate or using tweens, only use SceneManager.LoadSceneAsync in additive.  :-\
Title: Re: Refresh Problem
Post by: RedvelGames on September 06, 2016, 05:24:48 AM
Fixed with this :

  1.  foreach(var dc in UIDrawCall.activeList)
  2.             {
  3.                 SceneManager.MoveGameObjectToScene(dc.gameObject, scene);
  4.             }
  5.  
  6.             foreach (var dc in UIDrawCall.inactiveList)
  7.             {
  8.                 SceneManager.MoveGameObjectToScene(dc.gameObject, scene);
  9.             }

It is not a good solution, but it works. Also report Unity this "Bug" with its SceneManager.

via : http://www.tasharen.com/forum/index.php?topic=13965.0