mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-11 00:55:54 +00:00
Map Triggers
This commit is contained in:
parent
5ce2ffb48e
commit
054c0998ad
34 changed files with 5896 additions and 477 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Cirno.Scripts.Actors;
|
||||
|
||||
[Tool]
|
||||
public partial class Elevator3D : PathFollow3D, IActivable
|
||||
{
|
||||
[Export] public float Speed { get; set; }
|
||||
|
|
@ -11,6 +12,7 @@ public partial class Elevator3D : PathFollow3D, IActivable
|
|||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
if (Engine.IsEditorHint()) return;
|
||||
if (!_isMoving) return;
|
||||
|
||||
ProgressRatio += (Speed * (float)delta) * _multiplier;
|
||||
|
|
@ -24,12 +26,18 @@ public partial class Elevator3D : PathFollow3D, IActivable
|
|||
|
||||
public bool Activate(ActivationType activationType = ActivationType.Toggle)
|
||||
{
|
||||
if (Engine.IsEditorHint()) return false;
|
||||
if (_isMoving) return false;
|
||||
|
||||
StartMoving();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Toggle()
|
||||
{
|
||||
this.Activate();
|
||||
}
|
||||
|
||||
public void StartMoving()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue