Skip to content

Commit 5fe1242

Browse files
authored
Update README.md
1 parent 75c4bcf commit 5fe1242

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

README.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
This package allows you to Tag Game Objects with ScriptableObjects.
33

44
### TODO
5-
- [ ] Editor support with custom inspector
5+
- [x] Editor support with custom inspector
66
- [ ] Add tag code generator to quickly access tags without referencing them in the inspector
77
- [ ] Add API to get entity's runtime added tags
88

@@ -11,6 +11,7 @@ This package allows you to Tag Game Objects with ScriptableObjects.
1111
- Add and remove tags via code and inspector
1212
- Work with ScriptableObjects instead of strings
1313
- Faster than Unity's tag system. Keep in mind that performance in build even faster than in editor
14+
- Editor support
1415

1516
## How to Install
1617
### Git Installation (Best way to get latest version)
@@ -28,23 +29,25 @@ Import MultiTags.unitypackage to your Unity Project
2829

2930
## Usage
3031

31-
### Creating new Tag/Container
32-
Assets/Create/ToolBox/MultiTags
32+
### How to create a new Tag/CompositeTag
33+
Assets/Create/ToolBox/Tags
3334

3435
### Change Tags in Editor
3536
If you want to change tags only in Runtime via code then ```Taggable``` component is unnecessary.
36-
![](https://imgur.com/EPxkbza.png)
37+
![](https://i.imgur.com/4IMUydj.png)
3738

38-
### Runtime Operations (HasTag, HasTags, AddTag, RemoveTag, GetInstances)
39+
### Runtime Operations (HasTag, HasTags, AddTag, RemoveTag, GetInstances, etc)
3940
<details><summary>Code</summary>
40-
<p>
41+
<p>
4142

4243
```csharp
44+
using ToolBox.Tags;
45+
4346
public class Test : MonoBehaviour
4447
{
4548
[SerializeField] private GameObject _enemy = null;
4649
[SerializeField] private Tag _zombieTag = null;
47-
[SerializeField] private TagsContainer _allEnemiesTags = null;
50+
[SerializeField] private CompositeTag _allEnemiesTags = null;
4851

4952
private void Awake()
5053
{
@@ -61,32 +64,40 @@ public class Test : MonoBehaviour
6164

6265
}
6366

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.
6671
_enemy.AddTag(_zombieTag);
6772

68-
// Removing Tag
73+
// Remove Tag
6974
_enemy.RemoveTag(_zombieTag);
7075

7176

72-
// Getting all objects with tag
77+
// Get all objects with tag
7378
var zombies = _zombieTag.GetInstances();
7479

7580
foreach (var zombie in zombies)
7681
{
7782
// Do something
7883
}
84+
85+
// Instead of gameObject you can use any class that inherits from Component (transform, collider, etc)
86+
// Example:
87+
_enemy.transform.AddTag(_zombieTag);
7988
}
8089
}
8190
```
8291

8392
</p>
8493
</details>
8594

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:
8899

89-
![](https://imgur.com/XTM5YOU.png)
100+
![](https://i.imgur.com/nnxY4kj.png)
90101

91102

92103
### Performance Test
@@ -146,17 +157,6 @@ namespace ToolBox.Test
146157
</p>
147158
</details>
148159

149-
<details><summary>Scene and Objects Setup</summary>
150-
<p>
151-
152-
![Scene Setup](https://imgur.com/IgSjjpz.png)
153-
154-
![A Object Setup](https://imgur.com/0kkITFa.png)
155-
156-
![B Object Setup](https://imgur.com/4DVS3XP.png)
157-
</p>
158-
</details>
159-
160160
<details><summary>Test Result</summary>
161161
<p>
162162

0 commit comments

Comments
 (0)