Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        enabledControls            = false;
        displayedTimerAndRotations = false;
        flashedTimerAndRotations   = false;
        flashedLowPowerWarning     = false;

        if (disableTutorial)
        {
            enabledControls                 = true;
            bottomPanel.blocksRaycasts      = true;
            cameraControls.controlsDisabled = false;
            rotationScript.controlsDisabled = false;
            selectPart.controlsDisabled     = false;
            fuseEvent.startMusic();
            timeRemainingPanel.GetComponent <Timer>().startTimer();
        }
        else   // tutorial is on. Could set these manually in inspector, but is easier this way
        {
            bottomPanel.blocksRaycasts      = false;
            cameraControls.controlsDisabled = true;
            rotationScript.controlsDisabled = true;
            selectPart.controlsDisabled     = true;
        }
    }
Beispiel #2
0
    private IEnumerator doCountdownAndEnableControls()
    {
        if (timeRemainingPanel != null)
        {
            countdownPanel.alpha = 1;
            for (int i = 3; i > 0; i--)
            {
                countdownText.text = "" + i;
                audioSource.PlayOneShot(countdownSound);
                yield return(new WaitForSeconds(1f));
            }
            countdownText.text = "GO!";
            audioSource.PlayOneShot(finalCountSound);
            yield return(new WaitForSeconds(1f));

            countdownPanel.alpha = 0;

            timeRemainingPanel.GetComponent <Timer>().startTimer();
        }
        enablePlayerControls();
        fuseEvent.startMusic();
    }