Beispiel #1
0
        private void StatePickedUp()
        {
            if (_stateMachine.IsStateNew())
            {
                _animationPlayer.Play(ANIM_PICKUP);
                _deathTimer.Stop();
                ResetBlink();
                _selectableComponent.Disable();
                GetParent().RemoveChild(this);
                GameZone.FloatersLayer.AddChild(this);
                PlayerInventory.AddItem(this);
            }
            var playerPosition = GetTree().GetFirstNodeInGroup <Player>(Player.GROUP)?.GlobalPosition ?? Vector2.Zero;

            GlobalPosition = playerPosition + new Vector2(0f, PLAYER_HOVER_Y_OFFSET);
        }