Pizzaautomat

This commit is contained in:
Simon Lübeß
2024-04-07 14:33:44 +02:00
parent 399f5b1639
commit 82216fa8a7
15 changed files with 682 additions and 0 deletions

View File

@ -0,0 +1,23 @@
using System.Collections;
using System.Collections.Generic;
using Interaction;
using UnityEngine;
public class VendingMachine : MonoBehaviour
{
[SerializeField]
private PickupInteractible _pizzaPrefab;
[SerializeField]
private Transform _pizzaChute;
[SerializeField]
private float _shootForce;
public void DropPiza()
{
PickupInteractible pizza = Instantiate(_pizzaPrefab, _pizzaChute.position, _pizzaChute.rotation);
pizza.GetComponent<Rigidbody>().AddForce(new Vector3(0, 0, _shootForce), ForceMode.Impulse);
}
}