public void Awake() { if (Instance == null) { Instance = this; } else { Destroy(this); } }
// Use this for initialization void Start() { UnlockedLevelCount = LoadUnlockedCount(); gameObjects = new List <GameObject>(); menuScript = gameObject.GetComponent <MenuScript>(); guiScript = gameObject.AddComponent <GuiScript>(); gridScript = gameObject.AddComponent <GridScript>(); levelScript = gameObject.AddComponent <LevelsScript>(); levelCount = LevelsScript.LEVEL_COUNT; SetGameGrid(GRID_DIMENSION, GRID_DIMENSION, gamePanel); SetMenu(); }