首页 > 解决方案 > 有什么办法可以加快使用 Google Play 游戏打开存档的速度吗?

问题描述

我正在使用 Unity 的官方 Google Play 游戏插件。我OpenWithAutomaticConflictResolution用来打开一个特定的保存。问题是它非常慢。平均需要 400 到 500 毫秒才能完成,在某些情况下可能需要长达 8 秒。我正在使用此代码对过程进行计时

        Stopwatch sw = new Stopwatch();
        sw.Start();
        PlayGamesPlatform.Instance.SavedGame.OpenWithAutomaticConflictResolution(filename, GooglePlayGames.BasicApi.DataSource.ReadCacheOrNetwork,
            ConflictResolutionStrategy.UseOriginal, (status, data) =>
            {
                sw.Stop();
                System.Diagnostics.Debug.WriteLine($"[SW] Open {sw.ElapsedMilliseconds}");

保存文件不是特别大,不到 40 KB。此外,我希望设备上的缓存能够防止如此长的加载时间。我能做些什么来加快速度吗?

标签: c#unity3dgoogle-play-games

解决方案


推荐阅读