private static void RegisterMobileInput([NotNull] ContainerBuilder builder) { if (builder == null) { throw new ArgumentNullException(nameof(builder)); } MobileJoystickInputController inputController = GameObject.FindObjectOfType <MobileJoystickInputController>(); builder.RegisterInstance(inputController) .As <MobileJoystickInputController>(); builder.RegisterType <MobileInputMovementInputController>() .As <IMovementInputController>() .SingleInstance(); //Don't want one ticking per dependency, so singletone is a MUST here. builder.RegisterType <MobileInputCameraInputController>() .As <ICameraInputController>() .As <IGameTickable>() .SingleInstance(); }
public MobileInputMovementInputController([NotNull] MobileJoystickInputController joyStickController) { JoyStickController = joyStickController ?? throw new ArgumentNullException(nameof(joyStickController)); }