Example #1
0
 void unpauseGame()
 {
     spacecraftController.enableSpacecraft();
     pauseMenu.SetActive(false);
     levelTime.startTimer();
     levelTime.showTimer();
 }
 void endCountdown()
 {
     //enable controls
     playLevelCountdown         = false;
     spacecraftControls.enabled = true;
     spacecraftMovement.increaseCraftSpeed(spacecraftSpeedMultiplyer);
     gameMaster.disableCountdown();
     levelTime.startTimer();
 }
    // Start is called before the first frame update
    void Start()
    {
        countdown             = GameObject.Find("CountdownCanvas").GetComponent <Canvas>();
        countdownAnimator     = countdown.GetComponent <Animator>();
        spacecraftControls    = FindObjectOfType <SpacecraftControls>();
        spacecraftMovement    = FindObjectOfType <SpacecraftMovement>();
        levelTime             = FindObjectOfType <LevelTime>();
        gameMaster            = GameObject.FindGameObjectWithTag("GameMaster").GetComponent <GameMaster>();
        playLevelCountdown    = gameMaster.getPlayCountdown();
        countdownTime         = 4.0f;
        decreaseCountDownTime = countdownTime;
        countdownPlaying      = false;

        if (playLevelCountdown)
        {
            beginCountdown();
        }
        else
        {
            levelTime.startTimer();
        }
    }