public void StopRecordingAndPutRecordingIntoRepresentation() { // update UI whileRecordingMenu.SetActive(false); preRecordingMenu.SetActive(true); // Instantiate anchored object - will be the parent object of hands recording and representation GameObject anchoredObject = InstantiateAnchoredObject(); // instantiate representation and pass the recording to it InstantiateRecordingRepresentation(ref anchoredObject, atLocation: Vector3.zero, atPalm: true); // get final length of recording in seconds int recordingLength = timerInstance.GetComponent <TimerBehaviour>().GetCurrentRecordingTime(); // stop recording and get the recording object HoloRecording newRecording = StopRecording(recordingLength, recordingRepresentationInstance.transform.localPosition); audioRecorder.StopAndSaveRecording(numberOfRecording.ToString()); HoloPlayerBehaviour playerComponent = recordingRepresentationInstance.GetComponent <HoloPlayerBehaviour>(); playerComponent.PutHoloRecordingIntoPlayer(numberOfRecording.ToString(), newRecording, anchoredObject, anchorStore); // Save anchor to cloud //SaveObjectAnchorToCloud(anchoredObject, numberOfRecording.ToString()); }
public override void OnCloudAnchorLocated(AnchorLocatedEventArgs args) { CloudSpatialAnchor cloudAnchor = args.Anchor; // callback is sometimes called multiple times for the same anchor, so we ensure only one object is instantiated per anchor ID if (!instantiatedAnchorIds.Contains(args.Identifier)) { // load recording string recordingId = anchorStore.GetRecordingId(args.Identifier); HoloRecording loadedRecording = LoadHoloRecording(recordingId); // Instantiate anchored object - will be the parent object of hands recording and representation GameObject anchoredObject = new GameObject(); WorldAnchor wa = anchoredObject.AddComponent <WorldAnchor>(); wa.SetNativeSpatialAnchorPtr(cloudAnchor.LocalAnchor); // instantiate representation and pass the recording to it Vector3 newRepLocation = new Vector3(loadedRecording.positionXRep, loadedRecording.positionYRep, loadedRecording.positionZRep); InstantiateRecordingRepresentation(ref anchoredObject, atLocation: newRepLocation, atPalm: false); HoloPlayerBehaviour playerComponent = recordingRepresentationInstance.GetComponent <HoloPlayerBehaviour>(); playerComponent.PutHoloRecordingIntoPlayer(recordingId, loadedRecording, anchoredObject, anchorStore, openKeyboard: false); // Mark already instantiated Anchor Ids so that nothing is instantiated more than once. instantiatedAnchorIds.Add(args.Identifier); } }
public void StopRecordingAndPutRecordingIntoRepresentation() { Debug.Log("StopRecordingAndPutRecordingIntoRepresentation"); HoloRecording newRecording = holoRecorderBehaviour.StopRecording(); HoloPlayerBehaviour playerComponent = recordingRepresentationInstance.GetComponent <HoloPlayerBehaviour>(); playerComponent.PutHoloRecordingIntoPlayer(newRecording); }