Example #1
0
    /// <summary>
    /// Update is called every frame, if the MonoBehaviour is enabled.
    /// </summary>
    void Update()
    {
        if (!startScoring)
        {
            return;
        }

        currentScore    += (scoreIncreaseRate * Time.deltaTime);
        uiScoreText.text = $"Score: {ExtensionFunctions.Format2DecimalPlace(currentScore)}";
    }
Example #2
0
        private void Update()
        {
            timeText.text  = $"Time : {ExtensionFunctions.Format2DecimalPlace(currentTime)} s";
            killsText.text = $"Kills : {currentKills}";

            if (countScore)
            {
                currentTime += Time.deltaTime;
            }
        }
Example #3
0
    /// <summary>
    /// Start is called on the frame when a script is enabled just before
    /// any of the Update methods is called the first time.
    /// </summary>
    void Start()
    {
        float currentScore = 0;

        if (PlayerPrefs.HasKey(PlayerPrefsVariables.PlayerScore))
        {
            currentScore = PlayerPrefs.GetFloat(PlayerPrefsVariables.PlayerScore);
        }

        scoreText.text = $"Highest Score: {ExtensionFunctions.Format2DecimalPlace(currentScore)}";
    }
Example #4
0
        /// <summary>
        /// Start is called on the frame when a script is enabled just before
        /// any of the Update methods is called the first time.
        /// </summary>
        void Start()
        {
            if (SceneData.showInfo)
            {
                infoText.SetActive(true);
                infoText.GetComponent <Text>().text =
                    $"Killed {SceneData.sceneKills} in {ExtensionFunctions.Format2DecimalPlace(SceneData.sceneTime)} s";
            }
            else
            {
                infoText.SetActive(false);
                infoText.GetComponent <Text>().text = "";
            }

            StartCoroutine(LoadNextSceneAsync());
        }
Example #5
0
        private void Start()
        {
            int kills = 0;

            if (PlayerPrefs.HasKey(SceneData.KillsPlayerPref))
            {
                kills = PlayerPrefs.GetInt(SceneData.KillsPlayerPref);
            }

            float survivedTime = 0;

            if (PlayerPrefs.HasKey(SceneData.TimePlayerPref))
            {
                survivedTime = PlayerPrefs.GetFloat(SceneData.TimePlayerPref);
            }

            killsText.text = $"Highest Kills : {kills}";
            timeText.text  = $"Longest Survived Time : {ExtensionFunctions.Format2DecimalPlace(survivedTime)} s";
        }