// *************************************************************** void Update() { // Sometimes Bonus and Boosts aren't there for Start (), so we connect with them in Update () if (bonusGenerator == null) { bonusGenerator = GameObject.Find("Bonus Generator").GetComponent <BonusGenerator> (); } if (boostsGenerator == null) { boostsGenerator = GameObject.Find("Boosts Generator").GetComponent <BoostsGenerator> (); } // Once the Opening.cs animation concludes, start the tutorial if (GameController.started) { controlGTPTutorial(); } // Check if the pics are all taken, if so put up the "return to dock icon" checkIfPictureGoalAchieved(); // If picstaken and landed on the dock, you won! checkForLevelCompletion(); // Update UI GameObject.Find("Captured Pics").GetComponent <Text> ().text = GameController.objectiveGained.ToString(); if (GameObject.Find("landingCircle(Clone)")) { landingCircle.transform.Rotate(new Vector3(0f, 0f, 0.75f)); } // Account for scared otters if (OtterGenerator.otterCount < 3) { OtterGenerator.createOtter(new Vector3(Random.Range(6f, 25f), -3.8f)); } }
// *************************************************************** void Start() { // GameController variables init GameController.isTutorial = true; GameController.missionInitials = "LTF"; GameController.challenge = "Learn how to fly!"; // Update UI GameObject.Find("Circles Needed").GetComponent <Text>().text = Difficulty.objectiveNeeded.ToString(); GameObject.Find("Circles Panel").SetActive(false); GameObject.Find("Points Panel").SetActive(false); // Drop in the tutorial prefab, connect to it, and set it to manual Instantiate(Resources.Load <GameObject>("UIPrefabs/LTFTutorial")); tutorialScript = GameObject.Find("LTFTutorial(Clone)").GetComponent <TutorialController>(); tutorialScript.automaticTutorialSetting(false); // Connect to bonus generatory and boost generator bonusGenerator = GameObject.Find("Bonus Generator").GetComponent <BonusGenerator>(); boostsGenerator = GameObject.Find("Boosts Generator").GetComponent <BoostsGenerator>(); // Make the first circle makeCircle(new Vector3(4.98f, -0.08f, 0f)); }