public void TakeSnapshot(string snapshotName) { if (!enabled) { return; } Log(snapshotName); var pluginJSON = new JSONClass(); context.embody.StoreJSON(pluginJSON, true, true); pluginJSON.Remove(storeId); snapshots.Add(new EmbodyDebugSnapshot { name = $"{Time.realtimeSinceStartup:0.00} {snapshotName}", vrMode = GetVRMode(), worldScale = SuperController.singleton.worldScale, playerHeightAdjust = SuperController.singleton.playerHeightAdjust, pluginJSON = pluginJSON, poseJSON = StorePoseJSON(), navigationRig = EmbodyTransformDebugSnapshot.From(SuperController.singleton.navigationRig), head = EmbodyTransformDebugSnapshot.From(context.head), leftHand = EmbodyTransformDebugSnapshot.From(context.LeftHand()), rightHand = EmbodyTransformDebugSnapshot.From(context.RightHand()), viveTracker1 = EmbodyTransformDebugSnapshot.From(SuperController.singleton.viveTracker1), viveTracker2 = EmbodyTransformDebugSnapshot.From(SuperController.singleton.viveTracker2), viveTracker3 = EmbodyTransformDebugSnapshot.From(SuperController.singleton.viveTracker3), viveTracker4 = EmbodyTransformDebugSnapshot.From(SuperController.singleton.viveTracker4), viveTracker5 = EmbodyTransformDebugSnapshot.From(SuperController.singleton.viveTracker5), viveTracker6 = EmbodyTransformDebugSnapshot.From(SuperController.singleton.viveTracker6), viveTracker7 = EmbodyTransformDebugSnapshot.From(SuperController.singleton.viveTracker7), viveTracker8 = EmbodyTransformDebugSnapshot.From(SuperController.singleton.viveTracker8), }); }
public void MakeDefault() { FileManagerSecure.CreateDirectory(SaveFormat.SaveFolder); var jc = new JSONClass(); _context.embody.StoreJSON(jc, true, false); jc.Remove(_context.diagnostics.storeId); _context.plugin.SaveJSON(jc, SaveFormat.DefaultsPath); }
public void JsonClass_Remove_NonExistantNode() { // arrange var node = new JSONClass(); JSONNode toRemove = new JSONData("string"); // act var removed = node.Remove(toRemove); // assert Assert.IsNull(removed); }
public void JsonClass_Remove_ExistingKey() { // arrange var node = new JSONClass(); JSONNode toRemove = new JSONData("string"); node["value"] = toRemove; // act var removed = node.Remove("value"); // assert Assert.AreEqual(toRemove, removed); }
public void JsonClass_Remove_ExistingIndex() { // arrange var node = new JSONClass(); JSONNode toRemove = new JSONData("string"); node.Add(toRemove); // act var removed = node.Remove(0); // assert Assert.AreEqual(toRemove, removed); }
public void JsonClass_Remove_IndexTooHigh() { // arrange var node = new JSONClass(); JSONNode toRemove = new JSONData("string"); node.Add(toRemove); // act var removed = node.Remove(2); // assert Assert.IsNull(removed); }