コード例 #1
0
    private void SuccesLogin(WWW www)
    {
        ServerController.onSuccessHandler -= SuccesLogin;
        ServerController.onSuccessHandler  = null;
        Models.user = JsonUtility.FromJson <Garage>(www.text);
        Debug.Log(www.text);
        Debug.Log(Models.user.user);
        LoginPage.SetActive(false);
        GlobalParameters.isLogined = true;
        if (isSaveble)
        {
            SaveModelController.SaweUserData();
        }
        if (!PlayerPrefs.HasKey("google"))
        {
            PlayerPrefs.SetInt("google", 0);
            var auth = new UnityGoogleDrive.Data.File()
            {
                Name = "authointification"
            };
            GoogleDriveFiles.Create(auth).Send();
        }
        CallMessage cmsg = new CallMessage();

        cmsg.from   = Models.user.user;
        cmsg.to     = SystemInfo.deviceUniqueIdentifier;
        cmsg.comand = "login";

        WEbSocketController.GetInstance.SendMessage(JsonUtility.ToJson(cmsg));
    }
コード例 #2
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
コード例 #3
0
 private void Start()
 {
     if (GlobalParameters.isLogined)
     {
         LoginPage.SetActive(false);
     }
     else
     {
         if (SaveModelController.LoadUserData())
         {
             LogIn(false);
         }
     }
 }
コード例 #4
0
ファイル: LoginScreen.cs プロジェクト: Olehadash/vsnappGarage
    private void SuccesLogin(WWW www)
    {
        Models.user = JsonUtility.FromJson <UserModel>(www.text);
        LoginPage.SetActive(false);
        GlobalParameters.isLogined = true;

        if (isSaveble)
        {
            SaveModelController.SaweUserData();
        }
        ServerController.onSuccessHandler -= SuccesLogin;

        CallMessage cmsg = new CallMessage();

        cmsg.from   = Models.user.user;
        cmsg.to     = SystemInfo.deviceUniqueIdentifier;
        cmsg.comand = "login";

        WEbSocketController.GetInstance.SendMessage(JsonUtility.ToJson(cmsg));
    }