public bool HasTags(ReMultiTag tags) { if (tags.Tags.Count == 0) { return(true); } if (tags.RequireAll) { return(tags.Tags.TrueForAll(e => HasTag(e))); } else { return(tags.Tags.Any(e => HasTag(e))); } }
public static bool HasTag(this GameObject target, ReMultiTag tags) { if (!tagsCache.TryGetValue(target, out var _)) { if (target.GetComponent <ReTags>() is ReTags _tags) { tagsCache.Add(target, _tags); } else { return(false); } } return(tagsCache[target].HasTags(tags)); }