Files
HelixJump/Assets/Scripts/PlatformScript/Platform.cs
2025-12-11 18:20:42 -08:00

28 lines
545 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;
void Start()
{
playerTransform = player.transform;
}
void Update()
{
if((playerTransform.position.y-transform.position.y)<-5)
{
pool.ReturnToPool(this.gameObject);
manager.BuildPlatform();
}
}
}