Пример #1
0
        void Update()
        {
            var hover = ASUI.MouseOver(UICurve.I.transform as RectTransform) ||
                        ASUI.MouseOver(UICamera.I.rectView as RectTransform);

            if (hover && Input.GetKeyDown(KeyCode.C))
            {
                CopyFrame();
            }
            else if (hover && Input.GetKeyDown(KeyCode.V))
            {
                PasteFrame();
            }

            if (f.toggleIK.isOn || f.toggleIKSingle.isOn)
            {
                IKSolve(joints.ToArray());
            }
            else if (f.toggleLockOneSide.isOn || f.toggleLockMirror.isOn)
            {
                end = avatar[joints[0]].transform;
                IKSolve(lockPos1, joints.ToArray());
                if (f.toggleLockMirror.isOn)
                {
                    end = avatar[joints2[0]].transform;
                    IKSolve(lockPos2, joints2.ToArray());
                }
            }
            else if (f.toggleWeaponIK.isOn)
            {
                ExBoneIK();
            }
        }
Пример #2
0
        private void MouseDrag(MB button)
        {
            use = true;

            if (!ASUI.MouseOver(area))
            {
                return;
            }
            var deltaV = ASUI.mousePositionRef - oldPos;

            //deltaV = deltaV.Divide(areaSize);
            //deltaV = Vector2.Scale(deltaV, new Vector2(rulerLength, 0));
            switch (button)
            {
            case MB.Left:

                //lx = ASUI.mousePositionRef.x - area.anchoredPosition.x;
                //lx = lx / area.rect.width;
                //lx = Mathf.Clamp01(lx);
                //frameIdx = (int)startPos.x + Mathf.RoundToInt(lx * rulerLength);
                break;

            case MB.Right:

                break;

            case MB.Middle:

                startPos -= deltaV;
                break;

            default: throw null;
            }
            oldPos = ASUI.mousePositionRef;
        }
Пример #3
0
        void GetInput()
        {
            //        var shift = Events.Shift;
            //        var ctrl = Events.Ctrl;
            //        var alt = Events.Alt;
            var use = false;
            //        over = ASUI.MouseOver(area, ruler);
            //        var simMidDown = Events.MouseDown(MB.Left) && alt;
            //        if ((Events.MouseDown(MB.Middle) || simMidDown) && over) { oldPos = ASUI.mousePositionRef; MouseDown(MB.Middle); middle = true; }
            //        if (Events.MouseDown(MB.Left) && over && !simMidDown) { oldPos = ASUI.mousePositionRef; MouseDown(MB.Left); left = true; }
            //        var simMid = Events.Mouse(MB.Left) && alt;
            //        if (!Events.Mouse(MB.Middle) && !simMid) middle = false;
            //        if (!Events.Mouse(MB.Left) || simMid) left = false;
            //        if (middle) MouseDrag(MB.Middle);
            //        if (left) MouseDrag(MB.Left);
            float delta = Events.AxisMouseWheel;

            if (delta != 0 && ASUI.MouseOver(rt, ruler))
            {
                use     = true;
                SIZE.x -= delta * rulerScalerSensitivity;
                SIZE.x  = Mathf.Clamp(SIZE.x, 10, Mathf.Infinity);
            }
            frameIdx = frameIdx_KeyHandler.GetInput(frameIdx);
            if (Events.KeyDown(KeyCode.I))
            {
                if (Events.Alt)
                {
                    RemoveKey();
                }
                else
                {
                    InsertKey();
                }
            }
            if (ASUI.MouseOver(rt) && Events.Mouse1to3)
            {
                use = true;
            }
            if (use)
            {
                Events.Use();
            }
        }