Author Topic: OnFinished removed after LoadLevel  (Read 2367 times)

EmilEkdahl

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 2
    • View Profile
OnFinished removed after LoadLevel
« on: July 31, 2014, 11:34:51 AM »
Greetings.

I have a slight issue with the UI Play Tween.
The OnFinished Script gets removed after a LevelLoad, for instance between Start Menu and Game, back to start.

As can be seen in the attached image,
they are from the exact same object, one is on Initial Start Menu (The way it should be.) and the other is after going to the Game Level and back to Start Menu.

Is it supposed to be this way?
Am i doing something wrong?

Unity 4.5.2f1
NGUI 3.6.8
« Last Edit: July 31, 2014, 11:53:45 AM by EmilEkdahl »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: OnFinished removed after LoadLevel
« Reply #1 on: July 31, 2014, 12:28:10 PM »
What do you mean by "same exact object"? References like that can only be kept if they are on the same prefab. Referencing anything outside the prefab won't work.

EmilEkdahl

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: OnFinished removed after LoadLevel
« Reply #2 on: July 31, 2014, 12:44:02 PM »
Oh, wow, I totally didn't know that.

That is it, i will have to rework that part.
It's a static object, but it's not in the Game-Object prefab, it's just dragged there in the Scene.