using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PizzaCatcher : MonoBehaviour
{
    public Transform pizzaSpawnPoint;

    void OnTriggerEnter2D(Collider2D col)
    {
        col.transform.rotation = pizzaSpawnPoint.transform.rotation;
        col.transform.position = pizzaSpawnPoint.transform.position;

        Rigidbody2D rigidbody2D = col.gameObject.GetComponent<Rigidbody2D>();

        if(rigidbody2D != null)
        {
            rigidbody2D.velocity = Vector2.zero;
            rigidbody2D.angularVelocity = 0f;
            PizzaMinigameHandler.Instance.DropPizza();
        }
    }
}
