Author Topic: TNManager in a different Scene to RCCs  (Read 2101 times)

Scobbo

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 29
    • View Profile
TNManager in a different Scene to RCCs
« on: April 06, 2014, 07:12:27 AM »
Hi,
I have a connection scene that is shown while the game is connecting to the server, if a it has the TNManager on it, how do I add the RCCs that are on a different object in a different scene? Or can I add the RCCs to that object and then call them from a different scene? And after reading the 1.8.0+ sticky about this subject I am assuming that the call to register RCCs goes like this.
  1. TNManager.addRCCs(GameObject.FindWithTag("controller").GetComponent<ControllerScript>)
  2.  
Or do I have to add the RCC by name aswell?

Cheers,

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNManager in a different Scene to RCCs
« Reply #1 on: April 06, 2014, 01:39:52 PM »
You can register RCCs later by using AddRCCs, yes -- however it's generally a good idea to have the creation logic be present from the beginning -- before joining a scene that uses it.

Scobbo

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 29
    • View Profile
Re: TNManager in a different Scene to RCCs
« Reply #2 on: April 06, 2014, 05:14:44 PM »
Ok, so I can add the RCC without it being in the active scene? How do I find it if it is on an object that hasn't been created yet? Or will it just look through the scripts that are part of the game without the need for them to be attached to an object?

:EDIT:
Better question, does the RCC have to be on a script in the same scene as the call to it or can it be put in the connection scene and still be referenced?
« Last Edit: April 06, 2014, 09:17:20 PM by Scobbo »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNManager in a different Scene to RCCs
« Reply #3 on: April 08, 2014, 01:41:52 AM »
RCCs should generally reference static functions, so it really doesn't matter where you put them. As long as you register them before they're needed, it's all good. TNet also uses static functions for its built-in create calls.