25 lines
454 B
C#
25 lines
454 B
C#
using UnityEngine;
|
|
|
|
public class AddFuel : MonoBehaviour
|
|
|
|
{
|
|
public CarController carController;
|
|
private void OnTriggerEnter2D(Collider2D other)
|
|
{
|
|
carController.fuel = 1;
|
|
Destroy(gameObject);
|
|
|
|
}
|
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
}
|