8 #if UNITY_WSA && UNITY_2017_2_OR_NEWER 17 [Header(
"How long to spend on each stage of loading")]
19 private float leadInTime = 1.5f;
22 private float loadingTime = 5f;
25 private float finishTime = 1.5f;
27 [Header(
"Set these to override the defaults set in the ProgressIndicator prefab")]
29 private GameObject loadingPrefab = null;
32 private Texture2D loadingIcon = null;
34 [Header(
"Messages displayed during loading")]
36 private string leadInMessage =
"Lead in Message";
38 private string loadTextMessage =
"Loading with message only";
40 private string loadOrbsMessage =
"Loading with Orbs";
42 private string loadIconMessage =
"Loading with Icon";
44 private string loadPrefabMessage =
"Loading with Prefab";
46 private string loadProgressMessage =
"Loading with Progress";
48 private string loadProgressBarMessage =
"Loading with Bar";
50 private string finishMessage =
"Finished!";
53 private GameObject buttonCollection = null;
55 public float LeadInTime
68 public float LoadingTime
81 public float FinishTime
94 public GameObject LoadingPrefab
103 loadingPrefab = value;
107 public Texture2D LoadingIcon
120 public GameObject ButtonCollection
124 return buttonCollection;
129 buttonCollection = value;
133 public string LeadInMessage
137 return leadInMessage;
142 leadInMessage = value;
146 public string LoadTextMessage
150 return loadTextMessage;
155 loadTextMessage = value;
159 public string LoadOrbsMessage
163 return loadOrbsMessage;
168 loadOrbsMessage = value;
172 public string LoadIconMessage
176 return loadIconMessage;
181 loadIconMessage = value;
185 public string LoadPrefabMessage
189 return loadPrefabMessage;
194 loadPrefabMessage = value;
198 public string LoadProgressMessage
202 return loadProgressMessage;
207 loadProgressMessage = value;
211 public string LoadProgressBarMessage
215 return loadProgressBarMessage;
220 loadProgressBarMessage = value;
224 public string FinishMessage
228 return finishMessage;
233 finishMessage = value;
244 switch (indicatorStyle)
248 switch (progressStyle)
256 StartCoroutine(LoadOverTime(LoadProgressMessage));
265 StartCoroutine(LoadOverTime(LoadProgressBarMessage));
274 StartCoroutine(LoadOverTime(LoadTextMessage));
285 StartCoroutine(LoadOverTime(LoadOrbsMessage));
295 StartCoroutine(LoadOverTime(LoadIconMessage));
305 StartCoroutine(LoadOverTime(LoadPrefabMessage));
316 float startTime = Time.time;
317 yield
return new WaitForSeconds(LeadInTime);
324 startTime = Time.time;
325 while (Time.time < startTime + LoadingTime)
327 progress = (Time.time - startTime) / LoadingTime;
330 yield
return new WaitForSeconds(
Random.Range(0.15f, 0.5f));
336 yield
return new WaitForSeconds(FinishTime);