AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
CollectionEditor.cs
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // Licensed under the MIT License. See LICENSE in the project root for license information.
3 
4 using UnityEngine;
5 using UnityEditor;
7 
8 [CustomEditor(typeof(ObjectCollection))]
9 public class CollectionEditor : Editor
10 {
11  public override void OnInspectorGUI()
12  {
13  // Draw the default
14  base.OnInspectorGUI();
15 
16  // Place the button at the bottom
17  ObjectCollection myScript = (ObjectCollection)target;
18  if(GUILayout.Button("Update Collection"))
19  {
20  myScript.UpdateCollection();
21  }
22  }
23 }
override void OnInspectorGUI()
An Object Collection is simply a set of child objects organized with some layout parameters. The object collection can be used to quickly create control panels or sets of prefab/objects.
void UpdateCollection()
Update collection is called from the editor button on the inspector. This function rebuilds / updates...