/** * AddTag */ public static void AddTag(this GameObject go, string stag) { if (go == null) { throw new System.ArgumentNullException("go"); } MultiTag multitag; if (MultiTag.TryGetMultiTag(go, out multitag)) { multitag.AddTag(stag); } else { if (MultiTag.IsEmptyTag(go.tag)) { go.tag = stag; } else { multitag = go.AddComponent <MultiTag>(); multitag.AddTag(stag); } } }
public bool ContainsTag(string tag) { if (_tags == null || _tags.Length == 0) { return(MultiTag.IsEmptyTag(tag)); } return(System.Array.IndexOf(_tags, tag) >= 0); }