Fix the sound bird interactaiblity issues.
This commit is contained in:
8
Assets/Scripts/StateMachines/Quarry/SoundBird.meta
Normal file
8
Assets/Scripts/StateMachines/Quarry/SoundBird.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 81aa592db4b598c4cbfb7faf604e0d62
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
45
Assets/Scripts/StateMachines/Quarry/SoundBird/IdleState.cs
Normal file
45
Assets/Scripts/StateMachines/Quarry/SoundBird/IdleState.cs
Normal 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");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cfd3b894d78129b4aa5310e5ce9cceae
|
||||
Reference in New Issue
Block a user