Merge in CGD/gather-and-defend from prog/fix_detection_range to main
* commit '937624f54fafd20cbc70dd752fa00314139ec795':
remove underscore
fix detection range
problem :
detection range didn't show anymore on placeholders
solution :
calculate detection range from collider's offset and size instead of it's bound
- added art for house and UI
- put population in ResourceManager
- create house prefab
- added code for adding and removing pop depending on entity
- refactor harvesters so they inherit from ally
- modify placeholders and buttons so that only units cost population
- add events for population and resources changing
- add population relative configs to global config
- add start resources values to Levels
- add debug feature for generating resources for free
problème :
Il y avait plusieurs manières de faire planter le loading screen en appuyant sur des boutons
changements:
- turn off buttons when loading screen is active
- turn on buttons when loading screen is not active
- add event aggregator class to project and migrate every event to it
- fix bugs and regressions
Level selector was already working after work by William but some small bugs remained to be fixed + it wasn't possible to return to level selector once we were in the level.
- it's now possible to go back to level selector from Level
- LevelManagerScript is no longer a singleton (this way, it resets with the Game scene unloading)
- Added a property drawer for using scene files in inspectors
problème : il faut que les resource tiles produisent des resources seulement quand elles ont une unité au dessus d'elles pour les harvester.
solution : créer une classe harvester qui est vérifiée par la resource tile avant d'updater. Si aucun harvester n'est au dessus, aucune update n'est faite.
problems :
- game scene was not as shown in the GDD
- problem when moving tilemap (the placeholders didn't follow)
- possible to place units outside the game area
solutions :
- try to make the game scene as close to the gdd as possible
- don't move the tilemap : move the camera instead (this keeps the world position of tilemap intact)
- there was a logic bug in the DraggablePlaceholder. It ain't anymore
problème : le placeholder apparait au milieu de la map random quand on clique sur le bouton de création d'unité
solution : ne pas permettre de placer l'unité quand on est à l'extérieur de la zone de jeu + ne pas la faire apparaitre.
Problem :
Les unités et bâtiments ne coutaient rien à construire
Solution :
J'ai link le système de drag and drop au resource manager.
Note :
J'ai déshérité le ResourceManager de MonoBehaviour aussi, vu que c'est pas une fonctionalité qui nécessite d'être updaté par frame vraiment, c'est plus du stockage.
J'ai testé dans l'éditeur et tout semble fonctionel *fingers crossed*
problem : spelling errors and lisibility issues with some parts of the code
solution :
- used GetAllComponents generic nature to eliminate the need for casting
- cached sprite renderers in the Placeholder
- put hardcoded string in a const variable
problème :
- le range d'attaque n'apparaissait pas sur le placeholder des unités
- le outline ne fonctionnait pas bien sur toutes les unités
- le placeholder étant opaque, on ne pouvait pas voir la tuile en dessous
solutions :
- utiliser les bounds du collider de détection pour tracer le range des unités sur le placeholder
- utiliser un shader pour tracer un outline colorable autour des unités
- rendre le placeholder plus transparent
logic was supposed to allow placing object on farms, which it didn't
now it does.
+ changed ObjectPlaceholder's name so it follows the TilePlaceholder's convention