// Copyright (c) 2018 Augie R. Maddox, Guavaman Enterprises. All rights reserved.
#pragma warning disable 0219
#pragma warning disable 0618
#pragma warning disable 0649
namespace Rewired.Integration.UnityUI {
using System.Text;
using UnityEngine;
using UnityEngine.EventSystems;
using Rewired.UI;
///
/// Each touch event creates one of these containing all the relevant information.
///
public class PlayerPointerEventData : PointerEventData {
///
/// The Player id of the Player that generated this event.
///
public int playerId { get; set; }
///
/// The index of the mouse/touch input source owned by the Player that generated this event.
///
public int inputSourceIndex { get; set; }
///
/// The mouse that generated this event.
///
public IMouseInputSource mouseSource { get; set; }
///
/// The touch source that generated this event.
///
public ITouchInputSource touchSource { get; set; }
///
/// The input source type that generated this event.
///
public PointerEventType sourceType { get; set; }
///
/// The index of the button that generated this event.
///
public int buttonIndex { get; set; }
public PlayerPointerEventData(EventSystem eventSystem)
: base(eventSystem) {
playerId = -1;
inputSourceIndex = -1;
buttonIndex = -1;
}
public override string ToString() {
var sb = new StringBuilder();
sb.AppendLine("Player Id: " + playerId);
sb.AppendLine("Mouse Source: " + mouseSource);
sb.AppendLine("Input Source Index: " + inputSourceIndex);
sb.AppendLine("Touch Source/b>: " + touchSource);
sb.AppendLine("Source Type: " + sourceType);
sb.AppendLine("Button Index: " + buttonIndex);
sb.Append(base.ToString());
return sb.ToString();
}
}
}