docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SelectionPicker

    Provides functions for picking mesh elements in a view. This allows the Editor to either render a texture to test, or cast a ray.

    Inheritance
    object
    SelectionPicker
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.ProBuilder
    Assembly: Unity.ProBuilder.dll
    Syntax
    public static class SelectionPicker

    Methods

    PickEdgesInRect(Camera, Rect, IList<ProBuilderMesh>, PickerOptions, float)

    Picks the Edge objects contained within a rect (rectangular selection).

    Declaration
    public static Dictionary<ProBuilderMesh, HashSet<Edge>> PickEdgesInRect(Camera cam, Rect rect, IList<ProBuilderMesh> selectable, PickerOptions options, float pixelsPerPoint = 1)
    Parameters
    Type Name Description
    Camera cam

    Use this camera to evaluate whether any edge object(s) are inside the rect.

    Rect rect

    Rect is in GUI space, where 0,0 is the top left of the screen, and width = cam.pixelWidth / pointsPerPixel.

    IList<ProBuilderMesh> selectable

    The collection of objects to check for selectability. ProBuilder verifies whether these objects fall inside the rect.

    PickerOptions options

    The options that define whether to include mesh elements that are hidden and whether to consider elements that only partially fall inside the rect.

    float pixelsPerPoint

    Scale the render texture to match rect coordinates. By default, ProBuilder doesn't scale the texture (the default value is set to 1.0), but you can specify pixelsPerPoint if you need to use a different number of screen pixels per point.

    Returns
    Type Description
    Dictionary<ProBuilderMesh, HashSet<Edge>>

    A dictionary of ProBuilderMesh and Edge objects that are in the selection rect.

    PickFace(Camera, Vector3, ProBuilderMesh)

    Returns the first face on a ProBuilder mesh that collides with the ray cast by ProBuilder, given a specific screen position and camera.

    Declaration
    public static Face PickFace(Camera camera, Vector3 mousePosition, ProBuilderMesh pickable)
    Parameters
    Type Name Description
    Camera camera

    The camera to use when calculating the raycast.

    Vector3 mousePosition

    The screen position to use when calculating the raycast.

    ProBuilderMesh pickable

    The ProBuilderMesh to test for the ray/face intersection.

    Returns
    Type Description
    Face

    The intersected face if successful; null if the ray failed to hit a face.

    PickFacesInRect(Camera, Rect, IList<ProBuilderMesh>, PickerOptions, float)

    Picks the Face objects contained within a rect (rectangular selection).

    Declaration
    public static Dictionary<ProBuilderMesh, HashSet<Face>> PickFacesInRect(Camera cam, Rect rect, IList<ProBuilderMesh> selectable, PickerOptions options, float pixelsPerPoint = 1)
    Parameters
    Type Name Description
    Camera cam

    Use this camera to evaluate whether any face object(s) are inside the rect.

    Rect rect

    Rect is in GUI space, where 0,0 is the top left of the screen, and width = cam.pixelWidth / pointsPerPixel.

    IList<ProBuilderMesh> selectable

    The collection of objects to check for selectability. ProBuilder verifies whether these objects fall inside the rect.

    PickerOptions options

    The options that define whether to include mesh elements that are hidden and whether to consider elements that only partially fall inside the rect.

    float pixelsPerPoint

    Scale the render texture to match rect coordinates. By default, ProBuilder doesn't scale the texture (the default value is set to 1.0), but you can specify pixelsPerPoint if you need to use a different number of screen pixels per point.

    Returns
    Type Description
    Dictionary<ProBuilderMesh, HashSet<Face>>

    A dictionary of ProBuilderMesh and Face objects that are in the selection rect.

    PickVerticesInRect(Camera, Rect, IList<ProBuilderMesh>, PickerOptions, float)

    Picks the vertex indices contained within a rect (rectangular selection).

    Declaration
    public static Dictionary<ProBuilderMesh, HashSet<int>> PickVerticesInRect(Camera cam, Rect rect, IList<ProBuilderMesh> selectable, PickerOptions options, float pixelsPerPoint = 1)
    Parameters
    Type Name Description
    Camera cam

    Use this camera to evaluate whether any vertices are inside the rect.

    Rect rect

    Rect is in GUI space, where 0,0 is the top left of the screen, and width = cam.pixelWidth / pointsPerPixel.

    IList<ProBuilderMesh> selectable

    The collection of objects to check for selectability. ProBuilder verifies whether these objects fall inside the rect.

    PickerOptions options

    The options that define whether to include mesh elements that are hidden and whether to consider elements that only partially fall inside the rect.

    float pixelsPerPoint

    Scale the render texture to match rect coordinates. By default, ProBuilder doesn't scale the texture (the default value is set to 1.0), but you can specify pixelsPerPoint if you need to use a different number of screen pixels per point.

    Returns
    Type Description
    Dictionary<ProBuilderMesh, HashSet<int>>

    A dictionary of ProBuilderMesh and sharedIndexes that are in the selection rect. To get triangle indexes, use the sharedVertices array.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)