public void Focus() { UIAlert.CloseAll(true); UIAlert alert1 = UIAlert.create("Alert 1", this.message); alert1.padding = new Vector2(10.0f, 10.0f); alert1.Add <UIButton>("UIAlert-Button-Template").onClick.Add(new EventDelegate(() => { alert1.Close(true); })); alert1.Show(new Vector2(-200.0f, 0.0f)); UIAlert alert2 = UIAlert.create("Focused Alert", this.message); alert2.padding = new Vector2(10.0f, 10.0f); alert2.Add <UIButton>("UIAlert-Button-Template").onClick.Add(new EventDelegate(() => { alert2.Close(true); })); alert2.Add <UIButton>("UIAlert-Button-Template").onClick.Add(new EventDelegate(() => { alert2.Close(true); })); alert2.Show(new Vector2(200.0f, 0.0f)); }
public void SaveAndGo() { if (GameObject.Find("Name").GetComponentInChildren <UIInput>().value == string.Empty) { UIAlert a = UIAlert.create("Need Player Name", "Please input player's name."); a.padding = new Vector2(10f, 10f); a.Add <UIButton>("UIAlert-Button-Template").onClick.Add(new EventDelegate(() => a.Close(true))); a.Show(); return; } //GameObject.Find("Name").GetComponentInChildren<UIInput>().Submit(); //UILabel[] attrs = GameObject.Find("RerollBtn").GetComponent<GetRandomAttr>().attrs; //for (int i = 0; i < attrs.Length; i++) //{ // attrs[i].GetComponent<LabelSaveAs>().Save(); //} Status s = new Status(); s.name = GameObject.Find("Name").GetComponentInChildren <UIInput>().value; s.level = 1; s.curExp = 0; s.expToLevel = 100; s.maxHp = s.curHp = 100; s.strength = int.Parse(GameObject.Find("strValue").GetComponent <UILabel>().text); s.agility = int.Parse(GameObject.Find("agiValue").GetComponent <UILabel>().text); s.intelligent = int.Parse(GameObject.Find("intValue").GetComponent <UILabel>().text); s.Save(); SceneManager.LoadScene("InVilleage"); }
public void Show(int buttons, UIAlert.Layout layout = UIAlert.Layout.HORIZONTAL) { UIAlert.CloseAll(true); UIAlert alert = UIAlert.create(this.title, this.message, layout); alert.padding = new Vector2(10.0f, 10.0f); for (int i = 0; i < buttons; i++) { alert.Add <UIButton>("UIAlert-Button-Template").onClick.Add(new EventDelegate(() => { alert.Close(true); })); } alert.Show(); }
public void Formular() { UIAlert.CloseAll(true); UIAlert alert = UIAlert.create(this.title, this.message, UIAlert.Layout.VERTICAL); alert.padding = new Vector2(10.0f, 10.0f); for (int i = 0; i < 3; i++) { alert.Add <UIInput>("UIAlert-Input-Template"); } alert.Add <UIButton>("UIAlert-Button-Template").onClick.Add(new EventDelegate(() => { alert.Close(true); })); alert.Show(); }
public void NoButtons() { UIAlert.CloseAll(true); UIAlert.create("Alert 1", this.message).Show(); }