Skip to content

Instantly share code, notes, and snippets.

@nguyenmanh1507
Created April 24, 2018 06:19
Show Gist options
  • Select an option

  • Save nguyenmanh1507/502aa0b9edb8e3ce839d22b957a2a8fb to your computer and use it in GitHub Desktop.

Select an option

Save nguyenmanh1507/502aa0b9edb8e3ce839d22b957a2a8fb to your computer and use it in GitHub Desktop.

Revisions

  1. nguyenmanh1507 created this gist Apr 24, 2018.
    22 changes: 22 additions & 0 deletions DragHandler.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.EventSystems;


    public class Draggable : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler {
    public void OnBeginDrag (PointerEventData eventData) {
    Debug.Log("OnBeginDrag");
    Input.multiTouchEnabled = false;
    }

    public void OnDrag (PointerEventData eventData) {
    Debug.Log("OnDrag");
    Input.multiTouchEnabled = false;
    }

    public void OnEndDrag(PointerEventData eventData) {
    Debug.Log("OnEndDrag");
    Input.multiTouchEnabled = false;
    }
    }