//public GridObject[,] Board; // Start is called before the first frame update void Start() { foreach (IdObj io in ConvertList) { DictList.Add(io.id, io.gj); } // Board = new GridObject[5, 5]; br = GameObject.Find("BoardObj").GetComponent <BoardClass>(); lc = GetComponent <LevelController>(); SpawnBackground(); br.SpawnWalls(); /*br.SpawnGhoul(1, 1); * br.SpawnPeasant(4,4); * br.SpawnPeasant(5, 4); * br.SpawnPeasant(5, 5); * br.SpawnBlock(5, 6); * br.SpawnBlock(6, 6); * br.SpawnBlock(3, 3);*/ if (!LevelFlag) { br.DestroyGhoul(); br.SpawnRandomPeasants(18); } else { br.SpawnGhoul(4, 4); } UpdateGrid(); br.DebugBoard(); }
private void Awake() { GameBoard = new int[BoardHeight, BoardWidth]; if (instance == null) { instance = this; } else { Destroy(gameObject); return; } DontDestroyOnLoad(gameObject); }