mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-14 02:55:55 +00:00
Elevators move players
This commit is contained in:
parent
8b378abef3
commit
2e0ad40f33
8 changed files with 156 additions and 93 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Cirno.Scripts.Enums;
|
||||
using Godot;
|
||||
|
||||
|
|
@ -26,9 +27,27 @@ public partial class ElevatorProxy : Area2D, IActivable
|
|||
// {
|
||||
//
|
||||
// }
|
||||
|
||||
public InteractionController CachedPlayer { get; private set; }
|
||||
|
||||
public void Activate(ActivationType activationType = ActivationType.Toggle)
|
||||
{
|
||||
EmitSignal(SignalName.Activated, (int)activationType);
|
||||
}
|
||||
|
||||
private void _on_area_entered(Area2D area)
|
||||
{
|
||||
if (area is InteractionController player)
|
||||
{
|
||||
CachedPlayer = player;
|
||||
}
|
||||
}
|
||||
|
||||
private void _on_area_exited(Area2D area)
|
||||
{
|
||||
if (area is InteractionController player)
|
||||
{
|
||||
CachedPlayer = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue