123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- 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);
- }
- }
|