InputHandlerNodeable.cpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <InputHandlerNodeable.h>
  9. #include <ScriptCanvas/Utils/SerializationUtils.h>
  10. using namespace ScriptCanvas;
  11. namespace StartingPointInput
  12. {
  13. InputHandlerNodeable::~InputHandlerNodeable()
  14. {
  15. InputEventNotificationBus::Handler::BusDisconnect();
  16. }
  17. void InputHandlerNodeable::ConnectEvent(AZStd::string eventName)
  18. {
  19. InputEventNotificationBus::Handler::BusDisconnect();
  20. InputEventNotificationBus::Handler::BusConnect(InputEventNotificationId(eventName.c_str()));
  21. }
  22. void InputHandlerNodeable::OnDeactivate()
  23. {
  24. InputEventNotificationBus::Handler::BusDisconnect();
  25. }
  26. void InputHandlerNodeable::OnPressed(float value)
  27. {
  28. SCRIPT_CANVAS_PERFORMANCE_SCOPE_LATENT_NODEABLE
  29. CallPressed(value);
  30. }
  31. void InputHandlerNodeable::OnHeld(float value)
  32. {
  33. SCRIPT_CANVAS_PERFORMANCE_SCOPE_LATENT_NODEABLE
  34. CallHeld(value);
  35. }
  36. void InputHandlerNodeable::OnReleased(float value)
  37. {
  38. SCRIPT_CANVAS_PERFORMANCE_SCOPE_LATENT_NODEABLE
  39. CallReleased(value);
  40. }
  41. }