Big refactor in place: Organize nodes in line with dependency injection expectations, use state machine flow more
This commit is contained in:
23
src/ui/pause_menu/PauseMenu.cs
Normal file
23
src/ui/pause_menu/PauseMenu.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Chickensoft.AutoInject;
|
||||
using Chickensoft.GodotNodeInterfaces;
|
||||
using Chickensoft.Introspection;
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public interface IPauseMenu : IControl
|
||||
{
|
||||
void FadeIn();
|
||||
void FadeOut();
|
||||
}
|
||||
|
||||
[Meta(typeof(IAutoNode))]
|
||||
public partial class PauseMenu : Control, IPauseMenu
|
||||
{
|
||||
public override void _Notification(int what) => this.Notify(what);
|
||||
|
||||
[Node] public IAnimationPlayer AnimationPlayer { get; set; } = default!;
|
||||
|
||||
public void FadeIn() => AnimationPlayer.Play("fade_in");
|
||||
|
||||
public void FadeOut() => AnimationPlayer.Play("fade_out");
|
||||
}
|
||||
Reference in New Issue
Block a user