void Start()
    {
        DragHandler.Get(relocatingObj).OnDragAction.AddListener(OnDrag);

        #region rejectfix
        fix = RelativeFix.Get(img.transform);
        DragHandler dh = DragHandler.Get(img.gameObject);
        dh.OnEndAction.AddListener((ped) =>
        {
            fix.RejectFixPos(img.transform.parent as RectTransform);
        });
        dh.OnDragAction.AddListener((ped) =>
        {
            //mapContainer.transform.localPosition += ped.delta
            Vector2 pos = img.transform.localPosition;
            pos        += ped.delta;
            img.transform.localPosition = pos;
        });
        #endregion
    }
Exemple #2
0
 private void Start()
 {
     DragHandler.Get(gameObject).OnBeginAction.AddListener(OnBeginDrag);
     DragHandler.Get(gameObject).OnDragAction.AddListener(OnDrag);
 }
Exemple #3
0
 void Start()
 {
     DragHandler.Get(gameObject).OnDragAction.AddListener(OnDrag);
 }