fixed
This commit is contained in:
@@ -4,6 +4,7 @@ using UnityEngine;
|
||||
|
||||
public class LevelGenerator : MonoBehaviour
|
||||
{
|
||||
public static LevelGenerator instance{get; private set;}
|
||||
[SerializeField]private GameObject LevelPrefab;
|
||||
[SerializeField]private GameObject TopPrefab;
|
||||
private List<GameObject> spawnedLevels = new List<GameObject>();
|
||||
@@ -13,17 +14,22 @@ public class LevelGenerator : MonoBehaviour
|
||||
[SerializeField]private float maxHigh;
|
||||
|
||||
[SerializeField]private List<float> Levels;
|
||||
|
||||
void Awake(){
|
||||
instance = this;
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
GenerateAhead(150);
|
||||
}
|
||||
|
||||
|
||||
public void GenerateAhead(int count = 10){
|
||||
if(Levels.Count <= 0){
|
||||
Levels = new List<float>();
|
||||
}
|
||||
Levels.Add(1);
|
||||
|
||||
}
|
||||
int startIndex= Levels.Count;
|
||||
int lastIndex = Levels.Count +count;
|
||||
for(int i =startIndex; i < lastIndex; i++){
|
||||
|
||||
Reference in New Issue
Block a user