/// <summary> /// Spawns the character at the selected entry point if there's one, or at the selected checkpoint. /// </summary> protected virtual void RegularSpawnSingleCharacter() { PointsOfEntryStorage point = GameManager.Instance.GetPointsOfEntry(SceneManager.GetActiveScene().name); if (point != null) { Players[0].RespawnAt(PointsOfEntry[point.PointOfEntryIndex], Character.FacingDirections.Right); return; } if (CurrentCheckPoint != null) { CurrentCheckPoint.SpawnPlayer(Players[0]); return; } }
/// <summary> /// Spawns a playable character into the scene /// </summary> protected virtual void SpawnSingleCharacter() { // in debug mode we spawn the player on the debug spawn point #if UNITY_EDITOR if (DebugSpawn != null) { DebugSpawn.SpawnPlayer(Players[0]); return; } else { RegularSpawnSingleCharacter(); } #else RegularSpawnSingleCharacter(); #endif }