public void Reset() { // creates .observers and generates a netId identity.StartServer(); identity.ConnectionToClient = new NetworkPlayer(tconn42); identity.observers.Add(new NetworkPlayer(tconn42)); // mark for reset and reset identity.Reset(); Assert.That(identity.NetId, Is.EqualTo(0)); Assert.That(identity.ConnectionToClient, Is.Null); }
void UnSpawn(NetworkIdentity identity) { Guid assetId = identity.AssetId; identity.StopClient(); if (unspawnHandlers.TryGetValue(assetId, out UnSpawnDelegate handler) && handler != null) { handler(identity); } else if (identity.sceneId == 0) { Destroy(identity.gameObject); } else { identity.Reset(); identity.gameObject.SetActive(false); spawnableObjects[identity.sceneId] = identity; } Client.World.RemoveIdentity(identity); }