addJoystickObserver method
void
addJoystickObserver(
- JoystickListener target, {
- bool cleanObservers = false,
- bool moveCameraToTarget = false,
override
Use this method to change default observer of the Joystick events.
Implementation
@override
void addJoystickObserver(
JoystickListener target, {
bool cleanObservers = false,
bool moveCameraToTarget = false,
}) {
if (cleanObservers) {
_joystickController?.cleanObservers();
}
_joystickController?.addObserver(target);
if (moveCameraToTarget && target is GameComponent) {
camera.moveToTargetAnimated(target as GameComponent);
}
}