using System;
using UnityEngine;
using VContainer;

public class Platform : MonoBehaviour
{
    private Transform playerTransform;
    [Inject] private PlatformPool pool;
    [Inject] private PlatformManager manager;
    [Inject] private Player player; 


    void Start()
    {
        playerTransform = player.transform;
    }

    void Update()
    {
        if((playerTransform.position.y-transform.position.y)<-5)
        {
            pool.ReturnToPool(this.gameObject);
            manager.BuildPlatform();
            
        }
    }
}
