mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-03-24 10:44:23 -05:00
- Now check player names for empty strings - Start handling spawn points for levels
46 lines
1018 B
C#
46 lines
1018 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class SpawnPoints : MonoBehaviour {
|
|
|
|
public static SpawnPoints Instance => instance;
|
|
private static SpawnPoints instance;
|
|
|
|
private void Awake() {
|
|
if (instance != null && instance != this) {
|
|
Destroy(gameObject);
|
|
return;
|
|
}
|
|
|
|
instance = this;
|
|
DontDestroyOnLoad(gameObject);
|
|
}
|
|
|
|
/*
|
|
* Level IDs for returning spawn points
|
|
* Mountain - 0
|
|
*
|
|
*/
|
|
|
|
[Header("Mountain")]
|
|
[SerializeField] private Vector3[] runnerSpawnPoints;
|
|
[SerializeField] private Vector3 kingSpawnPoint;
|
|
|
|
public Vector3[] getRunnerSpawnPoints(int levelID) {
|
|
switch(levelID) {
|
|
default:
|
|
case 0:
|
|
return runnerSpawnPoints;
|
|
}
|
|
}
|
|
|
|
public Vector3 getKingSpawnPoint(int levelID) {
|
|
switch (levelID) {
|
|
default:
|
|
case 0:
|
|
return kingSpawnPoint;
|
|
}
|
|
}
|
|
}
|