예제 #1
0
    public void Input()
    {
        Event   guiEvent = Event.current;
        Vector3 mousePos = HandleUtility.GUIPointToWorldRay(guiEvent.mousePosition).origin;

        if (guiEvent.type == EventType.MouseDown && guiEvent.button == 0 && guiEvent.control)
        {
            Undo.RecordObject(l, "Add new line with new node");
            l.AddLine(l.activeNodeIndex, mousePos);
            l.node[l.node.Count - 1].ClampPosZeroMax(
                new Vector3(
                    l.voxelGrids.boundaryWorldPos.x * l.densityGenerator.numberOfGeneratedMeshObject.x,
                    l.voxelGrids.boundaryWorldPos.y * l.densityGenerator.numberOfGeneratedMeshObject.y,
                    l.voxelGrids.boundaryWorldPos.z * l.densityGenerator.numberOfGeneratedMeshObject.z));
        }
    }