Fix the sound bird interactaiblity issues.

This commit is contained in:
Michal Pikulski
2025-11-24 11:41:47 +01:00
parent f0abc4760b
commit e33de5da3d
10 changed files with 252 additions and 341 deletions

View File

@@ -0,0 +1,45 @@
using Core.SaveLoad;
using Interactions;
using UnityEngine;
namespace StateMachines.Quarry.SoundBird
{
/// <summary>
/// Idle state for the Sound Bird - bird is landed and slot is interactable
/// </summary>
public class IdleState : AppleState
{
[Header("Slot Reference")]
[Tooltip("The item slot that should be enabled when the bird is idle")]
[SerializeField] private ItemSlot itemSlot;
public override void OnEnterState()
{
// Enable the slot when the bird lands (enters idle)
if (itemSlot != null)
{
itemSlot.SetActive(true);
Debug.Log($"[IdleState] Enabled ItemSlot: {itemSlot.gameObject.name}");
}
else
{
Debug.LogWarning("[IdleState] ItemSlot reference is null - cannot enable slot");
}
}
private void OnDisable()
{
// Disable the slot when the bird takes off
if (itemSlot != null)
{
itemSlot.SetActive(false);
Debug.Log($"[IdleState] Disabled ItemSlot: {itemSlot.gameObject.name}");
}
else
{
Debug.LogWarning("[IdleState] ItemSlot reference is null - cannot disable slot");
}
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: cfd3b894d78129b4aa5310e5ce9cceae