public void setRemoveAllAndClearButtons() { //show the appropriate remove-all and clear buttons. You can have either one, or both turned on removeAllAndClearButtons.SetActive(false); onlyRemoveAllButton.SetActive(false); onlyClearButton.SetActive(false); removeAllOfNumberButton = onlyRemoveAllButton.transform.GetChild(0).gameObject; clearPuzzleButton = onlyClearButton.transform.GetChild(0).gameObject; if (!StaticVariables.isTutorial) { if (StaticVariables.includeRemoveAllOfNumber && StaticVariables.includeClearPuzzle) { removeAllOfNumberButton = removeAllAndClearButtons.transform.Find("Remove All").gameObject; clearPuzzleButton = removeAllAndClearButtons.transform.Find("Clear Puzzle").gameObject; removeAllAndClearButtons.SetActive(true); } else if (StaticVariables.includeRemoveAllOfNumber) { onlyRemoveAllButton.SetActive(true); } else if (StaticVariables.includeClearPuzzle) { onlyClearButton.SetActive(true); } } InterfaceFunctions.colorPuzzleButton(removeAllOfNumberButton); InterfaceFunctions.colorPuzzleButton(clearPuzzleButton); }
public void setUndoRedoButtons() { //show the undo and redo buttons if they are toggled on InterfaceFunctions.colorPuzzleButton(undoRedoButtons.transform.Find("Undo")); InterfaceFunctions.colorPuzzleButton(undoRedoButtons.transform.Find("Redo")); undoRedoButtons.SetActive(StaticVariables.includeUndoRedo); }
private void colorMenuButton() { //apply the current skin colors to the menu button if (!StaticVariables.isTutorial) { InterfaceFunctions.colorPuzzleButton(menuButton); } }
public void disselectBuildAndNotes() { //select the clear tile button and disselect the others InterfaceFunctions.colorPuzzleButton(buildButton); if (includeNote1Btn) { InterfaceFunctions.colorPuzzleButton(note1Button); } if (includeNote2Btn) { InterfaceFunctions.colorPuzzleButton(note2Button); } InterfaceFunctions.colorPuzzleButton(clearTileButton); }
private void disselectNumber(GameObject btn) { //color chosen the number button to the "off" coloration from the current skin InterfaceFunctions.colorPuzzleButton(btn, skin); }
private void Start() { //choose which skin to use skin = StaticVariables.skin; if (StaticVariables.isTutorial) { skin = basicSkin; } //set up the fade-in timer if (StaticVariables.isFading && StaticVariables.fadingTo == "puzzle") { fadeTimer = fadeInTime; } blackSprite = blackForeground.GetComponent <SpriteRenderer>(); winPopupScale = winCanvas.transform.GetChild(1).localScale.x; size = StaticVariables.size; includeNote1Btn = StaticVariables.includeNotes1Button; includeNote2Btn = StaticVariables.includeNotes2Button; ColorUtility.TryParseHtmlString(skin.mainMenuButtonExterior, out winBackgroundColorExterior); ColorUtility.TryParseHtmlString(skin.mainMenuButtonInterior, out winBackgroundColorInterior); hideNumberButtons(); colorMenuButton(); if (StaticVariables.isTutorial) //set up the tutorial. uses tutorialmanager { originalPuzzleScale = puzzlePositioning.transform.localScale.x; setTutorialNumberButtons(); tutorialCanvas.SetActive(true); puzzleCanvas.SetActive(false); //hide menu button if it is your first time playing the tutorial tutorialCanvas.transform.Find("Menu").gameObject.SetActive(StaticVariables.hasBeatenTutorial); tutorialManager = new TutorialManager(); tutorialManager.gameManager = this; tutorialManager.startTutorial(); } else if (!StaticVariables.isTutorial) //continue with the puzzle generation and setup { tutorialCanvas.SetActive(false); puzzleCanvas.SetActive(true); //load a puzzle if you already have one saved, otherwise generate a new one based on the size if (StaticVariables.hasSavedPuzzleState) { puzzleGenerator.restoreSavedPuzzle(StaticVariables.puzzleSolution, size); loadPuzzleStates(); } else { puzzleGenerator.createPuzzle(size); selectedNumber = size; //you automatically start with the highest building size selected clickTileAction = "Apply Selected"; } //set up the visuals of the screen based on the puzzle size and what tools you have unlocked drawFullPuzzle(); setRemoveAllAndClearButtons(); setNumberButtons(); highlightSelectedNumber(); if (clickTileAction == "Clear Tile") { disselectNumber(prevClickedNumButton); } hidePositioningObjects(); setSelectionModeButtons(); setUndoRedoButtons(); highlightBuildType(); //apply the current skin puzzleBackground.GetComponent <SpriteRenderer>().sprite = skin.puzzleBackground; InterfaceFunctions.colorPuzzleButton(winCanvas.transform.Find("Win Popup").Find("Menu")); InterfaceFunctions.colorPuzzleButton(winCanvas.transform.Find("Win Popup").Find("Another Puzzle")); InterfaceFunctions.colorPuzzleButton(winCanvas.transform.Find("Win Popup").Find("Shop")); winCanvas.transform.Find("Win Popup").Find("Win Popup Background Exterior").GetComponent <SpriteRenderer>().color = winBackgroundColorExterior; winCanvas.transform.Find("Win Popup").Find("Win Popup Background Interior").GetComponent <SpriteRenderer>().color = winBackgroundColorInterior; //set up the win popup process Color c = winCanvas.transform.Find("Black Background").GetComponent <SpriteRenderer>().color; c.a = fadeToWinDarknessRatio; winCanvas.transform.Find("Black Background").GetComponent <SpriteRenderer>().color = c; showCorrectCityArtOnWinScreen(); int coins = 0; switch (size) { case 3: coins = coinsFor3Win; break; case 4: coins = coinsFor4Win; break; case 5: coins = coinsFor5Win; break; case 6: coins = coinsFor6Win; break; } int onesDigit = coins % 10; int tensDigit = (coins / 10) % 10; coinsBox1s.GetComponent <SpriteRenderer>().sprite = numberSprites[onesDigit]; coinsBox10s.GetComponent <SpriteRenderer>().sprite = numberSprites[tensDigit]; //set the first puzzle state, and you are ready to start playing! currentPuzzleState = new PuzzleState(puzzleGenerator); } }