mirror of
https://github.com/kuhyx/praca_magisterska.git
synced 2026-07-04 13:43:05 +02:00
12 lines
264 B
C#
12 lines
264 B
C#
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
public class Enemy : MonoBehaviour
|
||
|
|
{
|
||
|
|
public float speed = 2f;
|
||
|
|
|
||
|
|
void Update()
|
||
|
|
{
|
||
|
|
transform.Translate(Vector3.down * speed * Time.deltaTime);
|
||
|
|
if (transform.position.y < -10) Destroy(gameObject); // Out of bounds
|
||
|
|
}
|
||
|
|
}
|