mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-13 11:37:40 +02:00
Editor stuff
This commit is contained in:
@ -0,0 +1,39 @@
|
||||
/// Credit Erdener Gonenc - @PixelEnvision
|
||||
/*USAGE: Simply use that instead of the regular ScrollRect */
|
||||
|
||||
|
||||
namespace UnityEngine.UI.Extensions
|
||||
{
|
||||
[AddComponentMenu ("UI/Extensions/MultiTouchScrollRect")]
|
||||
public class MultiTouchScrollRect : ScrollRect
|
||||
{
|
||||
private int pid = -100;
|
||||
|
||||
/// <summary>
|
||||
/// Begin drag event
|
||||
/// </summary>
|
||||
public override void OnBeginDrag (UnityEngine.EventSystems.PointerEventData eventData)
|
||||
{
|
||||
pid = eventData.pointerId;
|
||||
base.OnBeginDrag (eventData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Drag event
|
||||
/// </summary>
|
||||
public override void OnDrag (UnityEngine.EventSystems.PointerEventData eventData)
|
||||
{
|
||||
if (pid == eventData.pointerId)
|
||||
base.OnDrag (eventData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// End drag event
|
||||
/// </summary>
|
||||
public override void OnEndDrag (UnityEngine.EventSystems.PointerEventData eventData)
|
||||
{
|
||||
pid = -100;
|
||||
base.OnEndDrag (eventData);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user