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(PressGesture), true)]
internal sealed class PressGestureEditor : 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
public static readonly GUIContent TEXT_HELP = new GUIContent ( "This component recognizes a gesture when at least one pointer is pressed over this GameObject." ) ;
private SerializedProperty ignoreChildren ;
2025-08-24 18:59:40 +08:00
private SerializedProperty OnPress ;
2025-06-04 22:49:37 +08:00
protected override void OnEnable ( )
{
ignoreChildren = serializedObject . FindProperty ( "ignoreChildren" ) ;
2025-08-24 18:59:40 +08:00
OnPress = serializedObject . FindProperty ( "OnPress" ) ;
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 ( OnPress ) ;
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
}