Compare commits
No commits in common. "15ac78b26af4c9e54e2d30c7f1781dddf64fc6f2" and "51148ef5e21835ae16402b6ec64975efe3436301" have entirely different histories.
15ac78b26a
...
51148ef5e2
4 changed files with 10 additions and 6 deletions
|
@ -95,9 +95,10 @@ public class AICar : MonoBehaviour
|
||||||
{
|
{
|
||||||
var hasChild = false;
|
var hasChild = false;
|
||||||
var i = 0;
|
var i = 0;
|
||||||
|
GameObject test;
|
||||||
while (!hasChild)
|
while (!hasChild)
|
||||||
{
|
{
|
||||||
var test = gameObject.transform.GetChild(i).gameObject;
|
test = gameObject.transform.GetChild(i).gameObject;
|
||||||
if (test.name == "Target")
|
if (test.name == "Target")
|
||||||
{
|
{
|
||||||
_driveTarget = test.transform;
|
_driveTarget = test.transform;
|
||||||
|
|
|
@ -67,7 +67,7 @@ public class AIManager : MonoBehaviour
|
||||||
_ais = GameObject.FindGameObjectsWithTag("AIs");
|
_ais = GameObject.FindGameObjectsWithTag("AIs");
|
||||||
if (_ais.Length < maxAI)
|
if (_ais.Length < maxAI)
|
||||||
{
|
{
|
||||||
// var instance = Instantiate(aiPrefab, gameObject.transform);
|
var instance = Instantiate(aiPrefab, gameObject.transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var i in _ais)
|
foreach (var i in _ais)
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -103,7 +102,8 @@ public class CarController : MonoBehaviour
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Steering()
|
public void Steering()
|
||||||
{
|
{
|
||||||
foreach (var wheel in wheels.Where(wheel => wheel.axel == Axel.Front))
|
foreach (var wheel in wheels)
|
||||||
|
if (wheel.axel == Axel.Front)
|
||||||
wheel.wheelCollider.steerAngle = _currentTurn;
|
wheel.wheelCollider.steerAngle = _currentTurn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,10 @@ public class Door : CommonInteractable
|
||||||
{
|
{
|
||||||
currentDuration = 0;
|
currentDuration = 0;
|
||||||
_opening = false;
|
_opening = false;
|
||||||
_isOpen = !_isOpen;
|
if (_isOpen)
|
||||||
|
_isOpen = false;
|
||||||
|
else
|
||||||
|
_isOpen = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
yield return new WaitForEndOfFrame();
|
yield return new WaitForEndOfFrame();
|
||||||
|
|
Reference in a new issue