- Home /
This question was
closed Mar 21, 2012 at 08:14 AM by
hijinxbassist for the following reason:
The question is answered, right answer was accepted in form of comment by syclamoth
Question by
hijinxbassist · Mar 21, 2012 at 06:49 AM ·
tagtagsframework
How can i get a list of tags from the tag manager?
What i am trying to do is return all available tags from the tag manager. I don't want to iterate through objects to find used tags...i want any and all tags that have been manually assigned and the default set-up tags in the tag manager. If someone knows the framework and can point me in a positive direction id be more than appreciative.
Comment
have u tried EDIT > PROJECT SETTINGS > TAGS
there u can input your tags one by one $$anonymous$$ANUALLY...
@@ welcome..
Best Answer
Answer by syclamoth · Mar 21, 2012 at 07:02 AM
The only thing I can find is EditorGUI.TagField, but I don't think that'd help. Try using a dll viewer on UnityEngine to see how that one is implemented.
string to_search_tag="Player";
for (int i = 0; i < UnityEditorInternal.InternalEditorUtility.tags.Length; i++) {
if (UnityEditorInternal.InternalEditorUtility.tags[i].Contains(to_search_tag)) {
Debug.Log ("At Position " + i + " is the Tag " + to_search_tag + " found :) ");
break;// attention : the first index is 0 !!!
}else{
}
}