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 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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -96,10 +96,7 @@ private IEnumerator OpenDoor()
|
|||
{
|
||||
currentDuration = 0;
|
||||
_opening = false;
|
||||
if (_isOpen)
|
||||
_isOpen = false;
|
||||
else
|
||||
_isOpen = true;
|
||||
_isOpen = !_isOpen;
|
||||
}
|
||||
|
||||
yield return new WaitForEndOfFrame();
|
||||
|
|
Reference in a new issue