using System.Collections; using System.Collections.Generic; using LitJson; using UnityEngine; using UnityEngine.UI; public class createzhanghao : MonoBehaviour { public GameObject one; public GameObject cg; public GameObject sb; public InputField accinput; public InputField nameinput; public InputField deptinput; public InputField notesinput; public InputField positioninput; public InputField inputpass; public Toggle admintg; public void createrzh() { JsonData d = new JsonData(); d["account"] = accinput.text; d["name"] = nameinput.text; d["dept"] = deptinput.text; d["notes"] = notesinput.text; d["position"] = positioninput.text; d["admin"] = admintg.isOn?1:0; d["password"] = AesEncryption.Encrypt(inputpass.text); DataManager.Instance.createzh(d,(str)=>{ try{ JsonData j =JsonMapper.ToObject(str); if(bool.Parse(j["data"]["result"].ToString())) { cg.SetActive(true); Invoke("cgyc",2f); } else { sb.SetActive(true); Invoke("csbyc",2f); } }catch { sb.SetActive(true); Invoke("csbyc",2f); } }); } void cgyc() { cg.SetActive(false); this.gameObject.SetActive(false); one.SetActive(true); } void csbyc() { sb.SetActive(false); } }