Exemple #1
0
    void OnDrag(PointerEventData eDt)
    {
        if (isE)
        {
            //Debug.Log("Position: " + eventData.position);
            NwPos = eDt.position;
            if (NwPos != OdPos)
            {
                //var angle = Vector2.Angle(NwPos, OdPos);
                var nwPos = NwPos - PnlPos;
                var odPos = OdPos - PnlPos;

                var ag = CustomVector.Angle(nwPos, odPos);
                reTrfm.Rotate(0, 0, ag);
            }
            OdPos = NwPos;
        }
    }
Exemple #2
0
    void OnDrag(PointerEventData eDt)
    {
        if (m_isCanDrag)
        {
            if (isE)
            {
                NwPos          = eDt.position;
                m_fDeltaRotate = CustomVector.Angle(NwPos - PnlPos, OdPos - PnlPos);
                if (NwPos != OdPos)
                {
                    var nwPos = NwPos - PnlPos;
                    var odPos = OdPos - PnlPos;

                    var ag = CustomVector.Angle(nwPos, odPos);
                    RotateDirection = ag > 0 ? 1 : -1;
                    reTrfm.Rotate(0, 0, ag);
                }
                OdPos = NwPos;
            }
        }
    }