Example #1
0
 public void InitJoystack(float maxDistance, float activeDistance, RectTransform joystack, RectTransform joystackBG)
 {
     this.maxDistance    = maxDistance;
     this.activeDistance = activeDistance;
     this.joystack       = joystack;
     this.joystackBG     = joystackBG;
     DragEventTrigger.GetDragEventTrigger(gameObject).Down += OnDown;
     DragEventTrigger.GetDragEventTrigger(gameObject).UP   += OnUp;
     DragEventTrigger.GetDragEventTrigger(gameObject).Drag += OnDrag;
     joystack.gameObject.SetActive(false);
     joystackBG.gameObject.SetActive(false);
 }
Example #2
0
 public void InitJoystack(float maxDistance, float activeDistance, GameObject joystack, GameObject joystackBG)
 {
     this.maxDistance    = maxDistance;
     this.activeDistance = activeDistance;
     this.joystack       = joystack;
     this.joystackBG     = joystackBG;
     //设置原点
     origin = joystack.transform.localPosition;
     DragEventTrigger.GetDragEventTrigger(gameObject).Down      += OnDown;
     DragEventTrigger.GetDragEventTrigger(gameObject).UP        += OnUp;
     DragEventTrigger.GetDragEventTrigger(gameObject).BeginDrag += OnBeginDrag;
     DragEventTrigger.GetDragEventTrigger(gameObject).Drag      += OnDrag;
     DragEventTrigger.GetDragEventTrigger(gameObject).EndDrag   += OnEndDrag;
     joystack.SetActive(false);
     joystackBG.SetActive(false);
 }