Beispiel #1
0
        public static List <ScriptWithEventHandlers> GetEventHandlerScriptsPacked(GameObject go)
        {
            List <ScriptWithEventHandlers> list = new List <ScriptWithEventHandlers>();

            MonoBehaviour[] components = go.GetComponents <MonoBehaviour>();
            foreach (MonoBehaviour component in components)
            {
                if (component is ComponentAdapter)
                {
                    continue; // ignore component descriptors
                }
                ScriptWithEventHandlers mapping = new ScriptWithEventHandlers();
                mapping.AddRange(GetMethodsBySignature(component.GetType(), typeof(void), typeof(Event)));

                list.Add(mapping);
            }

            return(list);
        }
Beispiel #2
0
        public static List<ScriptWithEventHandlers> GetEventHandlerScriptsPacked(GameObject go)
        {
            List<ScriptWithEventHandlers> list = new List<ScriptWithEventHandlers>();
            
            MonoBehaviour[] components = go.GetComponents<MonoBehaviour>();
            foreach (MonoBehaviour component in components)
            {
                if (component is ComponentAdapter)
                    continue; // ignore component descriptors

                ScriptWithEventHandlers mapping = new ScriptWithEventHandlers();
                mapping.AddRange(GetMethodsBySignature(component.GetType(), typeof(void), typeof(Event)));

                list.Add(mapping);
            }

            return list;
        }