mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 11:15:33 +00:00
Directional computers
This commit is contained in:
parent
72ce9fb932
commit
7ec45b56b1
13 changed files with 164 additions and 46 deletions
8
Scripts/Components/IIRotateable.cs
Normal file
8
Scripts/Components/IIRotateable.cs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
using Cirno.Scripts.Enums;
|
||||
|
||||
namespace Cirno.Scripts.Components;
|
||||
|
||||
public interface IIRotateable
|
||||
{
|
||||
public Direction Direction { get; set; }
|
||||
}
|
||||
16
Scripts/Components/SpriteAnimationStartupRotator.cs
Normal file
16
Scripts/Components/SpriteAnimationStartupRotator.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
using Cirno.Scripts.Enums;
|
||||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Components;
|
||||
|
||||
public partial class SpriteAnimationStartupRotator : AnimatedSprite2D
|
||||
{
|
||||
public override void _Ready()
|
||||
{
|
||||
var parent = GetParent<IIRotateable>();
|
||||
|
||||
var sprite = GetParent().GetNode<AnimatedSprite2D>("AnimatedSprite2D");
|
||||
|
||||
sprite.Play(parent.Direction.ToString());
|
||||
}
|
||||
}
|
||||
1
Scripts/Components/SpriteAnimationStartupRotator.cs.uid
Normal file
1
Scripts/Components/SpriteAnimationStartupRotator.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://rlevd6krqglv
|
||||
Loading…
Add table
Add a link
Reference in a new issue