Change input event to trigger different input states.
This commit is contained in:
@@ -97,7 +97,7 @@ Action Input::MouseLeave;
|
||||
Delegate<const Float2&, int32> Input::TouchDown;
|
||||
Delegate<const Float2&, int32> Input::TouchMove;
|
||||
Delegate<const Float2&, int32> Input::TouchUp;
|
||||
Delegate<StringView> Input::ActionTriggered;
|
||||
Delegate<StringView, const InputActionState&> Input::ActionTriggered;
|
||||
Array<ActionConfig> Input::ActionMappings;
|
||||
Array<AxisConfig> Input::AxisMappings;
|
||||
|
||||
@@ -1022,9 +1022,9 @@ void InputService::Update()
|
||||
{
|
||||
for (auto i = Actions.Begin(); i.IsNotEnd(); ++i)
|
||||
{
|
||||
if (i->Value.Active)
|
||||
if (i->Value.State != InputActionState::Waiting)
|
||||
{
|
||||
Input::ActionTriggered(i->Key);
|
||||
Input::ActionTriggered(i->Key, i->Value.State);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ public:
|
||||
/// Event fired when virtual input action is triggered. Called before scripts update. See <see cref="ActionMappings"/> to edit configuration.
|
||||
/// </summary>
|
||||
/// <seealso cref="InputEvent"/>
|
||||
API_EVENT() static Delegate<StringView> ActionTriggered;
|
||||
API_EVENT() static Delegate<StringView, const InputActionState&> ActionTriggered;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value of the virtual action identified by name. Use <see cref="ActionMappings"/> to get the current config.
|
||||
|
||||
Reference in New Issue
Block a user