Пример #1
0
    // Start is called before the first frame update
    void Start()
    {
        levelGui = GameObject.FindGameObjectWithTag("LevelGui");

        levelFinishedText = levelGui.transform.Find("LevelFinishedLogo").GetComponentInChildren <TextMeshProUGUI>();
        levelEndTint      = levelGui.transform.Find("LevelEndTint").GetComponent <SlowColorChanger>();
        levelFinishedLogo = levelGui.transform.Find("LevelFinishedLogo").GetComponent <SlowColorChanger>();

        currentLevelNumber = int.Parse(SceneManager.GetActiveScene().name.Substring(5));

        menuButton         = levelGui.transform.Find("Buttons").Find("MenuButton").gameObject;
        restartLevelButton = levelGui.transform.Find("Buttons").Find("RestartLevelButton").gameObject;
        nextLevelButton    = levelGui.transform.Find("Buttons").Find("NextLevelButton").gameObject;
        resumeButton       = levelGui.transform.Find("Buttons").Find("ResumeButton").gameObject;
        pauseButton        = GameObject.FindGameObjectWithTag("PauseButton");

        levelTimer = FindObjectOfType <LevelTimer>();



        Invoke("SetupButtons", 1.0f);


        levelFinishedLogo.colorsToChangeTo = new Color[] { Color.yellow, Color.red };

        levelFinishedLogo.colorTransitionSpeed = 1;


        if (!Application.CanStreamedLevelBeLoaded("Level" + (currentLevelNumber + 1)))
        {
            nextLevelButton.SetActive(false);
        }

        levelGui.SetActive(false);
    }
Пример #2
0
 void Start()
 {
     lastSwitchTime = Time.time;
     colorChanger   = GetComponent <SlowColorChanger>();
 }