Files
Babushka/scripts/CSharp/Common/Camera/CameraController.cs
T

28 lines
666 B
C#
Raw 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;
public FightInstance? fightToShow;
public override void _Process(double delta)
{
this.GlobalPosition = fightToShow?.camPositionNode.GlobalPosition ?? _followNode.GlobalPosition;
}
}