mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-09 09:05:53 +00:00
Spinning chairs
This commit is contained in:
parent
e41fd125de
commit
72ce9fb932
16 changed files with 290 additions and 24 deletions
34
Scripts/Activables/NPC.cs
Normal file
34
Scripts/Activables/NPC.cs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
using Cirno.Scripts.Interactables;
|
||||
using Cirno.Scripts.Resources.Events;
|
||||
using Godot;
|
||||
using Godot.Collections;
|
||||
|
||||
namespace Cirno.Scripts.Activables;
|
||||
|
||||
public partial class NPC : Area2D, IInteractable
|
||||
{
|
||||
|
||||
[Export] public Array<EventResource> Events;
|
||||
|
||||
private ScriptableBase _scriptable;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
_scriptable = new ScriptableBase();
|
||||
_scriptable.Events = Events;
|
||||
|
||||
this.CallDeferred("add_child", _scriptable);
|
||||
}
|
||||
|
||||
public bool Activate(ActivationType activationType = ActivationType.Toggle)
|
||||
{
|
||||
_scriptable?.Activate(activationType);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool CanActivate()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue