Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2014
3,906
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. using UnityEngine.EventSystems;
  4. using System.Collections;
  5.  
  6. public class UIWindowBase : MonoBehaviour, IDragHandler
  7. {
  8. RectTransform m_transform = null;
  9.  
  10. // Use this for initialization
  11. void Start () {
  12. m_transform = GetComponent<RectTransform>();
  13. }
  14.  
  15. public void OnDrag(PointerEventData eventData)
  16. {
  17. m_transform.position += new Vector3(eventData.delta.x, eventData.delta.y);
  18.  
  19. // magic : add zone clamping if's here.
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement