예제 #1
0
    // Use this for initialization
    void Start()
    {
        ImageHolders();

        aSource = GameObject.FindGameObjectWithTag("MathsPuzzle").GetComponent <AudioSource>();

        mathPuzzleScript = GameObject.FindGameObjectWithTag("MathsPuzzle").GetComponent <MathsPuzzle>();

        answerText         = GameObject.Find("AnswerText").GetComponent <Text>();
        differentBatteries = Resources.LoadAll <Sprite>("Batteries");

        livesImage = GameObject.Find("Circle").GetComponent <Image>();

        pickedBatteryStage = batteryStages.stage1;
        stage1Goal         = (stage1BatCom)Random.Range(0, 5);
    }
예제 #2
0
 // Update is called once per frame
 void Update()
 {
     UpdateLives();
     if (mathPuzzleScript.switch1)  // 2nd battery puzzle
     {
         if (!runOnce1)
         {
             door.enabled       = false;
             pickedBatteryStage = batteryStages.stage2;
             stage2Goal         = (stage2BatCom)Random.Range(0, 5);
             runOnce1           = true;
         }
         Stage2();
     }
     if (mathPuzzleScript.switch2)
     {
         if (!runOnce2)
         {
             door.enabled             = false;
             mathPuzzleScript.switch1 = false;
             pickedBatteryStage       = batteryStages.stage3;
             stage3Goal = (stage3BatCom)Random.Range(0, 5);
             runOnce2   = true;
         }
         Stage3();
     }
     if (!mathPuzzleScript.runStart)
     {
         door.enabled = false;
         Stage1();
     }
     if (counter >= 3)
     {
         mathPuzzleScript.CallLerp();
     }
 }