예제 #1
0
        /// <inheritdoc />
        public INetworkPlayer CreateEntity(int id)
        {
            Transform spawnpoint = SpawnPointStrategy.GetSpawnpoint();

            if (spawnpoint == null)
            {
                throw new InvalidOperationException($"The {this.GetType().Name} tried to load a spawnpoint from {nameof(SpawnPointStrategy)} but the point was null.");
            }

            return(CreateEntity(id, spawnpoint.position, spawnpoint.rotation));
        }
예제 #2
0
        public IEntitySpawnResults TrySpawnEntity(ISpawnContext context)
        {
            //Grabs a spawn point from the spawn point service.
            Transform spawnTransform = playerSpawnStrategy.GetSpawnpoint();

            return(this.TrySpawnEntity(spawnTransform.position, spawnTransform.rotation, context));
        }