Monday, October 10, 2022
HomeGame Developmentunity - What class ought to entry my database?

unity – What class ought to entry my database?


I wish to code a turn-based RPG, and I made a decision to make use of a database to retailer all abilities within the recreation. Now I’ve to determine as nicely which class can see this database, and the way lessons go round these knowledge.

(Edit: the principle motive I wish to use a DB is to keep away from enhancing abilities as scriptable objects within the editor. I assume they require too many clicks to edit in video games of this sort.)

My instinct says that nearly each class ought to be capable to see the database, and an attribute of abilities can be utilized as indicators.

For instance, suppose a ability has attributes skill_name and dialog. When a participant character makes use of a ability Strike, the character class spits a sign skill_used("Strike"). Any class acquired this sign will seek for Strike within the database and does its activity. For example, the dialogue_manager reveals dialog of Strike. I do not understand how complicated the precise coding is, however conceptually it could work.

Nevertheless, that is like making an enormous singleton class DATABASE. Any class can’t be examined with out the database.

Query: Is it tremendous to permit many lessons to entry the database? If not, what kind of lessons ought to entry the database, and the way?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments