Пример #1
0
 // ***************************************************************
 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));
     }
 }
Пример #2
0
 // ***************************************************************
 void Start()
 {
     // Game Controller variables init
     GameController.isTutorial      = true;
     GameController.missionInitials = "GTP";
     GameController.challenge       = "Learn how to take pics!";
     // Connect with UI
     GameObject.Find("Needed Pics").GetComponent <Text> ().text = Difficulty.objectiveNeeded.ToString();
     // Create intial otters
     OtterGenerator.createOtter(new Vector3(4f, -3.8f));
     OtterGenerator.createOtter(new Vector3(13f, -3.8f));
     OtterGenerator.createOtter(new Vector3(26f, -3.8f));
     // Bring in the tutorial, set it to manual
     Instantiate(Resources.Load <GameObject>("UIPrefabs/GTPTutorial"));
     tutorialScript = GameObject.Find("GTPTutorial(Clone)").GetComponent <TutorialController>();
     tutorialScript.automaticTutorialSetting(false);
     // Tutorial Vars
     tempCounter   = 1;
     tutorialState = 0;
     // Generate the background only for the space we need
     for (int i = 0; i < 2; i++)
     {
         copies++;
         makeNewBackground();
         widenWaves();
     }
 }
Пример #3
0
 void Update()
 {
     if (Time.time % 20 > 19 && !birdSpawned)
     {
         birdGenerator.makeBird("right");
         birdSpawned = true;
     }
     if (Time.time % 20 < 1 && birdSpawned)
     {
         birdSpawned = false;
     }
     if (Time.timeSinceLevelLoad > 30 && !otterSpawned)
     {
         OtterGenerator.createOtter(new Vector3(1.9f, -4f));
         Destroy(GameObject.Find("Region").gameObject);
         otterSpawned = true;
     }
 }