Im trying to make a ranking system for my game and i am having a issue in the code, there is rank S, A, B and F but the code never goes bellow the A rank for some reason
using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
public class ScoreManager : MonoBehaviour
{
[Header("Tempo")]
public TextMeshProUGUI timerText;
public float _time;
[Header("Rank da Fase")]
public float timeToFinish;
private void Update()
{
//AddScore();
Timer();
}
private void Timer()
{
_time = Time.fixedTime;
TimeSpan time = TimeSpan.FromSeconds(_time);
timerText.text = "Tempo: " + time.Minutes.ToString() + ":" + time.Seconds.ToString();
}
public void TimeToFinish()
{
if (_time <= timeToFinish)
{
Debug.Log("Rank S");
}
else if (_time >= timeToFinish)
{
Debug.Log("Rank A");
}
else if (_time >= timeToFinish * 0.3f)
{
Debug.Log("Rank B");
}
else if (_time >= timeToFinish * 0.4f)
{
Debug.Log("Rank F");
}
}
}
Hopefully someone can help
This is exactly what i was looking for thank you very much, now i understood what i was doing wrong
– Zanetros