Closed demonixis closed 8 years ago
Sorry for leaving this hanging. Looks OK to me and doesn't break anything. Can you provide a simple test case for how you discovered there was an issue? Were you working on input?
Hi,
The first thing is you can't use a constructor in a MonoBehaviour
because Unity doesn't allow/recommand it.
Finally, I've created an InputManager for OSVR and I create some InterfaceGameObjectBase
at runtime. The InterfaceGameObjectBase
script requires the path of the interface but the AdvertisePath()
method is called in the Awake
method. So if I create a script at runtime, I don't have the time to pass the path and this method is called, resulting to a crash.
That's all ;-)
Yea, I haven't seen a monobehaviour constructor before. Will merge this in soon with the other updates. Thanks.
MonoBehaviour
's contructorAdvertisePath
on Awake, but on Start. If you attach a script to aGameObject
, the Awake method is called, so you haven't the time to change the path of the interface.