✨ updated PlayerInteraction
This commit is contained in:
parent
65fe1823ec
commit
9f48b79907
@ -34,13 +34,16 @@ public class BushInteraction : MonoBehaviour
|
||||
|
||||
void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (!BlueBerriesPicked && other.CompareTag("Player"))
|
||||
if (!BlueBerriesPicked)
|
||||
{
|
||||
|
||||
if (emptyBush == null)
|
||||
{
|
||||
PlayBushesEvent.Post(gameObject);
|
||||
return;
|
||||
}
|
||||
if (other.CompareTag("Player"))
|
||||
{
|
||||
// Play the "Play_BerryWithBush" event if bush has berries
|
||||
PlayBerryWithBushEvent.Post(gameObject);
|
||||
|
||||
@ -49,6 +52,7 @@ public class BushInteraction : MonoBehaviour
|
||||
blueberryCount = 0;
|
||||
BlueBerriesPicked = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public int GetBlueberryCount()
|
||||
|
@ -90,6 +90,10 @@ public class PlayerInteraction : MonoBehaviour
|
||||
{
|
||||
return blueberryCount;
|
||||
}
|
||||
public void SetBlueberryCount(int count)
|
||||
{
|
||||
blueberryCount = count;
|
||||
}
|
||||
|
||||
public void CollectBlueberry(int newBlueberries)
|
||||
{
|
||||
@ -127,4 +131,9 @@ public class PlayerInteraction : MonoBehaviour
|
||||
{
|
||||
return inventory;
|
||||
}
|
||||
|
||||
public void SetInventoryItems(List<InventoryItem> items)
|
||||
{
|
||||
inventory = items;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user