static public FilteredMsgTypeList Filtered(GameObject inGameObject, FilterByFlag inAttr)
        {
            if (inGameObject == null)
            {
                if (inAttr == null)
                {
                    return(All());
                }
                return(Filtered(inAttr));
            }
            if (inAttr == null)
            {
                return(Filtered(inGameObject, MsgFlags.None, MsgFlags.None));
            }

            return(Filtered(inGameObject, inAttr.FilterAll, inAttr.FilterAny));
        }
Exemple #2
0
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            FilterByFlag        attr = attribute as FilterByFlag;
            FilteredMsgTypeList list = null;

            if (LimitToSelf.IsDefined(fieldInfo, typeof(LimitToSelf), true))
            {
                Component c = property.serializedObject.targetObject as Component;
                if (c != null)
                {
                    list = FilteredMsgTypeList.Filtered(c.gameObject, attr);
                }
            }

            if (list == null)
            {
                list = FilteredMsgTypeList.Filtered(attr);
            }

            MsgEditorGUI.MsgTypeField(position, property, label, list);
        }
        static public FilteredMsgTypeList Filtered(FilterByFlag inAttribute)
        {
            if (inAttribute == null || (inAttribute.FilterAll == MsgFlags.None && inAttribute.FilterAny == MsgFlags.None))
            {
                return(All());
            }

            Initialize();

            FilteredMsgTypeList list;

            if (!s_Lists.TryGetValue(inAttribute, out list))
            {
                List <Metadata> types = null;
                Manager.Get().Database.FindAll(inAttribute.FilterAll, inAttribute.FilterAny, ref types);
                list = new FilteredMsgTypeList(types);
                s_Lists.Add(inAttribute, list);
            }

            return(list);
        }