AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
SerializedPropertyExtensions.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 using System.Collections.Generic;
4 using UnityEditor;
5 using UnityEngine;
6 
7 namespace HoloToolkit.Unity
8 {
9  public static class SerializedPropertyExtensions
10  {
11  public static void SetObjects<T>(this SerializedProperty property, IList<T> objects) where T : Object
12  {
13  property.arraySize = objects.Count;
14  for (var i = 0; i < objects.Count; i++)
15  {
16  property.GetArrayElementAtIndex(i).objectReferenceValue = objects[i];
17  }
18  }
19  }
20 }