private void UnregisterCustomSpawners()
 {
     foreach (NetworkHash128 assetId in _assetIdToPrefab.Keys)
     {
         ClientScene.UnregisterSpawnHandler(assetId);
     }
 }
        public void RemovesSpawnHandlersFromDictionary()
        {
            spawnHandlers.Add(validPrefabGuid, new SpawnHandlerDelegate(x => null));

            ClientScene.UnregisterSpawnHandler(validPrefabGuid);

            Assert.IsFalse(unspawnHandlers.ContainsKey(validPrefabGuid));
        }
Exemplo n.º 3
0
        public void UnregisterSpawnHandler_RemovesUnSpawnHandlersFromDictionary()
        {
            unspawnHandlers.Add(validPrefabGuid, new UnSpawnDelegate(x => { }));

            ClientScene.UnregisterSpawnHandler(validPrefabGuid);

            Assert.IsFalse(unspawnHandlers.ContainsKey(validPrefabGuid));
        }
Exemplo n.º 4
0
 private void UnregisterCustomSpawners()
 {
     foreach (NetworkHash128 assetId in assetIdToPrefab.Keys)
     {
         Debug.Log("Unregister assetId " + assetId.ToString());
         ClientScene.UnregisterSpawnHandler(assetId);
     }
 }
        public void DoesNotRemovePrefabDictionary()
        {
            prefabs.Add(validPrefabGuid, validPrefab);

            ClientScene.UnregisterSpawnHandler(validPrefabGuid);

            // Should not be removed
            Assert.IsTrue(prefabs.ContainsKey(validPrefabGuid));
        }
 /// <summary>
 /// Unregister a spawnhandler on the client
 /// </summary>
 /// <param name="spawnData">Spawn data.</param>
 protected virtual void UnregisterSpawnHandlerOnClient(SpawnHandlerData spawnData)
 {
     if (spawnData.serverPrefab == null)
     {
         Debug.LogWarning("No serverPrefab set for spawnHandler!");
         return;
     }
     ClientScene.UnregisterSpawnHandler(spawnData.serverPrefab.GetComponent <NetworkIdentity>().assetId);
 }