public bool CanEditType(Type t) { pb_GizmoAttribute attrib = this.GetType().GetCustomAttributes(true).FirstOrDefault(x => x is pb_GizmoAttribute) as pb_GizmoAttribute; if (attrib != null) { return(attrib.CanEditType(t)); } return(false); }
private static void RebuildGizmoLookup() { gizmoLookup = new Dictionary <Type, Type>(); foreach (Type t in BuiltinGizmos) { pb_GizmoAttribute attrib = (pb_GizmoAttribute)((IEnumerable <Attribute>)t.GetCustomAttributes(true)).FirstOrDefault(x => x is pb_GizmoAttribute); if (attrib != null) { gizmoLookup.Add(attrib.type, t); } } }