Skip to content

Commit 36749a6

Browse files
Stephen HodgsonStephen Hodgson
authored andcommitted
PR review fixes
1 parent b58cbb5 commit 36749a6

File tree

4 files changed

+6
-13
lines changed

4 files changed

+6
-13
lines changed

Assets/HoloToolkit/Sharing/Scripts/SyncModel/SyncArray.cs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ namespace HoloToolkit.Sharing.SyncModel
3737
/// Type of objects in the array.
3838
/// This is cached so that we don't have to call typeof(T) more than once.
3939
/// </summary>
40-
protected Type ArrayType;
40+
protected readonly Type arrayType;
4141

4242
public SyncArray(string field)
4343
: base(field)
4444
{
4545
dataArray = new Dictionary<string, T>();
46-
ArrayType = typeof(T);
46+
arrayType = typeof(T);
4747
}
4848

4949
public SyncArray() : this(string.Empty) { }
@@ -56,7 +56,7 @@ public SyncArray() : this(string.Empty) { }
5656
protected virtual T CreateObject(ObjectElement objectElement)
5757
{
5858
Type objectType = SyncSettings.Instance.GetDataModelType(objectElement.GetObjectType()).AsType();
59-
if (!objectType.IsSubclassOf(ArrayType) && objectType != ArrayType)
59+
if (!objectType.IsSubclassOf(arrayType) && objectType != arrayType)
6060
{
6161
throw new InvalidCastException(string.Format("Object of incorrect type added to SyncArray: Expected {0}, got {1} ", objectType, objectElement.GetObjectType().GetString()));
6262
}
@@ -212,7 +212,6 @@ private void OnInitializationComplete(SyncObject obj)
212212
/// <returns></returns>
213213
private T AddObject(ObjectElement existingElement)
214214
{
215-
//bool isLocal = false;
216215
string id = existingElement.GetName();
217216

218217
// Create a new object and assign the element
@@ -224,12 +223,6 @@ private T AddObject(ObjectElement existingElement)
224223
// Update internal map
225224
dataArray[id] = newObject;
226225

227-
// If it's local, make sure to initialize it so it can be used immediately.
228-
//if (isLocal)
229-
//{
230-
// newObject.InitializeLocal(Element);
231-
//}
232-
233226
return newObject;
234227
}
235228
}

Assets/HoloToolkit/Sharing/Scripts/SyncModel/SyncQuaternion.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class SyncQuaternion : SyncObject
2121
#if UNITY_EDITOR
2222
public override object RawValue
2323
{
24-
get { return new Quaternion(x.Value, y.Value, z.Value, w.Value); }
24+
get { return Value; }
2525
}
2626
#endif
2727

Assets/HoloToolkit/Sharing/Scripts/SyncModel/SyncVector3.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class SyncVector3 : SyncObject
2020
#if UNITY_EDITOR
2121
public override object RawValue
2222
{
23-
get { return new Vector3(x.Value, y.Value, z.Value); }
23+
get { return Value; }
2424
}
2525
#endif
2626

Assets/HoloToolkit/Utilities/Scripts/WorldAnchorManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ private void CreateAnchor(GameObject gameObjectToAnchor, string anchorName)
170170
}
171171
else
172172
{
173-
// Othertimes we must wait for the
173+
// Other times we must wait for the tracking system to locate the world.
174174
anchor.OnTrackingChanged += Anchor_OnTrackingChanged;
175175
}
176176
}

0 commit comments

Comments
 (0)