Files

31 lines
690 B
C#
Raw Permalink Normal View History

2025-07-10 03:38:48 +02:00
using Babushka.scripts.CSharp.Common.Fight;
2025-03-26 00:26:29 +01:00
using Godot;
2025-04-06 18:46:59 +02:00
namespace Babushka.scripts.CSharp.Common.Camera;
2025-03-26 00:26:29 +01:00
public partial class CameraController : Camera2D
{
2025-07-10 03:38:48 +02:00
#region Singleton ( Contains _EnterTree() ) // TODO: use autoload or other solution
public static CameraController Instance { get; private set; } = null!;
public override void _EnterTree()
{
Instance = this;
}
#endregion
[Export] private Node2D _followNode;
2025-09-21 14:54:55 +02:00
public FightHappening? fightToShow;
2025-07-10 03:38:48 +02:00
public override void _Process(double delta)
{
2025-09-21 14:54:55 +02:00
this.GlobalPosition = /*fightToShow?.camPositionNode.GlobalPosition ??*/ _followNode.GlobalPosition;
2025-07-10 03:38:48 +02:00
}
2025-09-21 14:54:55 +02:00
2025-07-10 03:38:48 +02:00
}