Author Topic: BUG (?): UIPanel destroyed once when instantiated  (Read 6217 times)

helmesjo

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 116
    • View Profile
BUG (?): UIPanel destroyed once when instantiated
« on: April 22, 2014, 02:07:18 AM »
To keep it short, I basically have different kinds of dialogs as prefabs, which are instantiated when displayed. When the prefab is instantiated, it will try to first destroy the panel. I can't find anything in your UIPanel-script, so I'm guessing this is another of Unitys awkward random-things that's just "the way it works". The problem though is when I also have a UIScrollView attached, which requires a panel attached. On instantiate I get of course get this:

Can't remove UIPanel (Script) because UIScrollView (Script) depends on it

and somehow the panel ends up deactivated...

Thoughts? TY!


Edit: Never mind :)
« Last Edit: April 22, 2014, 07:55:04 AM by helmesjo »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: BUG (?): UIPanel destroyed once when instantiated
« Reply #1 on: April 22, 2014, 05:06:55 AM »
Maybe an issue with script execution order? I'm not sure, I've never seen this before. Panels don't get destroyed on instantiation. That would be very odd if they did.

helmesjo

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 116
    • View Profile
Re: BUG (?): UIPanel destroyed once when instantiated
« Reply #2 on: April 22, 2014, 07:16:38 AM »
Ignore this. Found deep down in some older code a fix for when NGUI didn't nest panel-alpha... My bad.