Beispiel #1
0
        public SpawnPoint FetchClosestSpawnPoint()
        {
            var spawnPointIndex = SpawnerUtils.FetchClosestSpawnPoint(_spawnPoints, _lastIndexUsed);

            _lastIndexUsed = spawnPointIndex;
            return(_spawnPoints[spawnPointIndex]);
        }
Beispiel #2
0
        public SpawnPoint FetchRandomSpawnPoint()
        {
            var spawnPointIndex = SpawnerUtils.FetchRandomSpawnPoint(_spawnPoints);

            _lastIndexUsed = spawnPointIndex;
            return(_spawnPoints[spawnPointIndex]);
        }
Beispiel #3
0
        public static bool Spawn(string id, SpawnPoint[] spawnPoints, SpawnDistanceType spawnDistance)
        {
            var spawnPoint = SpawnerUtils.FetchSpawnPoint(spawnPoints, spawnDistance);

            spawnPoint.MarkUse();
            return(Instance.ExecuteSpawn(id, spawnPoint.Position));
        }