void Spawn(LocationEntrance spawnPoint) { PlayerCharacter pc = InstantiatePlayer(spawnPoint.transform); _playerCharacterAnchor.SetReference(pc); spawnPoint.RunPlayerSpawnSequence(pc, HandleSpawnSequencesFinished); }
public void SpawnPlayer() { _spawnPoints = FindObjectsOfType <LocationEntrance>(); LocationEntrance spawnPoint = _defaultSpawnPoint; PathSO pathTaken = _pathTakenManagerAnchor.GetReference().GetPathTaken(); if (pathTaken != null) { foreach (LocationEntrance anEntrance in _spawnPoints) { if (anEntrance.EntrancePath == pathTaken) { spawnPoint = anEntrance; } } } Spawn(spawnPoint); }
void Spawn(LocationEntrance spawnPoint) { PlayerCharacter pc = Instantiate(_playerPrefab, spawnPoint.transform.position, _playerPrefab.transform.rotation); spawnPoint.RunPlayerSpawnSequence(pc, HandleSpawnSequenceFinished); }