AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
SyncSpawnedObject.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;
6 
7 namespace HoloToolkit.Sharing.Spawning
8 {
13  [SyncDataClass]
15  {
19  [SyncData] public SyncTransform Transform;
20 
24  [SyncData] public SyncString Name;
25 
29  [SyncData] public SyncString ParentPath;
30 
34  [SyncData] public SyncString ObjectPath;
35 
36 
37  public GameObject GameObject { get; set; }
38 
39  public virtual void Initialize(string name, string parentPath)
40  {
41  Name.Value = name;
42  ParentPath.Value = parentPath;
43 
44  ObjectPath.Value = string.Empty;
45  if (!string.IsNullOrEmpty(ParentPath.Value))
46  {
47  ObjectPath.Value = ParentPath.Value + "/";
48  }
49 
50  ObjectPath.Value += Name.Value;
51  }
52  }
53 }
virtual void Initialize(string name, string parentPath)
SyncTransform Transform
Transform (position, rotation, and scale) for the object.
This class implements the Transform object primitive for the syncing system. It does the heavy liftin...
This class implements the string primitive for the syncing system. It does the heavy lifting to make ...
Definition: SyncString.cs:10
A SpawnedObject contains all the information needed for another device to spawn an object in the same...
The SyncObject class is a container object that can hold multiple SyncPrimitives. ...
Definition: SyncObject.cs:21
SyncString ParentPath
Path to the parent object in the game object.