public void SpawnOther(SpawnPackage package) { var o = Instantiate(proxyObject, new Vector3(package.Position[0], package.Position[1] + 0.5f, package.Position[2]), Quaternion.identity); var other = o.GetComponent <OtherPlayer>(); Others.Add(package.Id, other); }
public void Spawn() { var pos = new Vector3(16 + Random.Range(-4, 4), 2, -16 + Random.Range(-4, 4)); Instantiate(playerObject, pos, Quaternion.identity); var package = new SpawnPackage(new [] { pos.x, pos.y, pos.z }); Processor.Send(ServerConnection, package, DeliveryMethod.ReliableOrdered); }
public void SpawnPlayer(SpawnPackage package, NetPeer sender) { for (var index = 0; index < Manager.ConnectedPeerList.Count; index++) { var p = Manager.ConnectedPeerList[index]; if (p.Id == sender.Id) { continue; } package.Id = sender.Id; Processor.Send(p, package, DeliveryMethod.ReliableOrdered); } }