Hello,
I want to make a game timer based on the string value from the PlayerPrefs-class.
void Start(){
string[] time = PlayerPrefs.GetString("EventDuration", "5:00").Split(":");
int min = int.Parse(time[0]);
int sec = int.Parse(time[1]);
eventDuration = min*60f + sec;
}
void Update(){
eventDuration -= Time.deltaTime;
if(eventDuration <= 0)
GameOver();
}
But I get an error: The best overloaded method match for `string.Split(params char)’ has some invalid arguments