Assets/BrightBit/EventSystem/EventDirector.cs
/// <summary>
/// Searches all events declared in all sub classes of the EventDirector
/// instance that is calling this method.
/// </summary>
Searches all events declared in all sub classes of the EventDirector
instance that is calling this method.
Searches all events declared in all sub classes of the EventDirector instance that is calling this method .
List<FieldInfo> FindAllEventFields()
    {
        List<FieldInfo> result = new List<FieldInfo>();
        Type currentType       = this.GetType();
        BindingFlags bindingMask = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly;
        while (currentType != null && currentType != typeof(EventDirector))
        {
            foreach (FieldInfo field in currentType.GetFields(bindingMask))
            {
                if (field.FieldType.IsSubclassOf(typeof(BrightBit.EventSystem.Event))) result.Add(field);
            }
            currentType = currentType.BaseType;
        }
        if (result == null || result.Count == 0) Debug.LogWarning(this + "::" + MethodBase.GetCurrentMethod().Name + "() : Could not find any field of type 'Event'!");
        return result;
    }
List < FieldInfo > FindAllEventFields ( ) { List < FieldInfo > result = new List < FieldInfo > ( ) ; Type currentType = this . GetType ( ) ; BindingFlags bindingMask = BindingFlags . Public | BindingFlags . NonPublic | BindingFlags . Instance | BindingFlags . DeclaredOnly ; while ( currentType != null && currentType != typeof ( EventDirector ) ) { foreach ( FieldInfo field in currentType . GetFields ( bindingMask ) ) { if ( field . FieldType . IsSubclassOf ( typeof ( BrightBit . EventSystem . Event ) ) ) result . Add ( field ) ; } currentType = currentType . BaseType ; } if ( result == null || result . Count == 0 ) Debug . LogWarning ( this + " " + MethodBase . GetCurrentMethod ( ) . Name + " " ) ; return result ; }
Searches all events declared in all sub classes of the EventDirector
instance that is calling this method.
Searches all events declared in all sub classes of the EventDirector instance that is calling this method .
// look for all instance members declared at the level of the supplied type's hierarchy, i.e. inherited members are not considered