Example #1
0
    private void StartLevel()
    {
        doingSetup = true;

        //Find Ouroboros System
        ouroborosSystem = GameObject.Find("Ouroboros System").GetComponent <OuroborosSystem>();

        //Find level timer text
        levelTimerText = GameObject.Find("LevelTimerText").GetComponent <Text>();

        //Find Level text
        levelText = GameObject.Find("LevelText").GetComponent <Text>();

        levelText.text = "Level: " + level.ToString();

        //Find ready text
        readyText = GameObject.Find("ReadyText").GetComponent <Text>();

        //Find Win Text
        winText = GameObject.Find("WinText").GetComponent <Text>();

        //Find GameOver text
        gameOverText = GameObject.Find("GameOverText").GetComponent <Text>();

        //Find Ending Level Text
        endingLevelText = GameObject.Find("EndingLevelText").GetComponent <Text>();

        //Find Ending Text
        endingText = GameObject.Find("EndingText").GetComponent <Text>();

        //Set the timer text
        SetLevelTimerText();

        //Set the starting head value
        SetStartingHeadValue();

        //Randomly place the gathering stations
        SetGatheringStations();

        //Randomize gathering stations and ouroboros requirements
        RandomizeLevel();

        //Remove Ready Text
        Invoke("HideReadyText", levelStartDelay);
    }
    private void Awake()
    {
        //Check if in menu
        if (SceneManager.GetActiveScene().buildIndex == 0)
        {
            inMenu = true;
        }
        else
        {
            inMenu = false;
        }


        if (!inMenu)
        {
            ouroborosSystem = GameObject.Find("Ouroboros System").GetComponent <OuroborosSystem>();
            gameManager     = GameObject.Find("GameManager").GetComponent <GameManager>();
        }


        animator = GetComponentInChildren <Animator>();
    }