Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using UnityEngine.UI;
- using UnityEngine.EventSystems;
- using System.Collections;
- public class UIWindowBase : MonoBehaviour, IDragHandler
- {
- RectTransform m_transform = null;
- // Use this for initialization
- void Start () {
- m_transform = GetComponent<RectTransform>();
- }
- public void OnDrag(PointerEventData eventData)
- {
- m_transform.position += new Vector3(eventData.delta.x/100, eventData.delta.y/100);
- // magic : add zone clamping if's here.
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement