Exemplo n.º 1
0
 public void ShowHint(int state)
 {
     if (tutorialNumber < 8)
     {
         return;
     }
     if (state == 1)
     {
         UpdateCoins(-20);
         negativeCoinChange = 0;
         HighlightObject.StopIt();
         hintBox.SetActive(true);
         //hintBox.GetComponentInChildren<Text>().text =
     }
     else
     {
         hintBox.SetActive(false);
     }
 }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        if (tutorialNumber < 8)
        {
            tutorialBoxes[tutorialNumber].SetActive(true);
            HighlightObject.Highlight(tutorialNumber);
        }
        else
        {
            HighlightObject.StopIt();

            if (coins < coinsTarget)
            {
                coins++;
            }
            else if (coins > coinsTarget)
            {
                coins--;
            }


            totalCoins.GetComponentInChildren <Text>().text = coins.ToString();

            if (!paused)
            {
                negativeCoinChange += Time.deltaTime;
                time += Time.deltaTime;
                if (negativeCoinChange > 5.0f)
                {
                    HighlightObject.Highlight(1);
                }
            }

            if (level == 0)
            {
                var firstNotSecond = ports.Except(SolutionPorts).ToList();
                var secondNotFirst = SolutionPorts.Except(ports).ToList();
                if (!firstNotSecond.Any() && !secondNotFirst.Any())
                {
                    ShowNmapScan(0);
                    ShowPortBlocker(0);
                    feedbackBox.GetComponentInChildren <Text>().text = "Nice! You have completed this level";
                    feedbackBox.SetActive(true);
                }
            }
            if (level == 2)
            {
                if (!levelPassed)
                {
                    IPSliderWindow.SetActive(true);
                }
                else
                {
                    IPSliderWindow.SetActive(false);
                    feedbackBox.GetComponentInChildren <Text>().text = "Nice! You have completed this level";
                    feedbackBox.SetActive(true);
                }
            }
            if (level == 1)
            {
                if (!levelPassed)
                {
                    GraphWindow.SetActive(true);
                }
                else
                {
                    GraphWindow.SetActive(false);
                    feedbackBox.GetComponentInChildren <Text>().text = "Nice! You have completed this level";
                    feedbackBox.SetActive(true);
                }
            }
        }
    }