mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 11:15:33 +00:00
47 lines
No EOL
1 KiB
C#
47 lines
No EOL
1 KiB
C#
using Godot;
|
|
|
|
namespace Cirno.Scripts.Components.Actors;
|
|
|
|
public partial class PlayerHitboxSpriteProvider : Node2D
|
|
{
|
|
[Export]
|
|
public AnimatedSprite2D Hitbox { get; private set; }
|
|
[Export]
|
|
public AnimatedSprite2D Circle { get; private set; }
|
|
[Export]
|
|
public AnimatedSprite2D Square { get; private set; }
|
|
|
|
[Export] public float RotationSpeed { get; private set; } = 10f;
|
|
|
|
public override void _Process(double delta)
|
|
{
|
|
if (!Visible) return;
|
|
Circle.Rotate((float)(RotationSpeed * delta));
|
|
Square.Rotate((float)(-RotationSpeed * delta));
|
|
}
|
|
|
|
public void SetVisibility(bool isVisible)
|
|
{
|
|
if (isVisible == Visible) return;
|
|
if (isVisible)
|
|
{
|
|
Show();
|
|
}
|
|
else
|
|
{
|
|
Hide();
|
|
}
|
|
}
|
|
|
|
// public void Show()
|
|
// {
|
|
// Hitbox.Show();
|
|
// Circle.Show();
|
|
// }
|
|
//
|
|
// public void Hide()
|
|
// {
|
|
// Hitbox.Hide();
|
|
// Circle.Hide();
|
|
// }
|
|
} |