void CmdInitPlayer(NetworkInstanceId _netId) { NetworkMan netMan = GameObject.Find("Network").GetComponent <NetworkMan>(); netMan.EditPlayerId(connectionToClient, _netId); netMan.AddObjectToPlayer(_netId, gameObject); }
void CmdSpawn(NetworkInstanceId _netId) { var obj = (GameObject)Instantiate( prefab_player, transform.position + new Vector3(0, 1, 0), Quaternion.identity); NetworkServer.Spawn(obj); NetworkMan netMan = GameObject.Find("Network").GetComponent <NetworkMan>(); netMan.AddObjectToPlayer(_netId, obj); obj.GetComponent <PlayerNetwork>().idGM = _netId; TargetGetObj(connectionToClient, obj); }