mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-10 05:55:54 +00:00
Map Triggers
This commit is contained in:
parent
5ce2ffb48e
commit
054c0998ad
34 changed files with 5896 additions and 477 deletions
|
|
@ -1,13 +1,36 @@
|
|||
using Godot;
|
||||
using Godot.Collections;
|
||||
|
||||
namespace Cirno.Scripts.Actors;
|
||||
|
||||
[Tool]
|
||||
public partial class ElevatorProxy3D : Path3D, IActivable
|
||||
{
|
||||
[Export] public StringName TargetName { get; set; }
|
||||
[Export] public Elevator3D Elevator { get; private set; }
|
||||
public bool Activate(ActivationType activationType = ActivationType.Toggle)
|
||||
{
|
||||
if (Engine.IsEditorHint()) return false;
|
||||
return Elevator.Activate(activationType);
|
||||
}
|
||||
|
||||
public void Toggle()
|
||||
{
|
||||
this.Activate();
|
||||
}
|
||||
|
||||
public void _func_godot_apply_properties(Dictionary props)
|
||||
{
|
||||
TargetName = (string)props["targetname"];
|
||||
}
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
if (Engine.IsEditorHint()) return;
|
||||
if (!string.IsNullOrWhiteSpace(TargetName))
|
||||
{
|
||||
this.AddToGroup(TargetName);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue