예제 #1
0
        void CreateSlicePlane()
        {
            Vector3 centre = (_pointA + _pointB) / 2;
            Vector3 up     = Vector3.Cross((_pointA - _pointB), (_pointA - _cam.transform.position)).normalized;


            Cutter.Cut(obj, centre, up, null, true, true);
        }
예제 #2
0
        void Update()
        {
            if (Input.GetMouseButtonDown(0))
            {
                RaycastHit hit;

                if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit))
                {
                    GameObject victim = hit.collider.gameObject;
                    if (victim.tag != "Safe")
                    {
                        if (angle == Angle.Up)
                        {
                            Cutter.Cut(victim, hit.point, Vector3.up, null, true, true);
                        }
                        else if (angle == Angle.Forward)
                        {
                            Cutter.Cut(victim, hit.point, Vector3.forward, null, true, true);
                        }
                    }
                }
            }
        }