Author Topic: Force camera redraw (show loading graphic before level load)  (Read 6803 times)

Shifty Geezer

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 9
  • Posts: 226
    • View Profile
I'm wanting to show a graphic while the next level loads. Problem is drawing stops the moment I call "LoadLevel". Is there a way to force NGUI to redraw before the next line of code is executed?

  1.         public void ButtonPressCareer(){
  2.                 if(canPlayCareer){
  3.                         loadingGraphic.SetActive (true);
  4.                         FORCE_NGUI_DRAW
  5.                         Application.LoadLevel ("club");
  6.                 }
  7.         }

Holy Manfred

  • Jr. Member
  • **
  • Thank You
  • -Given: 1
  • -Receive: 8
  • Posts: 71
    • View Profile
Re: Force camera redraw (show loading graphic before level load)
« Reply #1 on: May 13, 2016, 10:30:18 AM »
You can just delay the level loading by a frame or use an Invoke or something...

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Force camera redraw (show loading graphic before level load)
« Reply #2 on: May 14, 2016, 06:37:54 PM »
Yeah, I'd also suggest using LoadLevelAsync instead. LoadLevel will stop there, waiting for the level to load, freezing the entire application. That's not a good way to go. LoadLevelAsync lets you keep drawing the scene, showing a loading bar or something similar.