Compare commits

..

4 commits

4 changed files with 6 additions and 10 deletions

View file

@ -95,10 +95,9 @@ private void Awake()
{
var hasChild = false;
var i = 0;
GameObject test;
while (!hasChild)
{
test = gameObject.transform.GetChild(i).gameObject;
var test = gameObject.transform.GetChild(i).gameObject;
if (test.name == "Target")
{
_driveTarget = test.transform;

View file

@ -67,7 +67,7 @@ private IEnumerator Manager()
_ais = GameObject.FindGameObjectsWithTag("AIs");
if (_ais.Length < maxAI)
{
var instance = Instantiate(aiPrefab, gameObject.transform);
// var instance = Instantiate(aiPrefab, gameObject.transform);
}
foreach (var i in _ais)

View file

@ -6,6 +6,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
/// <summary>
@ -102,9 +103,8 @@ public void Brake()
/// </summary>
public void Steering()
{
foreach (var wheel in wheels)
if (wheel.axel == Axel.Front)
wheel.wheelCollider.steerAngle = _currentTurn;
foreach (var wheel in wheels.Where(wheel => wheel.axel == Axel.Front))
wheel.wheelCollider.steerAngle = _currentTurn;
}
/// <summary>

View file

@ -96,10 +96,7 @@ private IEnumerator OpenDoor()
{
currentDuration = 0;
_opening = false;
if (_isOpen)
_isOpen = false;
else
_isOpen = true;
_isOpen = !_isOpen;
}
yield return new WaitForEndOfFrame();