Files
GameVsJam/3d Prototyp/Assets/Scripts/Interaction/CoffeePlace.cs
Simon Lübeß 0606b1936d Kaffee
(cherry picked from commit 0cc9ddba16)

# Conflicts:
#	3d Prototyp/Assets/Models/Consumables/Bottle.meta
#	3d Prototyp/Assets/Scenes/GameJamScene.unity
2024-04-07 16:59:55 +02:00

26 lines
694 B
C#

using UnityEngine;
namespace Interaction
{
public class CoffeePlace : MonoBehaviour
{
[SerializeField]
private BoxCollider _boxCollider;
public bool IsFree()
{
Collider[] colliders = Physics.OverlapBox(_boxCollider.bounds.center, _boxCollider.bounds.extents);
foreach (Collider c in colliders)
{
// Solbald ein Collider eines Rigidbodies im Weg ist sagen wir, dass wir nichts spawnen können
if (!c.isTrigger && c.attachedRigidbody)
{
return false;
}
}
return true;
}
}
}