Kaffee
(cherry picked from commit 0cc9ddba16)
# Conflicts:
# 3d Prototyp/Assets/Models/Consumables/Bottle.meta
# 3d Prototyp/Assets/Scenes/GameJamScene.unity
This commit is contained in:
26
3d Prototyp/Assets/Scripts/Interaction/CoffeePlace.cs
Normal file
26
3d Prototyp/Assets/Scripts/Interaction/CoffeePlace.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 08ef16f17f8a4392aa964ae6972b86bd
|
||||
timeCreated: 1712493618
|
||||
Reference in New Issue
Block a user