Jump to content
  • Advertisement
Sign in to follow this  
coremarq

Unity Help clarify if I'm organizing these objects properly

This topic is 853 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

OK, I've only been using Unity for about a week now and loving it so far. Though I've never used an engine or a full on Entity/Component system before either, so I don't know if I'm confused or just over complicating things. Hell I'll probably figure it out just from typing this out ;-)

 

QUESTION 1:

 

Basic Scenario ;

 

I have 3 objects, The Game (logic and global game specific data), Hero and a Monster. The hero should attack the monster every time it can, and the game keeps track of how many monsters are killed. What I'm confused about is the way all these objects will interact with each other.

 

Normally I would have a structure kinda like so ;

 

vector<Hero>;

vector<Monster>;

class CombatController; 

 

The CombatController would update all the heroes timers and handle triggering the heroes to attack and applying that heroes damage to the monsters and so forth. Is that logical in Unity? Should I just make an empty object that is simply just a script to handle that logic?

 

QUESTION 2:

 

Probably a dumb question, if I want to add a variable to an object such as hero having a damage value. Right now I just add a script to the object and add a member to the class. Is that correct?

 

 

 

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!