Exemple #1
0
        void HotloadIndex(ConfigSource source)
        {
            var files = source.GetFiles();

            foreach (var finfo in files)
            {
                if (!m_configFiles.Contains(finfo.Name))
                {
                    m_configFiles.Add(finfo.Name);
                }
                bool isNewFile = !m_loadedFiles.ContainsKey(finfo.Name);
                m_loadedFiles[finfo.Name] = finfo;
                if (isNewFile && OnHotloadFile != null)
                {
                    OnHotloadFile(finfo.Name);
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// Loads all files from the source immediately.  For editor tooling.
        /// </summary>
        public void LoadFromSourceImmediately(ConfigSource source)
        {
            Config.Assert(Platform.Instance.CanDoImmediatePreload, "Trying to load immediately on a platform that doesn't support it");
            m_isPreloading = true;
            Config.Log(LogVerbosity.Info, "Immediate-loading " + source);

            source.Preload(() => {});  // assume that this is immediate
            var files = source.GetFiles();

            foreach (var finfo in files)
            {
                m_configFiles.Add(finfo.Name);
                m_loadedFiles.Add(finfo.Name, finfo);
            }

            m_isPreloading = false;
            m_isPreloaded  = true;
        }