Esempio n. 1
0
        private void LateUpdate()
        {
            if (_currentHandDataRecorderFrame != null && _currentHandDataRecorderFrame.HasAnyData)
            {
                _handDataRecordedFrames.Add(_currentHandDataRecorderFrame);
            }

            _currentHandDataRecorderFrame = new HandsDataRecordedFrame();
        }
 private void SetCurrentlyPlayedFrame()
 {
     if (CurrentPlayedRecording != null && ManuallyMoveToFrame != ManuallyMoveToFrameDisabledValue)
     {
         ManuallyMoveToFrame   = Mathf.Clamp(ManuallyMoveToFrame, ManuallyMoveToFrameDisabledValue, CurrentPlayedRecording.HandsDataRecordedFrames.Count);
         _currentlyPlayedFrame = CurrentPlayedRecording.HandsDataRecordedFrames[ManuallyMoveToFrame < 0 ? 0 : ManuallyMoveToFrame];
     }
     else
     {
         if (_framesToPlay != null && _framesToPlay.Any())
         {
             _currentlyPlayedFrame = _framesToPlay.Dequeue();
             CurrentlyPlayedFrame++;
         }
         else
         {
             _currentlyPlayedFrame = null;
         }
     }
 }
Esempio n. 3
0
        public void StopRecording()
        {
            if (string.IsNullOrEmpty(NewRecordingName))
            {
                Debug.LogError($"You need to specify '{nameof(NewRecordingName)}'");
                return;
            }

            IsRecording = false;
            if (_handDataRecordedFrames.Count == 0)
            {
                Debug.LogError($"Recording: '{NewRecordingName}' captured 0 frames, it won't be saved.");
                return;
            }

            var recording = HandsDataRecording.Create(this.transform, NewRecordingName, _handDataRecordedFrames, _initHandData, DeleteLocalRecording, PlayRecording);

            PersistDataLocallySafe(recording.RecordingName, recording.HandsDataRecordedFrames);
            Debug.Log($"Recording: '{NewRecordingName}' competed, captured {_handDataRecordedFrames.Count} frames.");

            _currentHandDataRecorderFrame = null;
            _handDataRecordedFrames       = new List <HandsDataRecordedFrame>();
            NewRecordingName = string.Empty;
        }
 public void StopPlaying()
 {
     _framesToPlay         = null;
     _currentlyPlayedFrame = null;
 }