Author Topic: Property Binding  (Read 2632 times)

swilskey

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Property Binding
« on: July 20, 2014, 02:10:13 PM »
I am using property binding to connect a bool to a tween position.enabled. The source is a time and score script that sets the bool if the player completes the level under a certain time. I am having to set the gameobject that the script is attached to on every level and am wondering if there is a way that I set this once make the UI a prefab and then just add the prefab to every level instead of having to set the source on every level.

Thanks

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Property Binding
« Reply #1 on: July 20, 2014, 06:33:47 PM »
Prefabs can only reference values that are a part of the prefab. If you reference some external value, the reference will be broken. Think about it -- prefabs are completely stand-alone self-contained objects.

swilskey

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: Property Binding
« Reply #2 on: July 20, 2014, 07:19:58 PM »
That makes Sense. Just trying to find a better way to do the binding so that I don't have to set the values for each scene. Thanks for the help.