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