private void SendRemoteInstanceToServer(int index, string tag, int layer, Vector3 pos, Quaternion rot) { RemoteInstanceMessage msg = new RemoteInstanceMessage (); msg.index = index; msg.tag = tag; msg.layer = layer; msg.position = pos; msg.rotation = rot; NetworkManager.singleton.client.Send (RemoteInstanceMsg, msg); }
private void RemoteInstance(NetworkConnection conn, RemoteInstanceMessage msg) { Transform inst = InstantiateInternal (msg.index, msg.tag, msg.layer, msg.position, msg.rotation); SendRemoteInstanceToClients (msg.index, msg.tag, msg.layer, msg.position, msg.rotation); Debug.Log ("RemoteInstance Spawning " + inst.gameObject.name + " with client authority " + conn); NetworkServer.SpawnWithClientAuthority (inst.gameObject, conn); }