Updating service requirement to use a generic 'MultiplayerInputDrive', that way if other developers want to make a non-local predictition player controller that calls create/process on the server they can do so as long as there custom component provides this 'MultiplayerInputDriver' service
Signed-off-by: Gene Walters <genewalt@amazon.com>
This commit is contained in:
+1
@@ -22,6 +22,7 @@ namespace Multiplayer
|
||||
AZ_MULTIPLAYER_COMPONENT(Multiplayer::LocalPredictionPlayerInputComponent, s_localPredictionPlayerInputComponentConcreteUuid, Multiplayer::LocalPredictionPlayerInputComponentBase);
|
||||
|
||||
static void Reflect([[maybe_unused]] AZ::ReflectContext* context);
|
||||
static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
|
||||
|
||||
void OnInit() override;
|
||||
void OnActivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating) override;
|
||||
|
||||
@@ -1465,10 +1465,10 @@ namespace {{ Component.attrib['Namespace'] }}
|
||||
{% call(ComponentService) ParseComponentServiceNames(Component, ClassType, 'Required') %}
|
||||
required.push_back(AZ_CRC_CE("{{ ComponentService }}"));
|
||||
{% endcall %}
|
||||
|
||||
{% if NetworkInputCount > 0 %}
|
||||
// This component uses NetworkInputs so it requires LocalPredictionPlayerInputComponent which is responsible for calling CreateInput and ProcessInput
|
||||
required.push_back(AZ_CRC_CE("LocalPredictionPlayerInputComponent"));
|
||||
|
||||
// This component uses NetworkInputs so it requires a MultiplayerInputDriver service which is responsible for calling CreateInput and ProcessInput
|
||||
required.push_back(AZ_CRC_CE("MultiplayerInputDriver"));
|
||||
{% endif %}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,6 +56,12 @@ namespace Multiplayer
|
||||
LocalPredictionPlayerInputComponentBase::Reflect(context);
|
||||
}
|
||||
|
||||
void LocalPredictionPlayerInputComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
|
||||
{
|
||||
LocalPredictionPlayerInputComponentBase::GetProvidedServices(provided);
|
||||
provided.push_back(AZ_CRC_CE("MultiplayerInputDriver"));
|
||||
}
|
||||
|
||||
void LocalPredictionPlayerInputComponent::OnInit()
|
||||
{
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user