using Godot; using System; using System.Collections.Generic; using YamlDotNet.Serialization; public partial class Projection : Window { private double _sceneTime = 0; private int _lastScene = 1; private int _activeScene = 1; // Called when the node enters the scene tree for the first time. public override void _Ready() { } // Called every frame. 'delta' is the elapsed time since the previous frame. public override void _Process(double delta) { // get MainScript instance MainScript mainScript = (MainScript)this.GetTree().GetRoot().GetNode("Main"); Window projectionWindow = GetNode("/root/Main/Projection"); // check for scene update and if so reset the scene time if (mainScript.GetScene() != this._activeScene) { this._lastScene = this._activeScene; this._activeScene = mainScript.GetScene(); this._sceneTime = 0; } else { this._sceneTime += delta; } } }