Tag Containers
A GameplayTagContainer stores a collection of Gameplay Tags:
Faction.EnemyCharacter.State.BurningDamage.Resistance.FireInteraction.UsableAn object can therefore be an enemy, burning, fire-resistant, and usable without four unrelated booleans.
Container operations
Section titled “Container operations”| Operation | Meaning |
|---|---|
| Add | Add a non-empty tag unless it is already present. |
| Remove | Remove a tag if present. |
| Clear | Remove every tag. |
| Has Tag | Check one tag. |
| Has Any | Require at least one tag from a query container. |
| Has All | Require every tag from a query container. |
| Equals Exact | Compare the complete tag sets. |
| Union | Create a container with tags from both inputs. |
| Intersect | Create a container with exact tags shared by both inputs. |
Containers normalize and sort their contents. Matching can be exact or use a parent query:
Owned: Damage.Type.FireQuery: Damage.TypeInclude Children: trueResult: trueExclusive parent groups
Section titled “Exclusive parent groups”Some states are mutually exclusive within the same parent category:
Quest.Main.AvailableQuest.Main.ActiveQuest.Main.CompletedThe Game Creator integration includes Actions for setting one exclusive child, changing a parent group, cycling sibling tags, and clearing children under a parent. Use them when the hierarchy itself defines the exclusive group.
Runtime behavior
Section titled “Runtime behavior”- Empty
Nonetags and duplicates are ignored. - Clearing an empty container and removing an absent tag are no-ops.
- Service and component APIs resolve configured redirects.
- Undefined tags can warn in the Editor or development builds.
C# example
Section titled “C# example”using SkywardGames.Runtime.GameplayTags;using UnityEngine;
public class BurningState : MonoBehaviour{ [SerializeField] private GameplayTagComponent tags;
private static readonly GameplayTag Burning = GameplayTag.FromPath("Character.State.Burning");
public void Apply() { tags.AddTag(Burning); }
public void Remove() { tags.RemoveTag(Burning); }}
