Skip to content
/ BetterTags Public

A new tag system for Unity that gives you the flexibility you need.

License

Notifications You must be signed in to change notification settings

rje/BetterTags

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

BetterTags

A new tag system for Unity that gives you the flexibility you need.

Features over the built in unity tagging system:

  • Tags can be defined at runtime, no need to maintain a canonical list.
  • Objects can have multiple tags associated with them, leave layers for rendering & physics
  • Case insensitive

How to use it?

From the editor:

  1. Import BetterTags into your project
  2. On objects you want to tag, add a BetterUtils.Tag component
  3. Add whatever initial tags you want to the Tag List property

Editor Image

From code:

Adding/removing/checking tags:

  using BetterTag;

  var go = <some game object>;
  go.AddTag("my_new_tag");
  go.RemoveTag("some_other_tag");
  if(go.HasTag("conditional_tag")) {
    DoSomething();
  }

Finding things by tag:

  using BetterTag;

  GameObject obj = TagSystem.GameObjectForTag("other_tag_to_find");
  List<GameObject> objs = TagSystem.AllGameObjectsForTag("tag_to_find");

License

All code available under the MIT license

Feedback

Questions/Comments? Hit me up on twitter: @rje

Fixes or feature additions? Send a pull request, happy to integrate them!

About

A new tag system for Unity that gives you the flexibility you need.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages