From ca7e3c68a5cfebde2164f0e83c1df30cb42edd8c Mon Sep 17 00:00:00 2001 From: hzhang Date: Wed, 12 Feb 2025 23:37:50 +0000 Subject: [PATCH] add: dissolve scene / nuget feed source --- NuGet.config | 8 +++++++ Package/build/Polonium.targets | 1 + Polonium.csproj | 36 +++++++++++++++++++++++------ src/Scenes/DissolveScene.cs | 42 ++++++++++++++++++++++++++++++++++ 4 files changed, 80 insertions(+), 7 deletions(-) create mode 100644 NuGet.config create mode 100644 src/Scenes/DissolveScene.cs diff --git a/NuGet.config b/NuGet.config new file mode 100644 index 0000000..db4bed5 --- /dev/null +++ b/NuGet.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Package/build/Polonium.targets b/Package/build/Polonium.targets index f390f69..bcd3c70 100644 --- a/Package/build/Polonium.targets +++ b/Package/build/Polonium.targets @@ -70,5 +70,6 @@ + diff --git a/Polonium.csproj b/Polonium.csproj index ab814f7..a752c04 100644 --- a/Polonium.csproj +++ b/Polonium.csproj @@ -8,12 +8,13 @@ false Polonium true - 0.1.0 + 0.1.1-x Hangman + true - + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Scenes/DissolveScene.cs b/src/Scenes/DissolveScene.cs new file mode 100644 index 0000000..ac28cde --- /dev/null +++ b/src/Scenes/DissolveScene.cs @@ -0,0 +1,42 @@ +using System.Diagnostics; +using Godot; +using Polonium.Attributes; + +namespace Polonium.Scenes; +[ProxyNode] +public partial class DissolveScene : Scene +{ + [Export] + public Scene NextScene { get; set; } + private bool Finished { get; set; } = false; + private bool Terminated { get; set; } = false; + + public override void _Process(double delta) + { + if(Finished && !Terminated) + { + Terminated = true; + PoloniumRegistry.Instance.RootScene.SwitchScene(NextScene); + return; + } + + Process(delta); + base._Process(delta); + } + [ProxyMethod] + public virtual void Enter() + { + } + [ProxyMethod] + public virtual void Process(double delta) + { + } + + public sealed override void _EnterTree() + { + Finished = false; + Terminated = false; + Enter(); + base._EnterTree(); + } +}