示例#1
0
        public override void OnDrop(PointerEventData eventData)
        {
            base.OnDrop(eventData);
            CurrentObject.rectTransform.SetPivot(new Vector2(0.5f, 0.5f));
            CurrentObject.rectTransform.SetParent(rectTransform);
            CurrentObject.IsDragable = false;

            CurrentObject.OnPostDropped();

            DOTween.To(
                () => CurrentObject.rectTransform.anchoredPosition,
                x => CurrentObject.rectTransform.anchoredPosition = x,
                TargetPosition,
                PlacementDuration
                ).SetEase(Easing);

            DOTween.To(
                () => CurrentObject.rectTransform.localRotation,
                x => CurrentObject.rectTransform.localRotation = x,
                TargetRotation,
                PlacementDuration
                ).SetEase(Easing).OnComplete(() => CurrentObject.IsDragable = true);
        }