Example #1
0
    public override void OnInspectorGUI()
    {
        QuickTap t = (QuickTap)target;

        EditorGUILayout.Space();

        t.quickActionName = EditorGUILayout.TextField("Name", t.quickActionName);

        EditorGUILayout.Space();

        t.is2Finger        = EditorGUILayout.Toggle("2 fingers gesture", t.is2Finger);
        t.actionTriggering = (QuickTap.ActionTriggering)EditorGUILayout.EnumPopup("Action triggering", t.actionTriggering);

        EditorGUILayout.Space();

        t.enablePickOverUI = EditorGUILayout.ToggleLeft("Allow over UI Element", t.enablePickOverUI);

        serializedObject.Update();
        SerializedProperty touch = serializedObject.FindProperty("onTap");

        EditorGUILayout.PropertyField(touch, true, null);
        serializedObject.ApplyModifiedProperties();

        if (GUI.changed)
        {
            EditorUtility.SetDirty(t);
                        #if UNITY_5_3
            EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
                        #endif
        }
    }
		private void Awake()
		{
			_view = GetComponent<PowerPotView>();
			_linker = GetComponent<PowerPotLinker>();
			_quickTap = GetComponent<QuickTap>();

			PrepareChargeBar();

			_quickTap.onTap.AddListener(OnTouch);

			CheckComponents();
		}