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); }
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); } } } } }