Coming soon - Get a detailed view of why an account is flagged as spam!
view details

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.

2
Multiple tags are not possible, so what are the alternatives?
Post Flair (click to view more posts with a particular flair)
Post Body

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 class singleton 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.

Author
Account Strength
100%
Account Age
15 years
Verified Email
Yes
Verified Flair
No
Total Karma
647,654
Link Karma
110,504
Comment Karma
533,903
Profile updated: 1 day ago
Posts updated: 5 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
2 years ago