using System; using Unity.Mathematics; using UnityEngine; using Random = UnityEngine.Random; using AK.Wwise; // Make sure your Wwise namespace is correct public class TwigInteraction : MonoBehaviour { private bool collected = false; [SerializeField] private ItemReward twigReward; [SerializeField] private AK.Wwise.Event pickupItem; // Wwise Events // public AK.Wwise.Event PlayBushesEvent; // public AK.Wwise.Event PlayBerryWithBushEvent; void Start() { } void OnTriggerEnter(Collider other) { if (!collected) { // Play the "Play_BerryWithBush" event if bush has berries // PlayBerryWithBushEvent.Post(gameObject); other.gameObject.GetComponent().AddToInventory(twigReward); Destroy(gameObject); pickupItem.Post(gameObject); collected = true; } } public void SetCollected(bool picked) { collected = picked; } public bool IsCollected() { return collected; } }