Пример #1
0
    public void OnSavedGameOpenedAndWrite(SavedGameRequestStatus status, ISavedGameMetadata game)
    {
        // 코너 케이스 테스트를 위한 코드
        if (OnSavedGameOpenedAndWriteAlwaysInternalError)
        {
            status = SavedGameRequestStatus.InternalError;
        }

        if (status == SavedGameRequestStatus.Success)
        {
            // handle reading or writing of saved game.

            PlatformInterface.instance.logger.LogFormat(
                "OnSavedGameOpenedAndWrite: Save game open (write) success! Filename: {0}", game.Filename);

            SerializeAndSaveGame(game);
        }
        else
        {
            // handle error
            if (status == SavedGameRequestStatus.InternalError)
            {
                // Google Play 게임 앱 버전이 낮아서 InternalError가 나는 사례도 두 번 정도 제보되었다.
                // 여기서 관련된 정보를 추가로 알려주면 어쩌면 좋을지도...?
                platformSaveUtil.ShowSaveErrorPopupWithGooglePlayGamesUpdateButton(
                    $"OnSavedGameOpenedAndWrite: Save game open (write) failed! - {status}\nPlease consider updating Google Play Games app.");
            }
            else
            {
                platformSaveUtil.ShowSaveErrorPopup(
                    $"OnSavedGameOpenedAndWrite: Save game open (write) failed! - {status}");
            }

            //rootCanvasGroup.interactable = true;
            PlatformInterface.instance.logManager.Add(PlatformInterface.instance.logEntryType.GameCloudSaveFailure, 0,
                                                      2);
        }
    }