Item spawning
This commit is contained in:
@@ -9,23 +9,21 @@ public partial class Armor : InventoryItem
|
||||
{
|
||||
public override void _Notification(int what) => this.Notify(what);
|
||||
|
||||
[Export]
|
||||
internal override InventoryItemInfo Info { get; set; }
|
||||
public new InventoryItemInfo Info => ArmorInfo;
|
||||
|
||||
public ArmorInfo ArmorInfo { get => (ArmorInfo)Info; }
|
||||
[Export]
|
||||
public ArmorInfo ArmorInfo { get; set; }
|
||||
|
||||
public void OnReady()
|
||||
{
|
||||
Sprite.Texture = ArmorInfo.Texture;
|
||||
Pickup.BodyEntered += OnEntered;
|
||||
}
|
||||
|
||||
public void OnEntered(Node body)
|
||||
public void OnEntered(Node3D body)
|
||||
{
|
||||
if (GameRepo.InventoryItems.Value.Count() >= GameRepo.MaxItemSize)
|
||||
{
|
||||
AnimationPlayer.Play("drop");
|
||||
return;
|
||||
}
|
||||
|
||||
var inventoryList = GameRepo.InventoryItems.Value.Append(this).ToList();
|
||||
GameRepo.InventoryItems.OnNext(inventoryList);
|
||||
|
||||
Reference in New Issue
Block a user