mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-24 09:08:23 -05:00
39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
|
using UnityEngine;
|
||
|
|
||
|
namespace UnityAtoms.Mobile
|
||
|
{
|
||
|
[CreateAssetMenu(menuName = "Unity Atoms/Mobile/Touch User Input/Variable", fileName = "TouchUserInputVariable", order = CreateAssetMenuUtils.Order.VARIABLE)]
|
||
|
public class TouchUserInputVariable : ScriptableObjectVariable<TouchUserInput, TouchUserInputGameEvent, TouchUserInputTouchUserInputGameEvent>
|
||
|
{
|
||
|
[SerializeField]
|
||
|
private DetectTap DetectTap = null;
|
||
|
|
||
|
private void OnEnable()
|
||
|
{
|
||
|
if (DetectTap.InUse())
|
||
|
{
|
||
|
Changed.RegisterListener(DetectTap);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private void OnDisable()
|
||
|
{
|
||
|
if (DetectTap.InUse())
|
||
|
{
|
||
|
Changed.UnregisterListener(DetectTap);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public bool IsPotentialDoubleTapInProgress()
|
||
|
{
|
||
|
return DetectTap != null && DetectTap.InUse() && DetectTap.IsPotentialDoubleTapInProgress();
|
||
|
}
|
||
|
|
||
|
protected override bool AreEqual(TouchUserInput first, TouchUserInput second)
|
||
|
{
|
||
|
return first.Equals(second);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|