mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-11 10:25:55 +00:00
typed Open trigger
This commit is contained in:
parent
1907a38575
commit
4abf28066a
23 changed files with 2018 additions and 1440 deletions
|
|
@ -11,6 +11,8 @@ public partial class TriggerArea : Area3D
|
|||
[Export] public string TargetFunc { get; private set; }
|
||||
[Export] public string TargetName { get; private set; }
|
||||
|
||||
[Export] public ActivationType ActivationType { get; private set; } = ActivationType.Toggle;
|
||||
|
||||
public enum TriggerStates
|
||||
{
|
||||
READY,
|
||||
|
|
@ -27,6 +29,16 @@ public partial class TriggerArea : Area3D
|
|||
Target = props["target"];
|
||||
TargetFunc = props["targetfunc"];
|
||||
TargetName = props["targetname"];
|
||||
if (props.TryGetValue("activationtype", out var type))
|
||||
{
|
||||
var t = Enum.TryParse(type, true, out ActivationType activationType);
|
||||
if (t)
|
||||
{
|
||||
ActivationType = activationType;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void _on_ent_entered(Node ent)
|
||||
|
|
@ -72,7 +84,7 @@ public partial class TriggerArea : Area3D
|
|||
if (t is IActivable activable)
|
||||
{
|
||||
GD.Print($"Activating {t.Name}");
|
||||
activable.Toggle();
|
||||
activable.Activate(ActivationType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue