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

public class Tapita : MonoBehaviour
{
    private Player player;
    private Vector3 posicionInicial;

    private void Start()
    {
        player = FindObjectOfType<Player>();
        posicionInicial = transform.position;

    }

    private void Update()
    {
        if (player.tapitaRecogida)
        {
            Esconder();
        }
        else
        {
            Revelar();
        }
    }

    void Revelar()
    {
        transform.position = posicionInicial;
    }

    void Esconder()
    {
        transform.position = new Vector3(transform.position.x, 50, transform.position.z);
    }
}
