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

public class AminoGeneratorController : MonoBehaviour
{
    [SerializeField]
    ADNController adnController = null;

    private int aminoType;

    private void Start()
    {
        switch (transform.name)
        {
            case "AGGreen":
                aminoType = 0;
                break;
            case "AGRed":
                aminoType = 1;
                break;
            case "AGBlue":
                aminoType = 2;
                break;
            case "AGOrange":
                aminoType = 3;
                break;
        }
    }

    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.tag == "Eat")
        { 
            PlayerController player = collision.gameObject.GetComponentInParent<PlayerController>();
            player.ResetEat();
            adnController.InsertAminoacido(aminoType);
            Destroy(collision.gameObject);
        }
    }
}
