예제 #1
0
    void Update()
    {
        stats = controller.GetPlayer().GetLevelStats();
        stats.SetStat(LevelRewards.ConditionType.Time, Time.timeSinceLevelLoad);

        float value = 0f;

        if (Time.realtimeSinceStartup > time + 3)
        {
            Rotate();
        }

        switch (reward)
        {
        case 1:
            condition = rewards.rewardOneCondition;
            value     = stats.stats[condition];
            break;

        case 2:
            condition = rewards.rewardTwoCondition;
            value     = stats.stats[condition];
            break;

        case 3:
            condition = rewards.rewardThreeCondition;
            value     = stats.stats[condition];
            break;
        }

        if (value == (int)value)
        {
            scoreText.text = value.ToString();
        }
        else
        {
            scoreText.text = value.ToString("0.00");
        }

        int result = rewards.IsMet(reward);

        if (result == 1)
        {
            scoreText.color = Color.green;
        }
        else if (result == 0)
        {
            scoreText.color = Color.red;
        }
        else
        {
            scoreText.color = Color.blue;
        }
    }