private void OnJoinChannel(int channelID, bool success, string message)
{
Debug.Log(string.Format("network_onJoinChannel: channelID={0} success={1} message={2}", channelID, success, message));
Vector3 pos
= new Vector3
(0,
0,
0); Quaternion rot
= Quaternion
.Euler(new Vector3
(0,
0,
0)); string playername = TNManager.GetPlayerData<string>("CharacterName") + tno.ownerID;
if (manager_instance.isinsetup)
TNManager.Instantiate(1, 99, playerprefabPath, false, pos, rot, playername);
if (manager_instance.isinlobby)
TNManager.Instantiate(2, 99, playerprefabPath, false, pos, rot, playername);
if (manager_instance.isinworld)
TNManager.Instantiate(3, 99, playerprefabPath, false, pos, rot, playername);
}
// Define our remote creation call here with an id of 99
[RCC(99)]
static GameObject CreatePlayer(GameObject prefab, Vector3 pos, Quaternion rot, string pn)
{
// Instantiate the prefab
GameObject go = prefab.Instantiate();
// Set the position and rotation based on the passed values
Transform t = go.transform;
t.position = pos;
t.rotation = rot;
go.name = pn;
return go;
}