暫無描述
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PlayerNotifications.cs 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. namespace UnityEngine.InputSystem
  2. {
  3. /// <summary>
  4. /// Determines how the triggering of an action or other input-related events are relayed to other GameObjects.
  5. /// </summary>
  6. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1717:Only FlagsAttribute enums should have plural names")]
  7. public enum PlayerNotifications
  8. {
  9. ////TODO: add a "None" behavior; for actions, users may want to poll (or use the generated interfaces)
  10. /// <summary>
  11. /// Use <see cref="GameObject.SendMessage(string,object)"/> to send a message to the <see cref="GameObject"/>
  12. /// that <see cref="PlayerInput"/> belongs to.
  13. ///
  14. /// The message name will be the name of the action (e.g. "Jump"; it will not include the action map name),
  15. /// and the object will be the <see cref="PlayerInput"/> on which the action was triggered.
  16. ///
  17. /// If the notification is for an action that was triggered, <see cref="SendMessageOptions"/> will be
  18. /// <see cref="SendMessageOptions.RequireReceiver"/> (i.e. an error will be logged if there is no corresponding
  19. /// method). Otherwise it will be <see cref="SendMessageOptions.DontRequireReceiver"/>.
  20. /// </summary>
  21. SendMessages,
  22. /// <summary>
  23. /// Like <see cref="SendMessages"/> but instead of using <see cref="GameObject.SendMessage(string,object)"/>,
  24. /// use <see cref="GameObject.BroadcastMessage(string,object)"/>.
  25. /// </summary>
  26. BroadcastMessages,
  27. /// <summary>
  28. /// Have a separate <a href="https://docs.unity3d.com/ScriptReference/Events.UnityEvent.html">UnityEvent</a> for each notification.
  29. /// Allows wiring up target methods to invoke such that the connection is persisted in Unity serialized data.
  30. ///
  31. /// See <see cref="PlayerInput.actionEvents"/> and related callbacks such as <see cref="PlayerInput.controlsChangedEvent"/>.
  32. /// </summary>
  33. InvokeUnityEvents,
  34. ////TODO: Kill
  35. /// <summary>
  36. /// Use plain C# callbacks.
  37. /// </summary>
  38. InvokeCSharpEvents
  39. }
  40. }