void Start() { //Find and assign script variables pauseMenu = gameObject.GetComponent <GUIPauseMenu> (); optionsMenu = gameObject.GetComponent <GUIOptionsMenu> (); gridScript = (GameObject.Find("Grid Controller")).GetComponent <GridCS> (); gridScript.CreateGrid(); //Tell the grid to spawn //GridCS.Instance.CreateGrid (); //Set the currently loaded layer to the one designated by the grid script LayerSwitcher.Instance.CurrentLayer = GridCS.coreLayer; for (int layer = 0; layer <= GridCS.layerCount; layer++) { if (layer != GridCS.coreLayer) { LayerSwitcher.Instance.HideLayer(layer); } } //Go and find the main camera MainCamera = GameObject.Find("Main Camera").GetComponent <Camera> (); //Assign states, enter into the Insert phase turnState = TurnStates.InsertPhase; menuState = MenuStates.NullState; _EnterInsertPhase(); //Put the Layer Switcher button into the main GUI guiFunction += LayerSwitcher.Instance.GUIFunction; }
void Start() { pauseMenu = gameObject.GetComponent <GUIPauseMenu> (); // as GUIPauseMenu; gameManager = gameObject.GetComponent <GameManager> (); }