mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-10 02:15:55 +00:00
Crosshair
This commit is contained in:
parent
e5a60a6ccd
commit
fe552608ee
13 changed files with 264 additions and 33 deletions
35
Scripts/Components/Actors/3D/PlayerHitboxSpriteProvider3D.cs
Normal file
35
Scripts/Components/Actors/3D/PlayerHitboxSpriteProvider3D.cs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue