コード例 #1
0
        private static void GetEventList <T>(GameObject go, IList <IEventSystemHandler> results) where T : IEventSystemHandler
        {
            if (results == null)
            {
                throw new ArgumentException("Results array is null", "results");
            }
            if (!(go == null) && go.activeInHierarchy)
            {
                List <Component> list = ListPool <Component> .Get();

                go.GetComponents <Component>(list);
                for (int i = 0; i < list.Count; i++)
                {
                    if (ExecuteEvents.ShouldSendToComponent <T>(list[i]))
                    {
                        results.Add(list[i] as IEventSystemHandler);
                    }
                }
                ListPool <Component> .Release(list);
            }
        }
コード例 #2
0
        private static void GetEventList <T>(GameObject go, IList <IEventSystemHandler> results) where T : IEventSystemHandler
        {
            if (results == null)
            {
                throw new ArgumentException("Results array is null", "results");
            }
            if ((UnityEngine.Object)go == (UnityEngine.Object)null || !go.activeInHierarchy)
            {
                return;
            }
            List <Component> componentList = ListPool <Component> .Get();

            go.GetComponents <Component>(componentList);
            for (int index = 0; index < componentList.Count; ++index)
            {
                if (ExecuteEvents.ShouldSendToComponent <T>(componentList[index]))
                {
                    results.Add(componentList[index] as IEventSystemHandler);
                }
            }
            ListPool <Component> .Release(componentList);
        }