private void SetPlatformAuth(bool active) { IsPlatformAuth = active; PlatformService.SetPlatformAuth(IsPlatformAuth); }
public void Initialize(bool isEnableSavedGames = true, bool isRequestEmail = false, bool isRequestServerAuthCode = false, bool isRequestIdToken = false, InvitationReceivedDelegate invitationReceivedCallback = null, MatchDelegate matchCallback = null) { if (_isInited) { Log.Warning(nameof(GooglePlayGameService), "플랫폼은 이미 초기화 되어 있다"); return; } _isInited = true; Log.Verbose(nameof(GooglePlayGameService), "Initialize"); var config = new PlayGamesClientConfiguration.Builder(); // 구글 계정에 게임 저장 가능. if (isEnableSavedGames) { config = config.EnableSavedGames(); } // 게임이 실행되고 있지 않을 때 받은 게임 초대장을 처리하기 위해 Callback 등록. if (invitationReceivedCallback != null) { config = config.WithInvitationDelegate(invitationReceivedCallback); } // 플레이어의 email 주소를 요청. (동의 여부를 묻는 메시지가 나타난다.) if (isRequestEmail) { config = config.RequestEmail(); } // 게임이 실행되고 있지 않을 때 받은 턴기반 매치 알림에 대한 Callback 등록. if (matchCallback != null) { config = config.WithMatchDelegate(matchCallback); } // 서버 인증 코드를 생성하여 관련된 백엔드 서버 응용 프로그램에 전달하고 OAuth 토큰과 교환 할수 있도록 요청한다. if (isRequestServerAuthCode) { config = config.RequestServerAuthCode(false); } // ID 토큰을 생성하도록 요청한다. 이 OAuth 토큰을 사용하여 플레이어를 Firebase와 같은 다른 서비스로 식별 할수 있다. if (isRequestIdToken) { config = config.RequestIdToken(); } PlayGamesPlatform.InitializeInstance(config.Build()); #if BF_DEBUG PlayGamesPlatform.DebugLogEnabled = true; #endif // Google Play Games platform 활성화 PlayGamesPlatform.Activate(); _savedDataFilename = Application.identifier + "_cloud_savegame"; IsGuestUser = PlatformService.GetGuestUser(); IsPlatformAuth = PlatformService.GetPlatformAuth(); }
public void SetGuestUser(bool active) { IsGuestUser = active; PlatformService.SetGuestUser(IsGuestUser); }