-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPerformanceDisplayScript.cs
More file actions
42 lines (35 loc) · 1.32 KB
/
Copy pathPerformanceDisplayScript.cs
File metadata and controls
42 lines (35 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PerformanceDisplayScript : MonoBehaviour
{
[SerializeField] private PerformanceRecordScript recordPref;
[SerializeField] private RecoverySlider sliderScript;
[SerializeField] private Transform parent;
// Start is called before the first frame update
void Start()
{
UpdatePerformance();
}
void UpdatePerformance()
{
//PlayerPrefs.SetString("Bat4BatsData", "0.02;" + System.DateTime.Now.ToString() + ";3;2~");
string full = PlayerPrefs.GetString("Bat4BatsData", "");
string[] splitData = full.Split('~');
foreach (string s in splitData)
{
string[] furtherSplit = s.Split(';');
if (furtherSplit.Length == 4)
{
string score = furtherSplit[0];
string datetime = furtherSplit[1];
string recovery = furtherSplit[2];
string spawn = sliderScript.options[(int.Parse(furtherSplit[3]) - (int)sliderScript.slider.minValue)];
PerformanceRecordScript pr = Instantiate(recordPref, parent);
pr.SetUp(score, spawn, recovery, datetime);
}
else
break;
}
}
}