/// <summary> /// 修改sdkManager Login状态 参数2:sdk登陆成功的回调数据 /// </summary> public void ChangeSDKManagerLoginState(int state, SDKLoginCompleteData onCompleteData = null) { currentSDKLoginState = (SDKManagerLoginState)state; switch (currentSDKLoginState) { case SDKManagerLoginState.Login_Delete: case SDKManagerLoginState.Login_Cancle: DebugLog("登录未成功!当前登录状态码:" + currentSDKLoginState); if (onCompleteData == null) { onCompleteData = new SDKLoginCompleteData() { result = false, }; } break; case SDKManagerLoginState.Login_Success: DebugLog("登录成功(此为sdk验证登录了(服务器暂未登陆)!!当前登录状态码:" + currentSDKLoginState); break; default: return; } if (onGameLoginComplete != null && onCompleteData != null) { DebugLog("执行登陆回调!"); onGameLoginComplete(onCompleteData); onGameLoginComplete = null; } }
/// <summary> /// 修改sdkManagerInit状态 /// </summary> public void ChangeSDKManagerState(SDKManagerState state) { if (state == currentSDKManagerState) { return; } currentSDKManagerState = state; switch (state) { case SDKManagerState.ExitSuccess: DebugLog("SDK Manager 退出成功!"); currentSDKManagerState = SDKManagerState.UnInit; currentSDKManager = null; currentSDKLoginState = SDKManagerLoginState.Login_Un; //未登录状态 currentSDKPayOrderState = SDKManagerPayOrderState.PayOrder_Un; //支付空闲状态 if (onGameExitComplete != null) { onGameExitComplete(); //执行回调 onGameExitComplete = null; } break; case SDKManagerState.ExitError: DebugLog("SDK Manager 退出失败!"); currentSDKManagerState = SDKManagerState.InitSuccess; break; } DebugLog("SDK Manager 新状态:" + currentSDKManagerState); }