/* * Handles drawing the correct zyme popup and pausing the game * while the popup is active. */ void OnGUI() { if (showTutorialPart1) { zymeScript.setDraw(true); zymeScript.setImage(zymePopupImageFats1); Time.timeScale = .01f; } if (showTutorialPart2 && part1Done) { zymeScript.setDraw(true); zymeScript.setImage(zymePopupImageFats2); GUI.DrawTexture(new Rect(.3f * Screen.width, .62f * Screen.height, .45f * Screen.width, .3f * Screen.height), arrow); Time.timeScale = .01f; } }
void OnGUI() { if (PlayerPrefs.GetInt("SITowerPlaceTutorial") == 1) { if (PlayerPrefs.GetInt("SIStats_towersPlaced") == 0) { GUI.DrawTexture(new Rect(.25f * Screen.width, .1f * Screen.height, .3f * Screen.width, .85f * Screen.height), arrow); } if (stopForZyme) { zymeScript.setDraw(true); zymeScript.setImage(zymePopupImage1); Time.timeScale = .01f; } if (stopForZyme && !startSecondTimer && PlayerPrefs.GetInt("SIStats_towersPlaced") == 1) { stopForZyme = false; actualArrowTime = 0f; startSecondTimer = true; zymeScript.setDraw(false); } if (PlayerPrefs.GetInt("SIStats_towersPlaced") == 1) { GUI.DrawTexture(new Rect(.3f * Screen.width, .62f * Screen.height, .25f * Screen.width, .30f * Screen.height), arrow); } if (stopForZyme && startSecondTimer && actualArrowTime > maxArrowTime) { zymeScript.setDraw(true); zymeScript.setImage(zymePopupImage2); Time.timeScale = .01f; } if (stopForZyme && PlayerPrefs.GetInt("SIStats_towersPlaced") == 2) { stopForZyme = false; zymeScript.setDraw(false); } } }
void OnGUI() { if (tutorialReady) { if (showTutorial) { zymeScript.setDraw(true); zymeScript.setShowButton(true); zymeScript.setImage(zymePopupImage); Time.timeScale = .01f; } } }
void OnGUI() { if (showTutorial) { zymeScript.setDraw(true); zymeScript.setImage(zymePopupImage); Time.timeScale = .01f; // circle nutrients text GUI.DrawTexture(new Rect(.32f * Screen.width, .8f * Screen.height, .2f * Screen.width, .1f * Screen.height), circle); GUI.DrawTexture(handRectangle, finger); } }
// draw the zyme pop up box and the circle void OnGUI() { if (showTutorial) { zymeScript.setDrawZymeLeft(); zymeScript.setImage(zymePopupImage); zymeScript.setDraw(true); zymeScript.setShowButton(true); Time.timeScale = .01f; GUI.DrawTexture(new Rect(0.84f * Screen.width, .82f * Screen.height, .16f * Screen.width, .17f * Screen.height), circle); } }
// Update is called once per frame void Update() { // if we are done just exit this function if (powerUpgraded || PlayerPrefs.GetInt("SIUpdateTutorial") == 0) { return; } // don't start counting the upgrade time until they have placed 2 towers if (PlayerPrefs.GetInt("SIStats_towersPlaced") > 1 && !(PlayerPrefs.GetInt("SIStats_towersUpgraded") > 0) && !drawArrow) { elapsedTime += Time.deltaTime; } // if the time has passed spawn an indicator spotlight on the tower to upgrade if (elapsedTime > maxUpgradeTimeSpeed && !drawArrow) { //give nutrients to upgrade and tell to upgrade intestineGameManager.nutrients += 50; spawnArrowOnTower(); showZymeSpeed = true; elapsedTime = 0f; } // set message to explain tower menu once it's activated if (showZymeSpeed && intestineGameManager.getTowerMenuUp()) { if (mirrorImage) { zymeScript.setImage(zymePopupImageSpeedMirrored); } else { zymeScript.setImage(zymePopupImageSpeedNorm); } } // destroy the light once the tower is upgraded and count to next upgrade if (PlayerPrefs.GetInt("SIStats_towersUpgraded") == 1 && !speedUpgraded) { speedUpgraded = true; drawArrow = false; showZymeSpeed = false; zymeScript.setDraw(false); zymeScript.setDrawZymeRight(); } // count time until next event if (elapsedTime < maxUpgradeTimePower && speedUpgraded) { elapsedTime += Time.deltaTime; } // if the time has passed spawn an indicator spotlight on the tower to upgrade if (elapsedTime > maxUpgradeTimePower && !drawArrow && speedUpgraded) { //give nutrients to upgrade and tell to upgrade intestineGameManager.nutrients += 50; spawnArrowOnTower(); showZymePower = true; elapsedTime = 0f; } // set message to explain tower menu once it's activated if (showZymePower && intestineGameManager.getTowerMenuUp()) { if (mirrorImage) { zymeScript.setImage(zymePopupImagePowerMirrored); } else { zymeScript.setImage(zymePopupImagePowerNorm); } } // destroy the light once the tower is upgraded and count to next upgrade if (PlayerPrefs.GetInt("SIStats_towersUpgraded") == 2) { drawArrow = false; powerUpgraded = true; showZymePower = false; zymeScript.setDraw(false); } }