Ejemplo n.º 1
0
 private void InitializeCommands(UnitData unitData)
 {
     _commandData = unitData.commandData;
     if (Owner != OwnerType.PLAYER || _commandData == null)
     {
         return;
     }
     for (int i = 0; i < _commandData.Length; i++)
     {
         CommandData     commandData     = _commandData[i];
         CommandProvider commandProvider = Instantiate(commandData.commandProviderPrefab, transform);
         commandProvider.RegisterUnit(this);
         string songName = commandData.song.name;
         Song   song     = ServiceLocator.Get <SongService>().Get(songName);
         commandProvider.RegisterSong(song);
     }
 }