コード例 #1
0
 // Update is called once per frame
 void Update()
 {
     if (CountdownTimer.clock.text == "Time: 1")
     {
         TransitionToNewScene.LoadScene("Desktop");
     }
 }
コード例 #2
0
 void Update()
 {
     for (int i = 0; i < TouchManager.TouchCount(); ++i)
     {
         if (TouchManager.GetTouch(i).phase.Equals(TouchPhase.Began))
         {
             //Construct a ray from the current touch coordinates
             RaycastHit hit;
             Ray        ray = Camera.main.ScreenPointToRay(TouchManager.GetTouch(i).position);
             if (Physics.Raycast(ray, out hit))
             {
                 //Destroy the first game object hit by ray
                 if (hit.collider.gameObject.tag == "Password")
                 {
                     hitPosition     = hit.point;
                     currentPosition = hitPosition;
                     passwordText.SetActive(true);
                     Scoreboard.currentScore += 5;
                     hit.collider.gameObject.SetActive(false);
                     TransitionToNewScene.LoadScene("Secure The Server");
                 }
             }
         }
     }
 }
コード例 #3
0
ファイル: EndGame.cs プロジェクト: kbrawley95/EndOfLine
 void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.name == "Player")
     {
         Scoreboard.currentScore += 20;
         TransitionToNewScene.LoadScene(SceneRandomiser.SelectNextScene());
     }
 }
コード例 #4
0
    // Update is called once per frame
    void Update()
    {
        numberOfEmails = emailCount;

        if (emailCount < 1)
        {
            TransitionToNewScene.LoadScene(SceneRandomiser.SelectNextScene());
        }
    }
コード例 #5
0
    // Update is called once per frame
    void Update()
    {
        tempScore = currentScore;

        if (currentTries == 3)
        {
            TransitionToNewScene.LoadScene("Final Score");
        }
    }
コード例 #6
0
ファイル: AdSpawner.cs プロジェクト: kbrawley95/EndOfLine
    void Update()
    {
        //Checks Whether a pop-up object has been closed by player, relocates it and enables it once more
        killCount = currentKills;
        RespawnAds();

        if (killCount == killLimit)
        {
            killCount    = 0;
            currentKills = 0;
            TransitionToNewScene.LoadScene(SceneRandomiser.SelectNextScene());
        }
    }
コード例 #7
0
    // Update is called once per frame
    void Update()
    {
        timer     -= Time.deltaTime;
        clock.text = FormatedTime(CountdownTimer.timer);

        //If timer equals 0, triggers scene transition
        if (CountdownTimer.timer < 0)
        {
            CountdownTimer.timer = 0;
            Scoreboard.currentTries++;
            SceneRandomiser.AddSceneToClosedList(currentScene.name);
            TransitionToNewScene.LoadScene(SceneRandomiser.SelectNextScene());
            Screen.orientation = ScreenOrientation.LandscapeRight;
            audioManager.SetActive(true);
        }
    }
コード例 #8
0
 void Update()
 {
     for (int i = 0; i < TouchManager.TouchCount(); ++i)
     {
         if (TouchManager.GetTouch(i).phase.Equals(TouchPhase.Began))
         {
             //Construct a ray from the current touch coordinates
             RaycastHit hit;
             Ray        ray = Camera.main.ScreenPointToRay(TouchManager.GetTouch(i).position);
             if (Physics.Raycast(ray, out hit))
             {
                 if (hit.collider.name == "Terminal")
                 {
                     audioManager.SetActive(true);
                     scoreboard.SetActive(true);
                     TransitionToNewScene.LoadScene(SceneRandomiser.SelectNextScene());
                 }
             }
         }
     }
 }