三国卡牌客户端基础资源仓库
yyl
2026-03-28 25eb0e50d4e815efb16d1a9953beac6ea1c7cfc3
Assets/Launch/VersionConfigEx.cs
@@ -66,20 +66,8 @@
    {
        get
        {
            if (string.IsNullOrEmpty(m_GameId))
            {
                var gameText = Resources.Load<TextAsset>("Game");
                if (gameText != null)
                {
                    m_GameId = gameText.text;
                }
                else
                {
                    m_GameId = "xssg";
                }
            }
            return m_GameId;
            // m_GameId 由 Get() 异步预加载,此处直接返回缓存值
            return string.IsNullOrEmpty(m_GameId) ? "xssg" : m_GameId;
        }
    }
@@ -159,7 +147,7 @@
        set { m_SdkFileName = value; }
    }
    static VersionConfigEx config = null;
    public static VersionConfigEx config = null;
    public async static UniTask<VersionConfigEx> Get()
    {
        if (config == null)
@@ -173,6 +161,15 @@
            }
        }
        // 预加载 gameId
        if (config != null && string.IsNullOrEmpty(config.m_GameId))
        {
            var gameReq = Resources.LoadAsync<TextAsset>("Game");
            await gameReq;
            TextAsset gameText = gameReq.asset as TextAsset;
            config.m_GameId = gameText != null ? gameText.text : "xssg";
        }
        return config;
    }