Author Topic: UIButton On Click Notify clears on Prefab?  (Read 2038 times)

stevej

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 117
    • View Profile
UIButton On Click Notify clears on Prefab?
« on: March 30, 2014, 03:58:52 AM »
Noticed that if you prefab a part of the UI which has UIButtons with the "On Click Notify" filled in (i.e. a MonoBehaviour), that link gets severed when you instantiate that part of the UI back in.

Is that a bug or just an unfortunate side effect?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIButton On Click Notify clears on Prefab?
« Reply #1 on: March 30, 2014, 07:36:29 AM »
Prefabs can't keep references to anything outside of the prefab.

stevej

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 117
    • View Profile
Re: UIButton On Click Notify clears on Prefab?
« Reply #2 on: March 30, 2014, 06:20:58 PM »
Prefabs can't keep references to anything outside of the prefab.

Yeah, it makes total sense I guess, but it's a pain. Oh well, already working around it so it's all good :)

pretender

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 155
    • View Profile
Re: UIButton On Click Notify clears on Prefab?
« Reply #3 on: March 31, 2014, 04:37:32 AM »
It does keep reference to reference atlas or font in the prefab even reference atlas or font is not in the same prefab