コード例 #1
0
        public static void Init(Action <int, int> progress = null, Action finished = null)
        {
            Action action;
            Action action2 = null;
            Action action3 = null;

            if (SystemSwitch.UseHmf)
            {
                Stopwatch stopwatch = new Stopwatch();
                stopwatch.Start();
                m_instance.LoadData(m_instance.m_defaultData, new Func <string, Type, Type, object>(m_instance.FormatHmfData), null);
                stopwatch.Stop();
                LoggerHelper.Info("InitSynHmfData time: " + stopwatch.ElapsedMilliseconds, true);
                if (DataLoader.m_isPreloadData)
                {
                    if (action2 == null)
                    {
                        action2 = () => m_instance.InitAsynData(new Func <string, Type, Type, object>(m_instance.FormatHmfData), progress, finished);
                    }
                    action = action2;
                    if (SystemSwitch.ReleaseMode)
                    {
                        action.BeginInvoke(null, null);
                    }
                    else
                    {
                        action();
                    }
                }
                else
                {
                    finished();
                }
            }
            else
            {
                m_instance.LoadData(m_instance.m_defaultData, new Func <string, Type, Type, object>(m_instance.FormatXMLData), null);
                if (DataLoader.m_isPreloadData)
                {
                    if (action3 == null)
                    {
                        action3 = () => m_instance.InitAsynData(new Func <string, Type, Type, object>(m_instance.FormatXMLData), progress, finished);
                    }
                    action = action3;
                    if (SystemSwitch.ReleaseMode)
                    {
                        action.BeginInvoke(null, null);
                    }
                    else
                    {
                        action();
                    }
                }
                else
                {
                    finished();
                }
            }
        }
コード例 #2
0
 public static void Init(Action <int, int> progress = null, Action finished = null)
 {
     if (SystemSwitch.UseHmf)
     {
         Stopwatch sw = new Stopwatch();
         sw.Start();
         m_instance.LoadData(m_instance.m_defaultData, m_instance.FormatHmfData, null);
         sw.Stop();
         //LoggerHelper.Info("InitSynHmfData time: " + sw.ElapsedMilliseconds);
         if (m_isPreloadData)
         {
             Action action = () => { m_instance.InitAsynData(m_instance.FormatHmfData, progress, finished); };
             if (SystemSwitch.ReleaseMode)
             {
                 action.BeginInvoke(null, null);
             }
             else
             {
                 action();
             }
         }
         else
         {
             finished();
         }
     }
     else
     {
         m_instance.LoadData(m_instance.m_defaultData, m_instance.FormatXMLData, null);
         if (m_isPreloadData)
         {
             Action action = () => { m_instance.InitAsynData(m_instance.FormatXMLData, progress, finished); };
             if (SystemSwitch.ReleaseMode)
             {
                 action.BeginInvoke(null, null);
             }
             else
             {
                 action();
             }
         }
         else
         {
             finished();
         }
     }
 }