This course is reall fantastic, thanks Hugo for the intermediate content and the many explanations regarding how things interconnect in c# and Unity. coming from a Java background I found the coding and explantions formidable.
While testing with multiple units I came about a quirk, which I wanted to mention, just in case anybody stumbles acros this:
In case your currently selected unit is killed by an enemy during the enemies turn the UnitActionSystem is not notified and when you start your turn you have a unit selected, which technically does no longer exist. If you try to shoot an enemy in this scenario you will lock inside a busy loop.
This is easily fixed by
- In the Unit manager checking wether or not when a unit is killed it was the currently selected Unit
- checking if the friendly Unit List still has at least one entry (otherwhise the game would be over)
- setting the selected unit to any remainig unit in the freindlyUnitList.
Hope that helps anyone