Exemple #1
0
    //------------------------------------------------------------------
    //The following methods handle actions for mesh editing and similar
    //operations. These are called by UI buttons and keyboard input in the
    //"Update" method.
    public void ToggleSelectAll()
    {
        if (selectionMode == 0)
        {
            selMesh.ToggleAllVertSelection();
        }
        else
        {
            selMesh.ToggleAllFaceSelection();
        }

        transformGizmo.OnSelectionChange();
    }
Exemple #2
0
    public void EndSelection()
    {
        if (isSelecting)
        {
            isSelecting   = false;
            image.enabled = false;

            foreach (ISelectable point in MeshEdit.selMesh.GetAllPoints())
            {
                Vector2 screenPos = Camera.main.WorldToScreenPoint(point.Pos);
                Rect    test      = CornersToRect();
                if (test.Contains(screenPos))
                {
                    point.Selected = true;
                }
            }
            transformGizmo.SetPositionAuto();
            transformGizmo.OnSelectionChange();
            MeshEdit.SaveUndoState();
        }
    }