Author Topic: Issue with LoadLevelAdditive  (Read 6034 times)

Noi14

  • Jr. Member
  • **
  • Thank You
  • -Given: 10
  • -Receive: 0
  • Posts: 57
    • View Profile
Issue with LoadLevelAdditive
« on: February 28, 2014, 01:57:52 PM »
I need to load an extra scene (Called "loading") at the "base" scene using: Application.LoadLevelAdditive("loading");
When I set it as:
void Start()
{
Application.LoadLevelAdditive("loading");
}
there is a moment that the added scene is not load, and I see the basic scene. This is very annoying.
If I do:
void Awake()
{
Application.LoadLevelAdditive("loading");
}
NGUI graphics of "basic" scene is in low quality, but I solve the problem of the moment when I see only the basic scene.
There is the same problem(low quality on ngui of basic scene) when I launch Application.LoadLevelAdditive in the previous scene, putting the NGUI panel of the "loading" scene

with DontDestroyOnLoad(gameObject);

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Issue with LoadLevelAdditive
« Reply #1 on: February 28, 2014, 05:58:07 PM »
I'm not sure if there is a question in there somewhere?

Doing level loading in Awake() is a bad idea. Whatever the script is attached to hasn't finished loading yet. You need to yield WaitForEndOfFrame at least, or just do it in the Update.

Noi14

  • Jr. Member
  • **
  • Thank You
  • -Given: 10
  • -Receive: 0
  • Posts: 57
    • View Profile
Re: Issue with LoadLevelAdditive
« Reply #2 on: March 01, 2014, 04:33:08 AM »
Thank you.
I don't understand why I have that problem(Bad NGUI sprites quality) also when I using DontDestroyOnLoad(gameobeject);  to load in the previous scene, in order to when I'm doing access to scene "base" there will be "loading" already loaded

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Issue with LoadLevelAdditive
« Reply #3 on: March 01, 2014, 08:54:52 PM »
All NGUI does is draws things using a texture. NGUI never reduces the quality of textures on anything. Only your project settings can affect texture quality (being set to 'fastest' for example). Aside from that, I have no idea.

Noi14

  • Jr. Member
  • **
  • Thank You
  • -Given: 10
  • -Receive: 0
  • Posts: 57
    • View Profile
Re: Issue with LoadLevelAdditive
« Reply #4 on: March 02, 2014, 12:38:36 PM »
I've solved problem using GameObject.Find ("LoadingCamera").GetComponent< Camera > ().enabled = false;

If I disable camera the problem no occurs, if I also destroy UI ROOT I will have that problem.  :-\