Welcome,
Guest
. Please
login
or
register
.
February 14, 2025, 06:50:53 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
TNet 3 Support
»
TNObject registration
« previous
next »
Print
Pages: [
1
]
Author
Topic: TNObject registration (Read 1993 times)
ScaryG
Guest
TNObject registration
«
on:
April 01, 2013, 04:32:33 PM »
Is there any reason TNObjects don't call Register() (which assigns them a unique ID) until the Start function? It would be convenient if they registered themselves from Awake so that if I wanted to cache the ID for whatever reason, I could do that in my own component's Start without needing to mess with script execution orders.
I tried calling it myself from TNObject.Awake() and things seemed to work fine, but I thought I should check if there was a reason you're waiting for Start
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: TNObject registration
«
Reply #1 on:
April 01, 2013, 10:47:57 PM »
Because the UID can change after Awake() and before Start().
TNManager instantiates an object, its Awake() gets called, then TNManager sets its ID. If you register it in Awake(), then it won't be using the proper ID.
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
TNet 3 Support
»
TNObject registration