Esempio n. 1
0
        public void UpdateAfterSpawn()
        {
            // this situation can happen when the client does nto see an object
            // but the object is assigned in a syncvar.
            // this can easily happen during spawn if spawning in an unexpected order
            // or if there is AOI in play.
            // in this case we would have a valid net id, but we would not
            // find the object at spawn time

            var networkIdentitySyncvar = new NetworkIdentitySyncvar
            {
                _objectLocator = client.World,
                _netId         = serverIdentity.NetId,
                _identity      = null,
            };

            Assert.That(networkIdentitySyncvar.Value, Is.SameAs(clientIdentity));
        }
 public static void WriteNetworkIdentitySyncVar(this NetworkWriter writer, NetworkIdentitySyncvar id)
 {
     writer.WritePackedUInt32(id.NetId);
 }