-
Notifications
You must be signed in to change notification settings - Fork 110
Object Collection
Object collection is a script which helps you lay out an array of objects in predefined three-dimensional shapes. It supports four different surface styles - plane, cylinder, sphere and scatter. You can adjust the radius, size and the space between the items. Since it supports any object in Unity, you can use it to layout both 2D and 3D objects.
You can find the samples in the scene ObjectCollection_Examples.unity under https://github.com/Microsoft/MRDesignLabs_Unity/tree/master/DesignLabs_Unity_Examples/Assets/MRDL_ControlsExample/Scenes
Periodic Table of the Elements is an example app that demonstrates how Object collection works. It uses Object collection to layout the 3D element boxes in different shapes.
You can use Object collection to layout imported 3D objects. The example below shows the plane and cylindrical layouts of 3D chair model objects using Object collection.
You can also use 2D images with Object collection. For example, you can easily display multiple images in grid style using Object collection.
You can find the examples in the scene ObjectCollection_Examples.unity. In this scene, you can find the ObjectCollection.cs script under Assets/MRDesignLab/HUX/Scripts/Collections
- To create a collection, simply create an empty GameObject and assign the ObjectCollection.cs script to it.
- Then you can add any object(s) as a child of the GameObject.
- Once you finished adding a child object, click the Update Collection button in the Inspector Panel.
- You will then see the object(s) laid out in selected Surface Type.