1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- using System.Collections;
- using System.Collections.Generic;
- using LitJson;
- using UnityEngine;
- using UnityEngine.UI;
- public class ChangePass : MonoBehaviour
- {
- public GameObject savesuccess;
- public GameObject terror;
- public GameObject terror2;
- public InputField inputold;
- public InputField inputnew1;
- public InputField inputnew2;
- public void changepass()
- {
- string oldpass = AesEncryption.Encrypt(inputold.text);
- string encrypted1 = AesEncryption.Encrypt(inputnew1.text);
- string encrypted2 = AesEncryption.Encrypt(inputnew1.text);
- if(encrypted1==encrypted2)
- {
- DataManager.Instance.setPass(oldpass,encrypted1,(msg) => {
- JsonData d = JsonMapper.ToObject(msg);
- if(d["data"]==null)
- {
- terror.SetActive(true);
- }
- else
- {
- terror2.SetActive(false);
- terror.SetActive(false);
- savesuccess.SetActive(true);
- Invoke("savecloes",2f);
-
- }
- });
- }
- else
- {
- terror2.SetActive(true);
- }
-
- }
- void savecloes()
- {
- savesuccess.SetActive(false);
- MainCenterManager.Instance.showMain();
- }
- }
|