Example #1
0
    // Use this for initialization
    private void Start()
    {
        scoreMaster = FindObjectOfType <ScoreController>();
        scoreMaster.Award(scoreValue);

        this.guiText.text = scoreValue.ToString();

        accumulatedTime = 0;
    }
    // Use this for initialization
    private void Start()
    {
        scoreMaster = FindObjectOfType<ScoreController>();
        scoreMaster.Award(scoreValue);

        this.guiText.text = scoreValue.ToString();

        accumulatedTime = 0;
    }
Example #3
0
    public void Update()
    {
        if (waitToReturnToTitleScreen)
        {
            if (Input.anyKeyDown)
            {
                FindObjectOfType <BackgroundManager>().FadeOut(GoToMenu);
            }
        }

        if (showHighScoreBox)
        {
            switch (transition)
            {
            case UITransitionState.EasingIn:
                timeCounter = Mathf.Clamp01(timeCounter + Time.deltaTime * 2);

                if (timeCounter >= 1)
                {
                    transition = UITransitionState.Steady;
                }
                break;

            case UITransitionState.EasingOut:
                timeCounter = Mathf.Clamp01(timeCounter - Time.deltaTime * 2);

                if (timeCounter <= 0)
                {
                    showHighScoreBox = false;
                    transition       = UITransitionState.Steady;
                }
                break;

            default:
                break;
            }
        }

        if (Input.GetKeyDown(KeyCode.F8))
        {
            scoreController.Award(scoreController.HighScore + 1);
            FindObjectOfType <LifeCounter>().currentLives = 0;
            FindObjectOfType <PlayerLife>().OnHit();
        }
    }