public void Save() { if (title.text == string.Empty) { FindObjectOfType <ClipAtPointR>().PlayClipAtPoint(failiureac); fail.SetTrigger("Fail"); return; } if (constants.focusedShcoolIndex != int.MaxValue) { var i = constants.mainCore.shcools.ToList(); i.Remove(constants.mainCore.shcools[constants.focusedShcoolIndex]); constants.mainCore.shcools = i.ToArray(); } var newSchcool = new School(); newSchcool.Name = title.text; newSchcool.Subjects = cachedSubjects.ToArray(); if (constants.mainCore.shcools == null) { constants.mainCore.shcools = new School[] { newSchcool }; } else { var i = constants.mainCore.shcools.ToList(); i.Add(newSchcool); constants.mainCore.shcools = i.ToArray(); } constants.Serialize(); StaticSceneLoader.ForceLoadScene(0); }
// Start is called before the first frame update void Start() { Deserialize(); if (constants.Useless) { Serialize(); StaticSceneLoader.ForceLoadScene(0); } }
public void Package() { if (dropdown.value - 1 < 0) { error.SetTrigger("Fail"); return; } constants.focusedShcoolIndex = (uint)ccsi; constants.feededSubject = constants.mainCore.shcools[ccsi].Subjects[dropdown.value - 1]; StaticSceneLoader.ForceLoadScene("Test"); }
public void Package(string scene) { SchoolBox shcoolBox = null; foreach (var item in FindObjectsOfType <SchoolBox>()) { if (item.GetComponent <TextMeshProUGUI>().color == Color.red) { shcoolBox = item; break; } } if (shcoolBox == null) { return; } constants.focusedShcoolIndex = (uint)constants.mainCore.shcools.ToList().IndexOf(shcoolBox.shcool); StaticSceneLoader.ForceLoadScene(scene); }
public void Package(string scene) { CardBox cardBox = null; foreach (var item in FindObjectsOfType <CardBox>()) { if (item.GetComponent <TextMeshProUGUI>().color == Color.red) { cardBox = item; break; } } if (dropdown.value - 1 < 0 || cardBox == null) { error.SetTrigger("Fail"); return; } constants.focusedShcoolIndex = (uint)ccsi; constants.focusedSubjectIndex = (uint)dropdown.value - 1; constants.questionanswercache = new KeyValuePair <string, string>(cardBox.card.Question, cardBox.card.Answer); StaticSceneLoader.ForceLoadScene(scene); }
public IEnumerator Init() { if (questionCards.Count < 1) { constants.Serialize(); StaticSceneLoader.ForceLoadScene("Congrats"); yield return(null); } var newDrag = Instantiate(cardTemplate.gameObject, FindObjectOfType <Canvas>().transform); var d = newDrag.GetComponent <Drag>(); KeyValuePair <QuestionCard, Subject> card = questionCards[Random.Range(0, questionCards.Count)]; d.gameObject.transform.SetParent(FindObjectOfType <Canvas>().transform); d.keyValuePair = card; d.answer = card.Key.Answer; d.question = card.Key.Question; d.subject = card.Value.Name; yield return(new WaitForSeconds(1)); // d.transform.position = new Vector3(0, 737.5f, 0); }
public void Go() { constants.Deserialize(); var sf = new SavingSystem <SerializableSettings>(); var x = sf.LoadAsJson(SettingsMaster.SETTINGS_FILE_NAME); if (x == null) { constants.Useless = true; StaticSceneLoader.ForceLoadScene("NotificationSettings"); } else { var day = DateTime.Today.DayOfWeek; bool b = false; bool o = false; bool g = false; switch (day) { case DayOfWeek.Monday: { if (x.DontKnow.monday) { b = true; } if (x.MightKnow.monday) { o = true; } if (x.IKnow.monday) { g = true; } break; } case DayOfWeek.Tuesday: { if (x.DontKnow.tuesday) { b = true; } if (x.MightKnow.tuesday) { o = true; } if (x.IKnow.tuesday) { g = true; } break; } case DayOfWeek.Wednesday: { if (x.DontKnow.wednesday) { b = true; } if (x.MightKnow.wednesday) { o = true; } if (x.IKnow.wednesday) { g = true; } break; } case DayOfWeek.Thursday: { if (x.DontKnow.thursday) { b = true; } if (x.MightKnow.thursday) { o = true; } if (x.IKnow.thursday) { g = true; } break; } case DayOfWeek.Friday: { if (x.DontKnow.friday) { b = true; } if (x.MightKnow.friday) { o = true; } if (x.IKnow.friday) { g = true; } break; } case DayOfWeek.Saturday: { if (x.DontKnow.saturday) { b = true; } if (x.MightKnow.saturday) { o = true; } if (x.IKnow.saturday) { g = true; } break; } case DayOfWeek.Sunday: { if (x.DontKnow.sunday) { b = true; } if (x.MightKnow.sunday) { o = true; } if (x.IKnow.sunday) { g = true; } break; } } constants.bad = b; constants.ok = o; constants.good = g; StaticSceneLoader.ForceLoadScene("OpenShcoolForTesting"); } }
public void Home() { StaticSceneLoader.ForceLoadScene(0); }
public void Package() { Serialize(); StaticSceneLoader.ForceLoadScene(0); }