29 lines
890 B
C#
29 lines
890 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Level : MonoBehaviour{
|
|
|
|
public Grid[] grids;
|
|
|
|
public static Level instance;
|
|
void Awake(){
|
|
instance = this;
|
|
}
|
|
|
|
void Start(){
|
|
if(GameMaster.instance.grids != null){
|
|
for (int i = 0; i < grids.Length; i++){
|
|
grids[i].unlocked = GameMaster.instance.grids[i];
|
|
grids[i].enemy = (Grid.Enemy)GameMaster.instance.enemyType[i];
|
|
}
|
|
}else{
|
|
GameMaster.instance.grids = new Dictionary<int, bool>();
|
|
GameMaster.instance.enemyType = new Dictionary<int, int>();
|
|
for (int i = 0; i < grids.Length; i++){
|
|
GameMaster.instance.grids.Add(i, grids[i].unlocked);
|
|
GameMaster.instance.enemyType.Add(i, (int)grids[i].enemy);
|
|
}
|
|
}
|
|
}
|
|
}
|