Closed ExplosiveEggshells closed 10 months ago
Let's see if we can get this reviewed and pushed in ASAP, we'd like to have this issue fixed so that people will see how to make new modules for player behavior (rather than shoving more functionality into the controller). It will also break some branches when pulled into main, so ASAP is ideal.
Comments on the functions would be nice, otherwise LGTM. I will merge, but create an issue to add comments to it.
Summary
The introduction of these changes will resolve #35 , doing the following:
The functionality for player movement and shooting have been pulled out of
CharacterController.cs
intoCharacterMovement.cs
andCharacterShooting.cs
, which will help keep our script focused and concise.The
CharacterController.cs
script has been updated to now publicly post information about player input and actions, allowing other scripts to hook into the controller in order to get at the required data. The two newly created scripts have been updated to uses these new public accessors.There is no functional change to the game with this PR, but it addresses a dangerous issue of shoving everything into one "PlayerController" script- moving towards isolating functionality into separate "modules" is a big bonus for clarity, readability, and modularity.
Conflicts
Note, this PR will cause merge conflicts with other in-progress branches that use the character controller.