This commit is contained in:
Simon Lübeß
2024-04-07 15:46:17 +02:00
parent 82216fa8a7
commit 0cc9ddba16
33 changed files with 2659 additions and 442 deletions

View File

@ -0,0 +1,26 @@
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;
}
}
}