Project cleanup: Removed 3D scripts and scenes from project. Also renamed and moved some minor stuff.
This commit is contained in:
@@ -1,47 +0,0 @@
|
||||
using Godot;
|
||||
namespace Babushka.scripts.CSharp.Common.Inventory;
|
||||
|
||||
public partial class ItemOnGround : Node3D
|
||||
{
|
||||
private ItemInstance _itemInstance;
|
||||
|
||||
[Export]
|
||||
private bool _infiniteSupply = false;
|
||||
|
||||
private Label3D _itemLabel => GetNode<Label3D>("ItemLabel");
|
||||
private Label3D _pickupErrorLabel => GetNode<Label3D>("PickupErrorLabel");
|
||||
|
||||
public ItemInstance itemInstance
|
||||
{
|
||||
get => _itemInstance;
|
||||
set
|
||||
{
|
||||
_itemInstance = value;
|
||||
UpdateVisuals();
|
||||
}
|
||||
}
|
||||
|
||||
public void TryPickUp()
|
||||
{
|
||||
var result = InventoryManager.Instance.CollectItem(itemInstance.Clone());
|
||||
if (result == InventoryActionResult.Success)
|
||||
{
|
||||
if (!_infiniteSupply)
|
||||
{
|
||||
QueueFree();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_pickupErrorLabel.Text = "Inventory Full";
|
||||
var tween = GetTree().CreateTween();
|
||||
tween.TweenInterval(2);
|
||||
tween.TweenCallback(Callable.From(() => _pickupErrorLabel.Text = ""));
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateVisuals()
|
||||
{
|
||||
_itemLabel.Text = itemInstance.blueprint?.name ?? "Error Item";
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
uid://udhigottc8rg
|
||||
Reference in New Issue
Block a user