2025-06-04 22:49:37 +08:00
|
|
|
/*
|
|
|
|
* @author Valentin Simonov / http://va.lent.in/
|
|
|
|
*/
|
|
|
|
|
|
|
|
using TouchScript.Gestures;
|
|
|
|
using UnityEditor;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace TouchScript.Editor.Gestures
|
|
|
|
{
|
|
|
|
[CustomEditor(typeof(ReleaseGesture), true)]
|
|
|
|
internal sealed class ReleaseGestureEditor : GestureEditor
|
|
|
|
{
|
2025-08-24 18:59:40 +08:00
|
|
|
public static readonly GUIContent TEXT_IGNORE_CHILDREN = new GUIContent("Ignore Children", "If selected this gesture ignores pointers from children.");
|
2025-06-04 22:49:37 +08:00
|
|
|
|
2025-08-24 18:59:40 +08:00
|
|
|
public static readonly GUIContent TEXT_HELP = new GUIContent("This component recognizes a gesture when all pointers are lifted off from this GameObject.");
|
2025-06-04 22:49:37 +08:00
|
|
|
|
2025-08-24 18:59:40 +08:00
|
|
|
private SerializedProperty ignoreChildren;
|
|
|
|
private SerializedProperty OnRelease;
|
2025-06-04 22:49:37 +08:00
|
|
|
|
|
|
|
protected override void OnEnable()
|
|
|
|
{
|
|
|
|
ignoreChildren = serializedObject.FindProperty("ignoreChildren");
|
2025-08-24 18:59:40 +08:00
|
|
|
OnRelease = serializedObject.FindProperty("OnRelease");
|
2025-06-04 22:49:37 +08:00
|
|
|
|
2025-08-24 18:59:40 +08:00
|
|
|
base.OnEnable();
|
2025-06-04 22:49:37 +08:00
|
|
|
}
|
|
|
|
|
2025-08-24 18:59:40 +08:00
|
|
|
protected override GUIContent getHelpText()
|
|
|
|
{
|
|
|
|
return TEXT_HELP;
|
|
|
|
}
|
2025-06-04 22:49:37 +08:00
|
|
|
|
2025-08-24 18:59:40 +08:00
|
|
|
protected override void drawGeneral()
|
2025-06-04 22:49:37 +08:00
|
|
|
{
|
|
|
|
EditorGUILayout.PropertyField(ignoreChildren, TEXT_IGNORE_CHILDREN);
|
|
|
|
|
2025-08-24 18:59:40 +08:00
|
|
|
base.drawGeneral();
|
2025-06-04 22:49:37 +08:00
|
|
|
}
|
|
|
|
|
2025-08-24 18:59:40 +08:00
|
|
|
protected override void drawUnityEvents()
|
|
|
|
{
|
|
|
|
EditorGUILayout.PropertyField(OnRelease);
|
2025-06-04 22:49:37 +08:00
|
|
|
|
2025-08-24 18:59:40 +08:00
|
|
|
base.drawUnityEvents();
|
|
|
|
}
|
2025-06-04 22:49:37 +08:00
|
|
|
}
|
2025-08-24 18:59:40 +08:00
|
|
|
}
|