mercredi 29 mars 2023

How to assign a specific icon to a specific weapon?

Each weapon in the game does have an icon that will be shown on screen when the weapon is picked up.

The weapons are implement as different classes all based on the same base abstract class.

What I'm trying to sketch up is how to define such relationship in the editor, specifically, I want to be able to change a weapon's icon by drag'n'drop a texture on some object in the inspector.

What I'm not looking for:

  • the use of enumerations to declare such relationship
  • not declaring a direct reference to a texture asset, i.e. a path.

How would you achieve that?

Aucun commentaire:

Enregistrer un commentaire