Exemple #1
0
        /// <summary>
        /// 加载全局配置。
        /// </summary>
        /// <param name="configAssetName">全局配置资源名称。</param>
        /// <param name="loadType">全局配置加载方式。</param>
        /// <param name="priority">加载全局配置资源的优先级。</param>
        /// <param name="userData">用户自定义数据。</param>
        public void LoadConfig(string configAssetName, LoadType loadType, int priority, object userData)
        {
            if (m_ResourceManager == null)
            {
                throw new GXException("You must set resource manager first.");
            }

            if (m_ConfigHelper == null)
            {
                throw new GXException("You must set config helper first.");
            }

            LoadConfigInfo loadConfigInfo = LoadConfigInfo.Create(loadType, userData);

            if (loadType == LoadType.TextFromAsset || loadType == LoadType.BytesFromAsset || loadType == LoadType.StreamFromAsset)
            {
                m_ResourceManager.LoadAsset(configAssetName, priority, m_LoadAssetCallbacks, loadConfigInfo);
            }
            else
            {
                m_ResourceManager.LoadBinary(configAssetName, m_LoadBinaryCallbacks, loadConfigInfo);
            }
        }
Exemple #2
0
        /// <summary>
        /// 加载全局配置。
        /// </summary>
        /// <param name="configAssetName">全局配置资源名称。</param>
        /// <param name="loadType">全局配置加载方式。</param>
        /// <param name="priority">加载全局配置资源的优先级。</param>
        /// <param name="userData">用户自定义数据。</param>
        public void LoadConfig(string configAssetName, LoadType loadType, int priority, object userData)
        {
            if (m_ResourceManager == null)
            {
                throw new GameFrameworkException("You must set resource manager first.");
            }

            if (m_ConfigHelper == null)
            {
                throw new GameFrameworkException("You must set config helper first.");
            }

            m_ResourceManager.LoadAsset(configAssetName, priority, m_LoadAssetCallbacks, LoadConfigInfo.Create(loadType, userData));
        }