Author Topic: All NGUI objects isn't rendering after scene switching  (Read 2377 times)

Markov

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 27
    • View Profile
All NGUI objects isn't rendering after scene switching
« on: September 07, 2014, 10:19:33 PM »
Hello. I randomly run into a bug after switching scenes. And when it occurs - nothing's rendering in bugged UIPanel.
After a little investigation I find out that it's happening because one of the UIPanels receives UIPanel.LateUpdate() after it's been destroyed.
  1. MissingReferenceException: The object of type 'UIPanel' has been destroyed but you are still trying to access it.
  2. Your script should either check if it is null or you should not destroy the object.
  3. UnityEngine.Component.get_transform ()
  4. UIRect.get_cachedTransform () (at Assets/NGUI/Scripts/Internal/UIRect.cs:198)
  5. UIPanel.UpdateTransformMatrix () (at Assets/NGUI/Scripts/UI/UIPanel.cs:982)
  6. UIPanel.UpdateSelf () (at Assets/NGUI/Scripts/UI/UIPanel.cs:1183)
  7. UIPanel.LateUpdate () (at Assets/NGUI/Scripts/UI/UIPanel.cs:1144)
« Last Edit: September 07, 2014, 11:30:50 PM by Markov »

Markov

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 27
    • View Profile
Re: All NGUI objects isn't rendering after scene switching
« Reply #1 on: September 07, 2014, 11:42:24 PM »
Solved!
It happens when UIWidget and UIPanel are on one object.
You should make a warning about it.
« Last Edit: September 08, 2014, 02:03:09 AM by Markov »

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: All NGUI objects isn't rendering after scene switching
« Reply #2 on: September 08, 2014, 10:39:23 AM »
You didn't see the giant LogError down in the console? :)

Markov

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 27
    • View Profile
Re: All NGUI objects isn't rendering after scene switching
« Reply #3 on: September 08, 2014, 11:16:19 AM »
Ha-ha I saw it but didn't know how to fix :)