29 lines
594 B
C#
29 lines
594 B
C#
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;
|
|
//[Inject] private IInputReader inputReader;
|
|
|
|
|
|
void Start()
|
|
{
|
|
playerTransform = player.transform;
|
|
}
|
|
|
|
void Update()
|
|
{
|
|
if((playerTransform.position.y-transform.position.y)<-5)
|
|
{
|
|
pool.ReturnToPool(this.gameObject);
|
|
manager.BuildPlatform();
|
|
|
|
}
|
|
}
|
|
}
|