public static void Start_Stop_db_info() { string db_path = PublicClass.filePath + "sign_ssp_path/StartStop_1.db"; //接口暂无 //http://118.24.119.234:8083/vesal-jiepao-test/v1/app/xml/getAllStartStop MakeStaticDBTable <SignNewInfo> .sign_UpdateTable(PublicClass.server_ip + "v1/app/xml/getAllStartStop", db_path, false); }
void Update() { if (PublicClass.app.app_type != "sign_ssp") { return; } if (Input.GetKeyDown(KeyCode.T)) { MakeStaticDBTable <StartStopInfo> .SetTextureDataToDB(PublicClass.filePath + "StartStop", db_path); } #if UNITY_DEBUG if (Input.GetKeyDown(KeyCode.F1)) { MakeStaticDBTable <StartStopInfo> .sign_UpdateTable(PublicClass.server_ip + "v1/app/xml/getAllStartStop", db_path, true); } if (Input.GetKeyDown(KeyCode.R)) { Debug.Log("r已被按下"); for (int i = 0; i < sspEleList.Count; i++) { Debug.Log("进入循环,查找目前记录的物体"); if (sspEleList[i].gameObject.GetComponent <Image>().color == new Color(33 / 255.0f, 167 / 255.0f, 212 / 255.0f, 85 / 255.0f)) { camera_params str = new camera_params(); str.camera_pos = new vector3(); str.camera_pos.x = Camera.main.transform.position.x; str.camera_pos.y = Camera.main.transform.position.y; str.camera_pos.z = Camera.main.transform.position.z; str.camera_parent_rot = new vector3(); str.camera_parent_rot.x = Camera.main.transform.parent.transform.eulerAngles.x; str.camera_parent_rot.y = Camera.main.transform.parent.transform.eulerAngles.y; str.camera_parent_rot.z = Camera.main.transform.parent.transform.eulerAngles.z; str.camera_parent_pos = new vector3(); str.camera_parent_pos.x = Camera.main.transform.parent.transform.position.x; str.camera_parent_pos.y = Camera.main.transform.parent.transform.position.y; str.camera_parent_pos.z = Camera.main.transform.parent.transform.position.z; sspInfoList[i].camera_params = JsonConvert.SerializeObject(str); // sspInfoList[i].app_id="SA0C01001"; Debug.Log("记录摄像机数据成功"); } } } if (Input.GetKeyDown(KeyCode.W)) { // local_db.DataService("StartStop.db"); local_db.CreateDb(db_path); UpdateSSPTable(); Debug.Log("写入摄像机数据成功"); local_db.Close(); } #endif if (ChooseModel.CheckGuiRaycastObjects()) { return; } if (Input.GetMouseButtonDown(0)) { List <Ray> ray_list = new List <Ray>(); List <RaycastHit> hit_list = new List <RaycastHit>(); Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); ray_list.Add(ray); Ray ray1 = Camera.main.ScreenPointToRay(Input.mousePosition + new Vector3(0, 2, 0)); ray_list.Add(ray1); Ray ray2 = Camera.main.ScreenPointToRay(Input.mousePosition + new Vector3(0, -2, 0)); ray_list.Add(ray2); Ray ray3 = Camera.main.ScreenPointToRay(Input.mousePosition + new Vector3(2, 0, 0)); ray_list.Add(ray3); Ray ray4 = Camera.main.ScreenPointToRay(Input.mousePosition + new Vector3(-2, 0, 0)); ray_list.Add(ray4); for (int k = 0; k < ray_list.Count; k++) { RaycastHit hit; if (Physics.Raycast(ray_list[k], out hit)) { hit_list.Add(hit); //for (int i = 0; i < sspInfoList.Count; i++) //{ //dic[sspInfoList[i].mod_name].gameObject.SetActive(false); //} if (model_maskTex_dic.ContainsKey(hit.transform.gameObject.GetComponent <Model>())) { maskTexPNG = model_maskTex_dic[hit.transform.gameObject.GetComponent <Model>()]; } Vector2 pixelUV = hit.textureCoord2; pixelUV.x *= maskTexPNG.width; pixelUV.y *= maskTexPNG.height; chosCol = maskTexPNG.GetPixel((int)pixelUV.x, (int)pixelUV.y); if (chosCol == Color.black) { continue; } clickTimes++; for (int i = 0; i < sspList.Count; i++) { ExpPanel.SetActive(true); MenuPanel.SetActive(false); isListOpen = false; if (sspList[i].startCol == new Vector3(chosCol.r, chosCol.g, chosCol.b)) { ShowInfo(sspInfoList[i]); objPa.BroadcastMessage("ChangeChoseColor", chosCol); if (new Color(sspList[i].stopCol.x, sspList[i].stopCol.y, sspList[i].stopCol.z, 1) != Color.black) { objPa.BroadcastMessage("ChangeResColor", new Color(sspList[i].stopCol.x, sspList[i].stopCol.y, sspList[i].stopCol.z, 1)); } else { objPa.BroadcastMessage("ChangeResColor", Color.magenta); } ShowMuscle(sspInfoList[i]); return; } else if (sspList[i].stopCol == new Vector3(chosCol.r, chosCol.g, chosCol.b)) { ShowInfo(sspInfoList[i]); objPa.BroadcastMessage("ChangeResColor", chosCol); if (new Color(sspList[i].startCol.x, sspList[i].startCol.y, sspList[i].startCol.z, 1) != Color.black) { objPa.BroadcastMessage("ChangeChoseColor", new Color(sspList[i].startCol.x, sspList[i].startCol.y, sspList[i].startCol.z, 1)); } else { objPa.BroadcastMessage("ChangeChoseColor", Color.magenta); } ShowMuscle(sspInfoList[i]); return; } } } else { ExpPanel.SetActive(false); MenuPanel.SetActive(false); } } } }
public static void Sign_new_db_info() { string db_path = PublicClass.filePath + "sign_ssp_path/SignNew_1.db"; MakeStaticDBTable <SignNewInfo> .sign_UpdateTable(PublicClass.server_ip + "v1/app/xml/getTempSignNew", db_path, false); }