Added Observation Scene to show the Replay
This commit is contained in:
@@ -6,6 +6,7 @@ using System.Threading.Tasks;
|
||||
using System;
|
||||
using System.Reactive;
|
||||
using UnityEngine.UI;
|
||||
using Postgrest;
|
||||
|
||||
namespace GhostSystem
|
||||
{
|
||||
@@ -30,6 +31,8 @@ namespace GhostSystem
|
||||
private bool isPlaying = false;
|
||||
private float playbackTime = 0f;
|
||||
private float totalDuration = 0f;
|
||||
private string firstTimestamp = "";
|
||||
private string lastTimestamp = "";
|
||||
|
||||
private Dictionary<string, List<FrameModel>> objectTracks = new();
|
||||
|
||||
@@ -82,6 +85,8 @@ namespace GhostSystem
|
||||
public async Task LoadFrames()
|
||||
{
|
||||
Debug.Log("SceneId used in query: " + SceneId);
|
||||
Debug.Log("StartTime filter: " + dateSelector.selectedDateTime().ToString("o"));
|
||||
|
||||
|
||||
var query = SupabaseManager.instance.supabase
|
||||
.From<FrameModel>()
|
||||
@@ -115,6 +120,8 @@ namespace GhostSystem
|
||||
if (frames.Count > 1)
|
||||
{
|
||||
totalDuration = (float)(frames.Last().TimestampParsed - frames.First().TimestampParsed).TotalSeconds;
|
||||
firstTimestamp = frames.First().TimestampParsed.ToLongTimeString();
|
||||
lastTimestamp = frames.Last().TimestampParsed.ToLongTimeString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,7 +129,7 @@ namespace GhostSystem
|
||||
{
|
||||
isPlaying = true;
|
||||
playbackTime = 0f;
|
||||
Debug.LogError("Replay started: total duration = " + totalDuration);
|
||||
Debug.LogError("Replay started: total duration = " + totalDuration + " s, First: " + firstTimestamp + ", Last: " + lastTimestamp);
|
||||
}
|
||||
|
||||
public void PauseReplay() => isPlaying = false; // Für das Pause UI-Element, um das Replay zu pausieren
|
||||
@@ -202,12 +209,6 @@ namespace GhostSystem
|
||||
}
|
||||
}
|
||||
|
||||
/*public void OnSliderValueChanged(float value)
|
||||
{
|
||||
if (totalDuration <= 0f) return;
|
||||
isScrubbing = true;
|
||||
SetPlaybackTime(value * totalDuration);
|
||||
}*/
|
||||
public void SetSliderScrubValue(float sliderValue)
|
||||
{
|
||||
if (isScrubbing)
|
||||
|
||||
Reference in New Issue
Block a user