mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-14 11:13:47 +00:00
Modularized doors and lightbridges
This commit is contained in:
parent
1a24711984
commit
1a5bd1b6d8
27 changed files with 513 additions and 346 deletions
29
Scripts/Components/Actors/DoorSpriteComponent.cs
Normal file
29
Scripts/Components/Actors/DoorSpriteComponent.cs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Components.Actors;
|
||||
|
||||
public partial class DoorSpriteComponent : AnimatedSprite2D
|
||||
{
|
||||
protected Door _door;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
|
||||
_door = GetParent<Door>();
|
||||
|
||||
_door.DoorOpened += DoorOpened;
|
||||
_door.DoorClosed += DoorClosed;
|
||||
}
|
||||
|
||||
protected virtual void DoorClosed()
|
||||
{
|
||||
this.Play("Closing");
|
||||
}
|
||||
|
||||
protected virtual void DoorOpened()
|
||||
{
|
||||
this.Play("Opening");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue