Добавлен индикатор стамины и переделаны дороги
This commit is contained in:
@ -1,23 +1,17 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class CarManagerScript : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private int _MaxSpeed;
|
||||
[SerializeField] private int _MaxSpeed;
|
||||
|
||||
private int _Speed;
|
||||
|
||||
[SerializeField]
|
||||
private List<GameObject> _CarPrefs;
|
||||
[SerializeField] private List<GameObject> _CarPrefs;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject[] _Points = new GameObject[2];
|
||||
[SerializeField] private GameObject[] _Points = new GameObject[2];
|
||||
|
||||
[SerializeField]
|
||||
bool _LeftToRight;
|
||||
[SerializeField] bool _LeftToRight;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
@ -34,7 +28,7 @@ public class CarManagerScript : MonoBehaviour
|
||||
|
||||
//Debug.Log($"Speed - {_Speed}");
|
||||
|
||||
_LeftToRight = GetRandomObject<bool>(new List<bool> { true, false });
|
||||
//_LeftToRight = GetRandomObject<bool>(new List<bool> { true, false });
|
||||
|
||||
float time = GetRandomObject<float>(new List<float> { 0f, 1f, 2f, 3f, 4f, 5f });
|
||||
|
||||
@ -62,7 +56,7 @@ public class CarManagerScript : MonoBehaviour
|
||||
{
|
||||
DeleteCar();
|
||||
}
|
||||
else if (_Car.transform.position.x <= _Points[0].transform.position.x && !_LeftToRight)
|
||||
else if (_Car.transform.position.x <= _Points[0].transform.position.x && !_LeftToRight)
|
||||
{
|
||||
DeleteCar();
|
||||
}
|
||||
@ -103,7 +97,7 @@ public class CarManagerScript : MonoBehaviour
|
||||
|
||||
public void DeleteCar()
|
||||
{
|
||||
Destroy( _Car );
|
||||
Destroy(_Car);
|
||||
StartMove();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user