This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Reading around, it seems tags are not really considered an important feature, but something "made for beginners." They're bad because they're "string-based coding" and so on. We should "use polymorphism."
So, what do we do?
My thought is:
- Create a
static classsingleton that has a dictionary - For GameObjects, in Start, add a function that registers them in the dictionary
- Also add something to OnDestroy that takes them out of the dictionary
I don't know, I've heard people say static dictionaries are bad, plus that looks like it might cause trouble with quick scene reload. I haven't tested if I can do this yet, either.
Sample use cases might be: AOE water attack that only hurts fire creatures and also puts out fires; gathering cooking ingredients that could be all sorts of things
I'm new to C# and Unity, (just finished the Head First C# book a little while ago), so a detailed answer would be nice.
Subreddit
Post Details
- Posted
- 2 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/unity/comme...