docs.unity3d.com
Version: 

    Occurrence

    API reference

    The nodes in the product structure are referred to as occurrences. Most of the optimization functions take an occurrence or a list of occurrences as input.

    This table shows examples:

    Function Description
    algo.tessellate([1], …) Specify [1] to run the algorithm on all the direct and indirect child occurrences of this occurrence.
    scene.getRoot() Use this function to retrieve the root occurrence of your scene.
    scene.findOccurrencesByProperty(property, regex) Use this function to find occurrences that have a specific property.
    Tip

    To retrieve all the occurrences in the scene or the recursive children of an occurrence, use the scene.findOccurrencesByProperty method with these parameters:

    • The "Name" property
    • This regular expression to find all properties: ".*"

    This table shows the properties of occurrences:

    Property Type Description
    Id Ident A unique unsigned int identifier
    Name String The name of this occurrence
    Visible InheritableBool The visibility status of this occurrence
    Material Entity The optional material of this occurrence
    Transform Matrix4 Local transform matrix of this occurrence, storing local position, rotation and scale information
    Prototype Entity Prototype occurrence. If exists this occurrence inherits from its prototype's properties

    An occurrence that's instantiated elsewhere in the product structure is referred to as a prototype. References to a prototype are referred to as instances.

    To instantiate an occurrence and its subtree, use the scene.prototypeSubTree function. The returned subtree shares the same components, geometries, and materials as the prototyped subtree.

    Version 2024.2.2.3
    • 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.