ccl4/blueberryPeak/Assets/Scripts/Player/TwigInteraction.cs
2025-06-18 09:36:09 +02:00

46 lines
976 B
C#

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;
// 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<PlayerInteraction>().AddToInventory(twigReward);
Destroy(gameObject);
collected = true;
}
}
public void SetCollected(bool picked)
{
collected = picked;
}
public bool IsCollected()
{
return collected;
}
}