You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -61,32 +64,40 @@ public class Test : MonoBehaviour
61
64
62
65
}
63
66
64
-
// Adding Tag
65
-
// Be careful, if you create a copy of an existing object with runtime added tags, these tags will not be copied to the new object.
67
+
// Add Tag
68
+
// Be careful, if you create a copy of an existing object with added/removed tags via API (AddTag, RemoveTag, etc).
69
+
// These tags will not be copied to the new object.
70
+
// But I'll implement a way to copy tags in the future.
66
71
_enemy.AddTag(_zombieTag);
67
72
68
-
//Removing Tag
73
+
//Remove Tag
69
74
_enemy.RemoveTag(_zombieTag);
70
75
71
76
72
-
//Getting all objects with tag
77
+
//Get all objects with tag
73
78
varzombies=_zombieTag.GetInstances();
74
79
75
80
foreach (varzombieinzombies)
76
81
{
77
82
// Do something
78
83
}
84
+
85
+
// Instead of gameObject you can use any class that inherits from Component (transform, collider, etc)
86
+
// Example:
87
+
_enemy.transform.AddTag(_zombieTag);
79
88
}
80
89
}
81
90
```
82
91
83
92
</p>
84
93
</details>
85
94
86
-
### Tags Container Usage
87
-
Tags Container allows you to group tags in a single asset, which allows you to check a single object for multiple tags at once. In my games, I use containers most often for a system of relationships between entities.
95
+
### CompositeTag Usage
96
+
CompositeTag allows you to combine tags into single asset and use API with that asset (AddTags, RemoveTags, HasTags)
97
+
98
+
Example:
88
99
89
-

100
+

90
101
91
102
92
103
### Performance Test
@@ -146,17 +157,6 @@ namespace ToolBox.Test
146
157
</p>
147
158
</details>
148
159
149
-
<details><summary>Scene and Objects Setup</summary>
0 commit comments