21 lines
460 B
C#
21 lines
460 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class TrafficVehicle : MonoBehaviour
|
|
{
|
|
public float speed = 10f;
|
|
void FixedUpdate()
|
|
{
|
|
transform.position += new Vector3(0, 0, speed + GameManager.movespeed) * Time.deltaTime;
|
|
}
|
|
|
|
void OnTriggerEnter(Collider other)
|
|
{
|
|
if(other.tag.ToLower().Contains("destroy")){
|
|
Destroy(gameObject);
|
|
}
|
|
}
|
|
}
|
|
|