mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 10:55:35 +00:00
36 lines
No EOL
853 B
C#
36 lines
No EOL
853 B
C#
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);
|
|
}
|
|
}
|
|
|
|
} |