UnityGame/Library/PackageCache/com.unity.inputsystem/InputSystem/Editor/Analytics/InputEditorAnalytics.cs
2024-10-27 10:53:47 +03:00

47 lines
1.6 KiB
C#

#if UNITY_EDITOR
using System;
namespace UnityEngine.InputSystem.Editor
{
internal static partial class InputEditorAnalytics
{
/// <summary>
/// Represents notification behavior setting associated with <see cref="PlayerInput"/> and
/// <see cref="PlayerInputManager"/>.
/// </summary>
internal enum PlayerNotificationBehavior
{
SendMessages = 0,
BroadcastMessages = 1,
UnityEvents = 2,
CSharpEvents = 3
}
/// <summary>
/// Converts from current <see cref="PlayerNotifications"/> type to analytics counterpart.
/// </summary>
/// <param name="value">The value to be converted.</param>
/// <returns></returns>
/// <exception cref="ArgumentOutOfRangeException">If there is no available remapping.</exception>
internal static PlayerNotificationBehavior ToNotificationBehavior(PlayerNotifications value)
{
switch (value)
{
case PlayerNotifications.SendMessages:
return PlayerNotificationBehavior.SendMessages;
case PlayerNotifications.BroadcastMessages:
return PlayerNotificationBehavior.BroadcastMessages;
case PlayerNotifications.InvokeUnityEvents:
return PlayerNotificationBehavior.UnityEvents;
case PlayerNotifications.InvokeCSharpEvents:
return PlayerNotificationBehavior.CSharpEvents;
default:
throw new ArgumentOutOfRangeException(nameof(value));
}
}
}
}
#endif