Compare commits
4 commits
51148ef5e2
...
15ac78b26a
Author | SHA1 | Date | |
---|---|---|---|
Mark Joshwel | 15ac78b26a | ||
Mark Joshwel | 327d51a7e3 | ||
Mark Joshwel | e38602910d | ||
Mark Joshwel | 98b9bfae92 |
|
@ -95,10 +95,9 @@ private void Awake()
|
||||||
{
|
{
|
||||||
var hasChild = false;
|
var hasChild = false;
|
||||||
var i = 0;
|
var i = 0;
|
||||||
GameObject test;
|
|
||||||
while (!hasChild)
|
while (!hasChild)
|
||||||
{
|
{
|
||||||
test = gameObject.transform.GetChild(i).gameObject;
|
var test = gameObject.transform.GetChild(i).gameObject;
|
||||||
if (test.name == "Target")
|
if (test.name == "Target")
|
||||||
{
|
{
|
||||||
_driveTarget = test.transform;
|
_driveTarget = test.transform;
|
||||||
|
|
|
@ -67,7 +67,7 @@ private IEnumerator Manager()
|
||||||
_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,6 +6,7 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -102,9 +103,8 @@ public void Brake()
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Steering()
|
public void Steering()
|
||||||
{
|
{
|
||||||
foreach (var wheel in wheels)
|
foreach (var wheel in wheels.Where(wheel => wheel.axel == Axel.Front))
|
||||||
if (wheel.axel == Axel.Front)
|
wheel.wheelCollider.steerAngle = _currentTurn;
|
||||||
wheel.wheelCollider.steerAngle = _currentTurn;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -96,10 +96,7 @@ private IEnumerator OpenDoor()
|
||||||
{
|
{
|
||||||
currentDuration = 0;
|
currentDuration = 0;
|
||||||
_opening = false;
|
_opening = false;
|
||||||
if (_isOpen)
|
_isOpen = !_isOpen;
|
||||||
_isOpen = false;
|
|
||||||
else
|
|
||||||
_isOpen = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
yield return new WaitForEndOfFrame();
|
yield return new WaitForEndOfFrame();
|
||||||
|
|
Reference in a new issue