//创建组操作按钮 void createBtn(Vector2 minpos, Vector2 maxpos, string name, Operation.SCGroup group) { CustomView.SCButton btn = new CustomView.SCButton(5, name, parentGamobject.transform, delegate() { string gstr = group.g_name; //显示对话框 produceDialog.GetComponent <Devdog.InventorySystem.UIWindow>().Show(); gameObject.GetComponent <AudioSource>().Play(); foreach (GameObject it in currentDialogBtnArry) { Destroy(it); } //清空对话框中现存的按钮 currentDialogBtnArry.Clear(); currentDrugArry.Clear(); if (group.g_name == "注射" || group.g_name == "静点") { getDrug(group.g_ID, group.g_name); } else { getOperation(group.g_ID); } }, btnImage, minpos, maxpos, new Vector2(0, 0), new Vector2(0, 0)// new Vector2(0, 0.92f), new Vector2(0.166f, 1.0f) ); CustomView.SCText text = new CustomView.SCText(5, "text", btn._btn.transform, group.g_name, textFont, FontStyle.Normal, new Color(0, 0, 0, 1), TextAnchor.MiddleCenter, new Vector2(0, 0), new Vector2(1, 1), new Vector2(0, 0), new Vector2(0, 0)); }
//获取操作的组名并存放于数组中 void getDataForGroup() { DbAccess db = new DbAccess("data source = " + Application.dataPath + "/ModelData/NDtreatmentnew.db"); string sqlStr = "select distinct NC_groupid,NC_groupname from NT_operation order by NC_groupid"; SqliteDataReader result = db.ExecuteQuery(sqlStr); while (result.Read()) { string id = result.GetString(result.GetOrdinal("NC_groupid")); string name = result.GetString(result.GetOrdinal("NC_groupname")); Operation.SCGroup temp = new Operation.SCGroup(id, name); stateGroupArry.Add(temp); } result.Close(); db.CloseSqlConnection(); }