void addColor(string id, string group, string color) { ColorDB mColorDB = new ColorDB(); mColorDB.addData(new ColorData(id, group, color)); mColorDB.close(); }
public void selectColor() { ColorDB mColorDB = new ColorDB(); System.Data.IDataReader reader = mColorDB.getAllData(); List <ColorData> myList = new List <ColorData>(); while (reader.Read()) { ColorData entity = new ColorData(reader[0].ToString(), reader[1].ToString(), reader[2].ToString(), reader[3].ToString()); myList.Add(entity); } int count = myList.Count; string btn = EventSystem.current.currentSelectedGameObject.name; if (count == 0) { addColor("1", "Family", btn); txt.text = "Select a Color for Friends:"; } else if (count == 1) { addColor("2", "Friends", btn); txt.text = "Select a Color for Strangers:"; } else if (count == 2) { addColor("3", "Strangers", btn); SceneManager.LoadScene("UploadPicOrNotSection"); } else { resetColors(); } mColorDB.close(); }