Ejemplo n.º 1
0
        public GameObject ServerSideSpawn(GameObject prefab, Vector3 position, object instanceConfig, byte channelId = 0)
        {
            var spawner = GetServerSpawnerForPrefab(prefab);
            var message = new TeleportSpawnMessage(spawner, position, instanceConfig);

            SendToAllClients(message, channelId);
            return(message.SpawnedObject);
        }
Ejemplo n.º 2
0
        private GameObject ServerSideSpawnRetroactiveForClient(uint clientId, GameObject instance, byte channelId = 0)
        {
            var spawner        = GetServerSpawnerForInstance(instance);
            var instanceConfig = spawner.GetConfigForLiveInstance(instance);
            var message        = new TeleportSpawnMessage(spawner, instance, instanceConfig);

            SendToClient(clientId, message, channelId);
            return(message.SpawnedObject);
        }
        public void ServerSideSpawnForClient(ushort instanceId, uint clientId)
        {
            var instance       = _instanceByInstanceId[instanceId];
            var instanceConfig = GetConfigForLiveInstance(instance);
            var message        = new TeleportSpawnMessage(this, instance, instanceConfig);

            MarkInstanceAsSpawnedForClient(instanceId, clientId);
            TeleportManager.Main.SendToClient(clientId, message);
        }