using Godot; using System; using System.Diagnostics; using System.IO; using System.Linq; using System.Linq.Expressions; using System.Threading; using BITKit; using BITKit.IO; using Microsoft.Extensions.DependencyInjection; using Cysharp.Threading.Tasks; namespace BITKit; public partial class PlaybackService : UXPanel { [Export] private string path; [Export] private Node root; [Export] private Label label; [Export] private PackedScene template; [Export] private PackedScene labelTemplate; [Export] private DataPlayer dataPlayer; public PlaybackService() { BITApp.ServiceCollection.AddSingleton(this); } public override void _Ready() { OnExit(); } public override void OnEntry() { var files = new DirectoryInfo(PathHelper.GetFolderPath("Demos", GetTree().CurrentScene.Name)) .GetFiles() .Where(x => x.Extension is ".demo"); ; foreach (var x in files) { var playableInfo = BITAssets.ReadAs(x.FullName); var instance = template.Instantiate