public void ShowData(PlayerData data) { timeText.text = Math.Floor(data.time / 60) + ":" + (data.time % 60 < 10 ? "0" : "") + Math.Floor(data.time % 60); speed_converter.ShowSpeed(data.speed); fuel_converter.ShowFuel(data.nitro_left); sensor_control.ShowSensors(data.obstacle_detection_rays); }
public void ShowData(PlayerData data) { if (data.time > 1) { timeText.text = Math.Floor(data.time / 60) + ":" + (data.time % 60 < 10 ? "0" : "") + Math.Floor(data.time % 60); } else if (data.time < 0) { timeText.text = Math.Floor(-data.time + 1).ToString(); } else if (true) { timeText.text = "Go!!"; } speed_converter.ShowSpeed(data.speed); print(data.speed); fuel_converter.ShowFuel(data.nitro_left); sensor_control.ShowSensors(data.obstacle_detection_rays); }