발사라던가 제작했습니다만 ..
데미지 구현은 모르겠고
큐 효율성을 높여주세요
This commit is contained in:
김도환
2026-04-16 21:14:05 +09:00
parent 65c997406b
commit 4946e16710
15 changed files with 2399 additions and 73 deletions

View File

@@ -4,20 +4,23 @@ using UnityEngine;
public class BulletMovement : MonoBehaviour
{
public float moveSpeed = 10;
public float lifeTime = 2;
private float _currentTime = 0;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
private void OnEnable()
{
_currentTime = lifeTime;
}
// Update is called once per frame
void Update()
{
transform.Translate(Vector2.up * (Time.deltaTime * moveSpeed));
_currentTime -= Time.deltaTime;
if (_currentTime <= 0)
{
gameObject.SetActive(false);
}
}
private void OnTriggerEnter2D(Collider2D other)
{
}
}