Tasharen Entertainment Forum
Support => TNet 3 Support => Topic started by: droweed on February 25, 2014, 04:41:22 AM
-
Just purchased TNet cause our project currently requires it.
I created a quick start->connect->join channel->new scene->disconnect->stop server flow using ngui.
now the problem occurs not on first flow, but on the second round.
I'm using UIButton script for the buttons, and just add a notify on click, but it seems on the second round, the delegates are no longer there, its its just a blank on click..
I think I may be missing something very obvious here.. any help would be really appreciated.
-
This sounds like an NGUI question rather than a TNet question. How are you adding the delegate?
-
This sounds like an NGUI question rather than a TNet question. How are you adding the delegate?
Ahh sorry, I'll move this query to NGUI thread, but currently just using the editor drag and drop, on the onclick for the UIButton script.
-
If one object is persistent and another is not, references will get broken when you switch scenes.
-
Yeah, I guess I'll just have to remove the UIButton script, and just let it handle OnClick() {} instead via another script attached on that button.
Just wanna ask would that be the best approach or, re-assign the delegates once the scene is loaded again.
-
I'd have the button have a script on it that did something rather than setting its delegate. As long as the script has the "void OnClick ()" function, it'll be called as expected.
-
Yep thought so, thanks for the quick response.