At the moment, all the code that performs focus and interaction checks is stored inside AScalarFieldPlayerController, which implements the IInteractorInterface. However, making controllers manage system-specific instructions (like focus and interactions, which are interaction system-specific) causes them to become very huge classes that have too many responsibilities.
What?
Make a new UInteractorPlayerComponent that inherits from UActorComponent and implements IInteractorInterface. Then, move all focus and interaction-related code in there from AScalarFieldPlayerController.
Why?
At the moment, all the code that performs focus and interaction checks is stored inside
AScalarFieldPlayerController
, which implements theIInteractorInterface
. However, making controllers manage system-specific instructions (like focus and interactions, which are interaction system-specific) causes them to become very huge classes that have too many responsibilities.What?
Make a new
UInteractorPlayerComponent
that inherits fromUActorComponent
and implementsIInteractorInterface
. Then, move all focus and interaction-related code in there fromAScalarFieldPlayerController
.