Exemplo n.º 1
0
        public static void ServerSpawn(NetworkEntity toSpawn, NetworkSpawnArgs args)
        {
            Debug.Log("Spawning object with no ownership");

            List <int>        currentIds = objectsManager.spawnedEntities.Keys.Select(key => key.id).ToList();
            NetworkInstanceId id         = new NetworkInstanceId(Identification.GetUniqueIdentifierFromList(currentIds));

            toSpawn.Initialize(-1, id, toSpawn.definitionName, args);

            objectsManager.spawnedEntities.Add(id, toSpawn);

            SpawnCommand spawnCommand = toSpawn.GetSpawnRequest();

            pendingSpawnCommands.Add(spawnCommand);
        }