Author Topic: Most performant way to show / hide entire panels (in animation)?  (Read 1712 times)

eppz!

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 6
    • View Profile
Hi there,
I have some completion view that is to be presented very often.

Currently I simply Disable the root GameObject, then animation Enables it upon presentation.  :-\

I'm curious if there is some more performant ways of this originating from the engine itself (turn off Panel component? Clip Panel? Move offscreen? Zero alpha?).

Thanks,
NGUI is still more performant than uGUI.

eppz!

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: Most performant way to show / hide entire panels (in animation)?
« Reply #1 on: January 12, 2017, 06:53:09 PM »
Is it the same as UISprite?
Set alpha to zero?
« Last Edit: January 13, 2017, 10:55:59 PM by ArenMook »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Most performant way to show / hide entire panels (in animation)?
« Reply #2 on: January 13, 2017, 10:27:27 PM »
Setting alpha to 0 is going to be the same as disabling the game object, but disabling the game object has the added benefit of effectively stopping script execution on all the game objects underneath. The most efficient thing to do that minimizes the time spent in the next two frames is to move the panel off-screen. The downside is that it will still be drawn, just off-screen. The most efficient thing to do for long-term is to disable the game object. So it kind of depends on what you're trying to do.

eppz!

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: Most performant way to show / hide entire panels (in animation)?
« Reply #3 on: January 14, 2017, 09:28:05 AM »
Thanks for clarification.
I'll sure trade long term efficiency for that two uncomfortable frame > Stick with disabling GameObject.