コード例 #1
0
    public void Update(Vector2D pos)
    {
        float scroll     = Input.GetAxis("Mouse ScrollWheel");
        float newCutSize = cutSize + scroll;

        if (newCutSize > 0.05f)
        {
            cutSize = newCutSize;
        }

        if (input.GetInputClicked())
        {
            linearPair.A.Set(pos);
        }

        if (input.GetInputHolding())
        {
            linearPair.B.Set(pos);
        }

        if (input.GetInputReleased())
        {
            LinearCut linearCutLine = LinearCut.Create(linearPair, cutSize * visuals.visualScale);
            Slicer2D.LinearCutSliceAll(linearCutLine, sliceLayer);
        }
    }
コード例 #2
0
    private void UpdateLinearCut(Vector2D pos)
    {
        if (Input.GetMouseButtonDown(0))
        {
            linearPair.A.Set(pos);
        }

        if (Input.GetMouseButton(0))
        {
            linearPair.B.Set(pos);
            mouseDown = true;
        }

        if (mouseDown == true && Input.GetMouseButton(0) == false)
        {
            mouseDown = false;
            Slicer2D.LinearCutSliceAll(linearCutLine, sliceLayer);
        }
    }