I am trying to create multiplayer game in unity using Unet. Searched on web for design pattern but didn't find any promising answers. I have started with development and I am not sure if that is correct approach. I have explained flow below. Please let me know if I should go ahead with that or any other options:
As command works on player object only, I am creating network interface class for all non player objects which will implement commands for them. These interfaces will be attached to player object. e.g. Enemy manager class : this class spawns enemies. NetworkEnemyManager class : interface attached to player.
EnemyManager::spawnEnemy will call command function in interface and interface will call a enemy manager function which will instantiate enemies and then do the network spawn.
Please comment if question is not clear.
Aucun commentaire:
Enregistrer un commentaire