docs.unity3d.com
    Show / Hide Table of Contents

    Class SceneSelection

    Manages object and element selection in the scene.

    Inheritance
    Object
    SceneSelection
    Inherited Members
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEngine.ProBuilder
    Syntax
    public class SceneSelection : IEquatable<SceneSelection>

    Constructors

    SceneSelection(GameObject)

    Creates a SceneSelection object in the Object editing mode from the specified GameObject. If the GameObject is not specified it creates an empty selection.

    Declaration
    public SceneSelection(GameObject gameObject = null)
    Parameters
    Type Name Description
    GameObject gameObject

    The optional GameObject to set as the SceneSelection.

    SceneSelection(ProBuilderMesh, Int32)

    Creates a SceneSelection object in the Vertex editing mode from the specified mesh.

    Declaration
    public SceneSelection(ProBuilderMesh mesh, int vertex)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The ProBuilderMesh containing the vertex to select.

    Int32 vertex

    The index of the vertex to set as the SceneSelection.

    SceneSelection(ProBuilderMesh, Edge)

    Creates a SceneSelection object in the Edge editing mode from the specified mesh.

    Declaration
    public SceneSelection(ProBuilderMesh mesh, Edge edge)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The ProBuilderMesh containing the edge to select.

    Edge edge

    The Edge to set as the SceneSelection.

    SceneSelection(ProBuilderMesh, Face)

    Creates a SceneSelection object in the Face editing mode from the specified mesh.

    Declaration
    public SceneSelection(ProBuilderMesh mesh, Face face)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The ProBuilderMesh containing the face to select.

    Face face

    The Face to set as the SceneSelection.

    Fields

    gameObject

    The Unity GameObject

    Declaration
    public GameObject gameObject
    Field Value
    Type Description
    GameObject

    mesh

    The ProBuilder mesh

    Declaration
    public ProBuilderMesh mesh
    Field Value
    Type Description
    ProBuilderMesh

    Properties

    edges

    Gets or sets the list of edges for the selected mesh.

    Declaration
    public List<Edge> edges { get; set; }
    Property Value
    Type Description
    List<Edge>

    faces

    Gets or sets the list of faces for the selected mesh.

    Declaration
    public List<Face> faces { get; set; }
    Property Value
    Type Description
    List<Face>

    vertexes

    Gets or sets the list of vertex indices for the selected mesh.

    Declaration
    public List<int> vertexes { get; set; }
    Property Value
    Type Description
    List<Int32>

    Methods

    Clear()

    Empties the selection.

    Declaration
    public void Clear()

    CopyTo(SceneSelection)

    Copies the list of selected object(s) and element(s) to match this SceneSelection object.

    Declaration
    public void CopyTo(SceneSelection dst)
    Parameters
    Type Name Description
    SceneSelection dst

    The SceneSelection object to copy this object to.

    Equals(Object)

    Evaluates whether the specified object is equivalent to this one.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj

    The object to compare to this object.

    Returns
    Type Description
    Boolean

    True if the objects are equivalent; false otherwise.

    Overrides
    Object.Equals(Object)

    Equals(SceneSelection)

    Evaluates whether the specified SceneSelection is equivalent to this one.

    Declaration
    public bool Equals(SceneSelection other)
    Parameters
    Type Name Description
    SceneSelection other

    The SceneSelection object to compare to this object.

    Returns
    Type Description
    Boolean

    True if the objects are equivalent; false otherwise.

    Implements
    IEquatable<T>.Equals(T)

    GetHashCode()

    Returns the hash code for this object.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32

    A hash code for the current object.

    Overrides
    Object.GetHashCode()

    SetSingleEdge(Edge)

    Resets the selection to the specified edge.

    Declaration
    public void SetSingleEdge(Edge edge)
    Parameters
    Type Name Description
    Edge edge

    The edge to select

    SetSingleFace(Face)

    Resets the selection to the specified face.

    Declaration
    public void SetSingleFace(Face face)
    Parameters
    Type Name Description
    Face face

    The face to select

    SetSingleVertex(Int32)

    Resets the selection to the specified vertex.

    Declaration
    public void SetSingleVertex(int vertex)
    Parameters
    Type Name Description
    Int32 vertex

    The index of the vertex to select

    ToString()

    Returns a string that represents this SceneSelection.

    Declaration
    public override string ToString()
    Returns
    Type Description
    String

    A multi-line string containing the names of the GameObject and ProBuilderMesh objects, and a string representation of the lists of faces, edges, and vertex indices.

    Overrides
    Object.ToString()

    Operators

    Equality(SceneSelection, SceneSelection)

    Returns true if the two SceneSelection objects are equal.

    Declaration
    public static bool operator ==(SceneSelection left, SceneSelection right)
    Parameters
    Type Name Description
    SceneSelection left

    The first object to compare.

    SceneSelection right

    The second object to compare.

    Returns
    Type Description
    Boolean

    True if the objects are equal; false otherwise.

    Inequality(SceneSelection, SceneSelection)

    Returns true if the two SceneSelection objects are not equal.

    Declaration
    public static bool operator !=(SceneSelection left, SceneSelection right)
    Parameters
    Type Name Description
    SceneSelection left

    The first object to compare.

    SceneSelection right

    The second object to compare.

    Returns
    Type Description
    Boolean

    True if the objects are not equal; false otherwise.

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023