IPointerInputDetector.cs 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // Copyright (c) 2024 Vuplex Inc. All rights reserved.
  2. //
  3. // Licensed under the Vuplex Commercial Software Library License, you may
  4. // not use this file except in compliance with the License. You may obtain
  5. // a copy of the License at
  6. //
  7. // https://vuplex.com/commercial-library-license
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. using System;
  15. using UnityEngine;
  16. namespace Vuplex.WebView {
  17. /// <summary>
  18. /// An interface that can be passed to WebViewPrefab.SetPointerInputDetector()
  19. /// CanvasWebViewPrefab.SetPointerInputDetector() to override how the prefab detects pointer input.
  20. /// For example implementations of this interface, please see 3D WebView's DefaultPointerInputDetector.cs
  21. /// and CanvasPointerInputDetector.cs scripts.
  22. /// </summary>
  23. public interface IPointerInputDetector {
  24. /// <summary>
  25. /// Indicates the normalized point for the beginning of a drag interaction.
  26. /// </summary>
  27. event EventHandler<EventArgs<Vector2>> BeganDrag;
  28. /// <summary>
  29. /// Indicates the normalized point for the continuation of a drag interaction.
  30. /// </summary>
  31. event EventHandler<EventArgs<Vector2>> Dragged;
  32. /// <summary>
  33. /// Indicates a pointer down interaction occurred.
  34. /// </summary>
  35. event EventHandler<PointerEventArgs> PointerDown;
  36. /// <summary>
  37. /// Indicates that the pointer entered.
  38. /// </summary>
  39. event EventHandler PointerEntered;
  40. /// <summary>
  41. /// Indicates the normalized point where the pointer exited.
  42. /// </summary>
  43. event EventHandler<EventArgs<Vector2>> PointerExited;
  44. /// <summary>
  45. /// Indicates the normalized point where the pointer moved.
  46. /// </summary>
  47. event EventHandler<EventArgs<Vector2>> PointerMoved;
  48. /// <summary>
  49. /// Indicates a pointer up interaction occurred.
  50. /// </summary>
  51. event EventHandler<PointerEventArgs> PointerUp;
  52. /// <summary>
  53. /// Indicates a scroll interaction occurred.
  54. /// </summary>
  55. event EventHandler<ScrolledEventArgs> Scrolled;
  56. /// <summary>
  57. /// The prefab sets this property to indicate whether
  58. /// the PointerMoved event should be enabled.
  59. /// </summary>
  60. bool PointerMovedEnabled { get; set; }
  61. }
  62. }