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