QuickLongTapInspector.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using UnityEngine;
  2. using System.Collections;
  3. using UnityEditor;
  4. using HedgehogTeam.EasyTouch;
  5. #if UNITY_5_3
  6. using UnityEditor.SceneManagement;
  7. #endif
  8. [CustomEditor(typeof(QuickLongTap))]
  9. public class QuickLongTapInspector : Editor {
  10. public override void OnInspectorGUI(){
  11. QuickLongTap t = (QuickLongTap)target;
  12. EditorGUILayout.Space();
  13. t.quickActionName = EditorGUILayout.TextField("Name",t.quickActionName);
  14. EditorGUILayout.Space();
  15. t.is2Finger = EditorGUILayout.Toggle("2 fingers gesture",t.is2Finger);
  16. t.actionTriggering = (QuickLongTap.ActionTriggering)EditorGUILayout.EnumPopup("Action triggering",t.actionTriggering);
  17. EditorGUILayout.Space();
  18. if (!t.is2Finger){
  19. t.isMultiTouch = EditorGUILayout.ToggleLeft("Allow multi-touch",t.isMultiTouch);
  20. }
  21. t.enablePickOverUI = EditorGUILayout.ToggleLeft("Allow over UI Element",t.enablePickOverUI);
  22. serializedObject.Update();
  23. SerializedProperty touch = serializedObject.FindProperty("onLongTap");
  24. EditorGUILayout.PropertyField(touch, true, null);
  25. serializedObject.ApplyModifiedProperties();
  26. if (GUI.changed){
  27. EditorUtility.SetDirty(t);
  28. #if UNITY_5_3
  29. EditorSceneManager.MarkSceneDirty( EditorSceneManager.GetActiveScene());
  30. #endif
  31. }
  32. }
  33. }