private void unregisterTags(LabelHandle handle) { List<TagEnum> tags = handle.getTagTypes(); foreach (TagEnum tag in tags) { if (knownTags.ContainsKey(tag)) { knownTags[tag].Remove(handle.getTag(tag)); } } }
private void unregisterTags(LabelHandle handle) { List<TagEnum> tags = handle.getTagTypes(); foreach (TagEnum tag in tags) { if (knownTags.ContainsKey(tag)) { knownTags[tag].Remove(handle.getTag(tag)); } } foreach (Tag tag in targetSightings[handle].getAttachedTags()) { if (previouslyKnownTags.ContainsKey(tag.type)) { previouslyKnownTags[tag.type].Add(tag); //Debug.Log("registering tag: " + handle.getTag(tag).GetType() + " as " + tag.ToString()); } else { List<Tag> tagList = new List<Tag>(); tagList.Add(tag); previouslyKnownTags[tag.type] = tagList; //Debug.Log("registering tag: " + handle.getTag(tag).GetType() + " as " + tag.ToString() ); } } }
private void registerTags(LabelHandle handle) { List<TagEnum> tags = handle.getTagTypes(); foreach (TagEnum tag in tags) { if (knownTags.ContainsKey(tag)) { knownTags[tag].Add(handle.getTag(tag)); //Debug.Log("registering tag: " + handle.getTag(tag).GetType() + " as " + tag.ToString()); } else { List<Tag> tagList = new List<Tag>(); tagList.Add(handle.getTag(tag)); knownTags[tag] = tagList; //Debug.Log("registering tag: " + handle.getTag(tag).GetType() + " as " + tag.ToString() ); } } }
private void registerTags(LabelHandle handle) { // Clean out all stale tags from this LabelHandle before registering new ones SensoryInfo info; staleTargetSightings.TryGetValue(handle, out info); if (info != null) { foreach (Tag tag in info.getAttachedTags()) { List<Tag> staleTags; previouslyKnownTags.TryGetValue(tag.type, out staleTags); if (staleTags != null) { staleTags.Remove(tag); } } } List<TagEnum> tags = handle.getTagTypes(); foreach (TagEnum tag in tags) { if (knownTags.ContainsKey(tag)) { knownTags[tag].Add(handle.getTag(tag)); //Debug.Log("registering tag: " + handle.getTag(tag).GetType() + " as " + tag.ToString()); } else { List<Tag> tagList = new List<Tag>(); tagList.Add(handle.getTag(tag)); knownTags[tag] = tagList; //Debug.Log("registering tag: " + handle.getTag(tag).GetType() + " as " + tag.ToString() ); } } }