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

public class PickUpTrash : MonoBehaviour
{
    public GameObject PlantPrefab;
    public GameManager Manager;

    void OnTriggerEnter(Collider other)
    {
        if(other.gameObject.layer != 12)
            return;

        other.gameObject.SetActive(false);
        Instantiate(PlantPrefab, other.transform.position, Quaternion.AngleAxis(Random.Range(0.0f, 360.0f), Vector3.up));

        Manager.IncreaseScore();

    }
}
