mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-09 09:05:53 +00:00
Player owner
This commit is contained in:
parent
2e0ad40f33
commit
3064a0a5a0
3 changed files with 9 additions and 6 deletions
|
|
@ -12,7 +12,7 @@ public abstract partial class ElevatorMovementState : BaseState<ElevatorState, E
|
|||
{
|
||||
|
||||
protected GTween Tween;
|
||||
protected Node2D OldPlayerParent;
|
||||
//protected Node2D OldPlayerParent;
|
||||
|
||||
protected abstract Vector2 StartingPosition { get; }
|
||||
protected abstract Vector2 EndingPosition { get; }
|
||||
|
|
@ -37,15 +37,15 @@ public abstract partial class ElevatorMovementState : BaseState<ElevatorState, E
|
|||
private void RestorePlayerParent()
|
||||
{
|
||||
if (PlayerBody is null) return;
|
||||
PlayerBody.Reparent(OldPlayerParent);
|
||||
OldPlayerParent = null;
|
||||
PlayerBody.Reparent(PlayerBody.Owner);
|
||||
//OldPlayerParent = null;
|
||||
MainObject.CachedPlayer?.StateMachine.SetState(PlayerState.Active);
|
||||
}
|
||||
|
||||
private void CatchPlayer()
|
||||
{
|
||||
if (PlayerBody is null) return;
|
||||
OldPlayerParent = PlayerBody.GetParent<Node2D>();
|
||||
//OldPlayerParent = PlayerBody.GetParent<Node2D>();
|
||||
MainObject.CachedPlayer.StateMachine.SetState(PlayerState.Cutscene);
|
||||
PlayerBody.Reparent(MainObject);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue