for the attack of a character, first we have the base class in the role The Entity class defines the attack animation function for the role, subclasses such as the Warrior class only need to call the parent class method, and then play the effect .
for the loading and management of special effects, the first effect is a life cycle, the general art will do well, we can directly get the life cycle of special effects and so on, can be regarded as a special effect information class. then we need to create a Effect class for the logical management of the effects ( A class that does not inherit from the monobehaviour ), such as the initialization of special effects
Operation . then you need a management class for the special effects, which should be a Singleton class that inherits from Monobehaviour.
a singleton class that inherits from Monobehaviour is written as follows:
Effectmanager Management class is responsible for external exposure interface, the creation of special effects and destruction operations ... In addition, the general management class we need to create a dictionary or List to manage the creation of special effects resources, manage the life cycle of special effects resources, or reuse resources to achieve efficient resource utilization and smooth running of the game.
To be continued .....
Role attacks and the loading and management of special effects