unity ios login

 

 

unity ios login

 

// quick login
	public void QuickLogin()
	{
		Debug.Log ("--------------- quick login -------------");
        Facade.Instance.SendNotification(LoginNotes.SHOW_CONNECT_GAMECENTER);
		Social.localUser.Authenticate (_HandleAuthenticated);
	}


	private void _HandleAuthenticated(bool success)
	{
		_userInfo = ""; 
		Debug.Log ("--------- login static ----------------: " + success);
		if (success)
		{
			Debug.Log("-------------- login success --------");
			//@"TestType", @"type",
			//[AppGameCenterForZszb instance].mId, @"id",
			//[AppGameCenterForZszb instance].mUserName, @"userName",
			//@"TestPassword", @"password",
			//@"123", @"token", nil];
            Debug.Log("authenticated :" + Social.localUser.authenticated 
                    + "\n          id :" + Social.localUser.id 
                    + "\n   user name :" + Social.localUser.userName 
                    + "\n    underage :" + Social.localUser.underage
                    + "\n       state :" + Social.localUser.state);
			_userInfo = _CreateUserInfo("type", Social.localUser.id, Social.localUser.userName, "pw", "123");
			//SendMessage(gameObject.name, "OnMessage", MSG_LOGIN_SUCCESS);
			SendMessage("OnMessage", MSG_LOGIN_SUCCESS);
		} 
		else 
		{
			SendMessage("OnMessage", MSG_LOGIN_FAIL);
            Hint.Show(OTManager.Get("hint_login_GameCenter_fail"));
		}
        Facade.Instance.SendNotification(LoginNotes.HIDE_CONNECT_GAMECENTER);
	}

 

你可能感兴趣的:(unity)