예제 #1
0
        public void Load()
        {
            while (loaders.Count > 0)
            {
                InvokeInfo invokeInfo = loaders.Dequeue();
                Object     obj;
                if (!allComponents.TryGetValue(invokeInfo.id, out obj))
                {
                    continue;
                }
                if (obj.IsDisposed)
                {
                    continue;
                }

                tempLoaders.Enqueue(invokeInfo);
                try
                {
                    invokeInfo.invoke(obj, null);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.ToString());
                }
            }

            SwapHelper.Swap(ref loaders, ref tempLoaders);
        }
예제 #2
0
        private void Start()
        {
            while (starts.Count > 0)
            {
                InvokeInfo invokeInfo = starts.Dequeue();
                Object     obj;
                if (!allComponents.TryGetValue(invokeInfo.id, out obj))
                {
                    continue;
                }

                try
                {
                    invokeInfo.invoke(obj, null);
                }
                catch (Exception e)
                {
                    Log.Error(e);
                }
            }
        }