mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-23 16:48:23 -05:00
40 lines
1.0 KiB
C#
40 lines
1.0 KiB
C#
using System;
|
|
using UnityEngine;
|
|
using UnityEngine.Serialization;
|
|
|
|
namespace UnityAtoms.Mobile
|
|
{
|
|
[CreateAssetMenu(menuName = "Unity Atoms/Variables/TouchUserInput", fileName = "TouchUserInputVariable")]
|
|
public sealed class TouchUserInputVariable : EquatableScriptableObjectVariable<
|
|
TouchUserInput,
|
|
TouchUserInputGameEvent,
|
|
TouchUserInputTouchUserInputGameEvent>
|
|
{
|
|
[FormerlySerializedAs("DetectTap")]
|
|
[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();
|
|
}
|
|
}
|
|
|
|
}
|