Beispiel #1
0
        public void Add(Object obj)
        {
            allComponents.Add(obj.id, obj);

            Type type = obj.GetType();

            FastInvokeHandler loadInvoke = FastInvokeCache.GetMethod(type, "Load");

            if (loadInvoke != null)
            {
                loaders.Enqueue(new InvokeInfo(obj.id, loadInvoke));
            }
            FastInvokeHandler startInvoke = FastInvokeCache.GetMethod(type, "Start");

            if (startInvoke != null)
            {
                starts.Enqueue(new InvokeInfo(obj.id, startInvoke));
            }
            FastInvokeHandler updateInvoke = FastInvokeCache.GetMethod(type, "Update");

            if (updateInvoke != null)
            {
                updates.Enqueue(new InvokeInfo(obj.id, updateInvoke));
            }
        }
Beispiel #2
0
        public void Awake <A, B, C>(Object obj, A a, B b, C c)
        {
            Type type = obj.GetType();
            FastInvokeHandler awakeInvoke = FastInvokeCache.GetMethod(type, "Awake", typeof(A), typeof(B), typeof(C));

            if (awakeInvoke != null)
            {
                try
                {
                    awakeInvoke(obj, new object[] { a, b, c });
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.ToString());
                }
            }
        }
Beispiel #3
0
        public void Destroy(Object obj)
        {
            Type type = obj.GetType();
            FastInvokeHandler destoryInvoke = FastInvokeCache.GetMethod(type, "Destroy");

            if (destoryInvoke != null)
            {
                try
                {
                    destoryInvoke(obj, null);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.ToString());
                }
            }
        }
Beispiel #4
0
        public void Awake(Object obj)
        {
            Type type = obj.GetType();
            FastInvokeHandler awakeInvoke = FastInvokeCache.GetMethod(type, "Awake");

            if (awakeInvoke != null)
            {
                try
                {
                    awakeInvoke(obj, null);
                }
                catch (Exception e)
                {
                    Log.Error(e);
                }
            }
        }