void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } }
void AddLine(string name) { ChooseLine newLine = new ChooseLine(name); newLine.LineClicked += (object sender, EventArgs args) => { LineClicked.Invoke(sender, EventArgs.Empty); }; newLine.XClicked += delegate { itemsLayout.Children.Remove(newLine); g.itemDB.Delete(name); }; itemsLayout.Children.Add(newLine); }