void EnableTutorial() { if (!tutorialCamera.TutorialsEnabled()) { return; } tutorialCamera.ShowTutorialText("Click glowing objects to grapple", false); GUIController.DisableButtons(); #if UNITY_ANDROID || UNITY_IPHONE //GUIController.ShowText("Tutorial", "Tap glowing objects to grapple"); #else //GUIController.ShowText("Tutorial", "Click glowing objects to grapple"); #endif GameObject.Find("Player").GetComponent <GrapplingHook>().currentTutorial = gameObject; //outline.enabled = true; GUIController.EnableImage("Tap"); SendMessage("ActivateSlowDown"); }
void EnableTutorial() { GUIController.DisableButtons(); tutorialCamera.ShowTutorialText("Drag to alter your trajectory", false); //GUIController.ShowText("TutorialText"); finger.enabled = true; //Time.timeScale = 0.0f; tutorialEnabled = true; SendMessage("ActivateSlowDown"); }
// If the menu is active then draw it. void OnGUI() { // Activate the skin GUISkin old = GUI.skin; GUI.skin = Screen.width > 1500 ? BigSkin : Skin; if (menuActive) { GUILayout.BeginArea(new Rect(0, Screen.height * 0.9f, Screen.width, Screen.height * 0.2f)); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); playername = GUILayout.TextField(playername, new GUILayoutOption[] { GUILayout.Width(Screen.width * 0.2f), GUILayout.Height(Screen.height * 0.05f) }); if (GUILayout.Button("Upload", new GUILayoutOption[] { GUILayout.Width(Screen.width * 0.1f), GUILayout.Height(Screen.height * 0.05f) })) { menuActive = false; GUIController.DisableButtons(); SaveManager.save.playerName = playername; SaveManager.Write(); // Activate some text stating that the score is being posted. GUIController.ShowText("Online", "Posting Score..."); // Get the the rank of the score. Networking.SubmitOnline(SaveManager.save.playerName, ScoreCalculator.finalSpeed, ScoreCalculator.finalTime, submitted); } GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUILayout.EndArea(); } // Put the skin back GUI.skin = old; }
void EnableTutorial() { if (!tutorialCamera.TutorialsEnabled()) { return; } tutorialCamera.ShowTutorialText("Click again anywhere to release", false); GUIController.DisableButtons(); #if UNITY_ANDROID || UNITY_IPHONE //GUIController.ShowText("Tutorial", "Tap again anywhere to release"); #else //GUIController.ShowText("Tutorial", "Click again anywhere to release"); #endif //GUIController.EnableImage("Tap2"); GameObject.Find("Player").GetComponent <GrapplingHook>().currentTutorial = gameObject; SendMessage("ActivateSlowDown"); }
IEnumerator FinishLevel() { Debug.Log("Level finished!"); // Wait time between stars unless tapped to skip const bool playting = true; const bool playfail = false; // Which stars are unlocked bool scoreStar = false; bool timeStar = false; Debug.Log("Updating next level"); hasFinished = true; // Calculate scores Debug.Log("Calculating scores"); score = new Save.LevelHighScore(); if (!GameRecorder.playingBack) { score.Score = ScoreCalculator.finalScore; score.Speed = ScoreCalculator.finalSpeed; score.Time = ScoreCalculator.finalTime; } else { score.Score = GameRecorder.current.score.score; score.Speed = GameRecorder.current.score.speed; score.Time = GameRecorder.current.score.time; } // Save recording Debug.Log("Save recording!"); if (!GameRecorder.playingBack) { savedRecording = true; GameRecorder.StopRecording(); //Recording rec = GameRecorder.Save(true, false); // Upload score to online thing if (!GameRecorder.playingBack) { //HighScores.PostScore(LevelSelectGUI.currentLevel, rec); } // Disable buttons so user doesn't disrupt score uploading GUIController.DisableButtons(); } // Check which stars have been earnt Debug.Log("Checking speed star!"); scoreStar = SaveManager.HasSurpassedSpeed(score, LevelSelectGUI.currentLevel); timeStar = SaveManager.HasSurpassedTime(score, LevelSelectGUI.currentLevel); // Check rewards int passedReward = 500; int noPowerupsReward = 500; int scoreReward = scoreStar ? 500 : 0; int timeReward = timeStar ? 500 : 0; // Get picolinium counter and set target to current value so we can manually increment it var picoliniumCounter = GameObject.Find("Game End/Content/Picolinium/Value/Content/Text")?.GetComponent <PicoliniumCounter>(); picoliniumCounter.Target = SaveManager.save?.picolinium ?? 0; if (SaveManager.save != null) { SaveManager.save.levelCompletions++; SaveManager.save.IncrementPicolinium(passedReward + noPowerupsReward + scoreReward + timeReward); } // Update save // Don't save if we are replaying a recording. if (!GameRecorder.playingBack) { if (LevelSelectGUI.currentLevel != null) { SaveManager.Beaten(LevelSelectGUI.currentLevel); SaveManager.UpdateScore(LevelSelectGUI.currentLevel); SaveManager.Write(); } } // Let the camera pan back a bit tapped = false; yield return(WaitButAllowSkip(START_WAIT_TIME)); // Show the gui // Do everything important before this because they can exit the level or reset after this GameObject.Find("Game End").BroadcastMessage("Reset"); GameObject.Find("MainGUI").GetComponent <Animator>().Play("EndLevel"); tapped = false; yield return(new WaitForSeconds(0.5f)); string formattedTime = ReadableTime((int)(score.Time * 1000.0f)); // Get reward text template var bonusTemplate = GameObject.Find("RewardText"); SoundManager.Play("ting"); picoliniumCounter.Target += passedReward; // Show level time var levelTime = GameObject.Find("LevelTime/Text").GetComponent <TextRevealer>(); levelTime.Text = $"{formattedTime}"; levelTime.Run = true; levelTime.Counter = 0.0f; TextFadeout newBonusText; if (!tapped) { newBonusText = GameObject.Instantiate(bonusTemplate, bonusTemplate.transform.parent).GetComponent <TextFadeout>(); newBonusText.Text = "Level complete!"; newBonusText.Go = true; } yield return(WaitButAllowSkip(WAIT_TIME)); // Show powerups bonus if (noPowerupsReward > 0) { picoliniumCounter.Target += noPowerupsReward; if (!tapped) { newBonusText = GameObject.Instantiate(bonusTemplate, bonusTemplate.transform.parent).GetComponent <TextFadeout>(); newBonusText.Text = "No powerups"; newBonusText.Go = true; SoundManager.Play("ting"); } yield return(WaitButAllowSkip(WAIT_TIME)); } // Show time bonus if (timeReward > 0) { picoliniumCounter.Target += timeReward; if (!tapped) { SoundManager.Play("ting"); newBonusText = GameObject.Instantiate(bonusTemplate, bonusTemplate.transform.parent).GetComponent <TextFadeout>(); newBonusText.Text = "Super fast time!"; newBonusText.Go = true; } yield return(WaitButAllowSkip(WAIT_TIME)); } // Show speed bonus if (scoreReward > 0) { picoliniumCounter.Target += scoreReward; if (!tapped) { SoundManager.Play("ting"); newBonusText = GameObject.Instantiate(bonusTemplate, bonusTemplate.transform.parent).GetComponent <TextFadeout>(); newBonusText.Text = "Super fast speed!"; newBonusText.Go = true; } yield return(WaitButAllowSkip(WAIT_TIME)); } // End player.SendMessage("StopCounting"); player.SendMessage("EndMining"); //GameObject.Find("Game End/Content/Story/Text").GetComponent<TextRevealer>().Run = true; GameObject.Find("MainGUI").GetComponent <Animator>().Play("ExpandEndLevel"); if (!uploading) { GUIController.EndLevel(true); } endingDone = true; }