This commit is contained in:
lujiajian 2025-02-17 18:00:23 +08:00
parent 29265515cb
commit c7b3b1bd76
4 changed files with 70370 additions and 49630 deletions

File diff suppressed because it is too large Load Diff

View File

@ -25,6 +25,10 @@ public class ControlStopCar : MonoBehaviour
/// ºìÂ̵ÆÊÓ½Ç
/// </summary>
public Transform LightPos;
/// <summary>
/// 语音按钮
/// </summary>
public Button Audiosbt;
private void Awake()
{
instance = this;
@ -33,12 +37,19 @@ public class ControlStopCar : MonoBehaviour
{
Open.onValueChanged.AddListener((a) =>
{
Controlpoles(false);
});
Close.onValueChanged.AddListener((a) =>
{
Controlpoles(true);
if (Open.isOn)
{
Open.interactable = false;
Controlpoles(false);
Audiosbt.interactable = false;
}
});
//Close.onValueChanged.AddListener((a) =>
//{
// Open.interactable = false;
// Controlpoles(true);
//});
}
public void SetPostLight(Transform pos)
@ -62,7 +73,6 @@ public class ControlStopCar : MonoBehaviour
}
else
{
Parkingpoles.GetComponent<BoxCollider>().enabled = false;
Parkingpoles.DOLocalRotateQuaternion(Quaternion.Euler(-90, -90, 0), 1);
}
@ -70,15 +80,23 @@ public class ControlStopCar : MonoBehaviour
public void AudiosTalk(string talk)
{
if (talk == "关闭闸门")
{
Close.isOn = true;
Controlpoles(false);
}
else if (talk == "开启闸门")
//if (talk == "关闭闸门")
//{
// Open.interactable = true;
// Close.interactable = true;
// Close.isOn = true;
// Controlpoles(false);
//}
if (talk == "开启闸门")
{
Open.interactable = true;
Open.isOn = true;
Controlpoles(false);
}
else if (talk != "开启闸门")
{
Open.interactable = true;
Close.interactable = true;
}
}
}

View File

@ -24,7 +24,7 @@ public class Controldrivers : MonoBehaviour
{
if (x <= 30 && x > -30)
{
x -= 5;
x -= 10;
carcameras.localRotation = (Quaternion.Euler(x, y, 0));
}
}
@ -32,7 +32,7 @@ public class Controldrivers : MonoBehaviour
{
if (x < 30 && x >= -30)
{
x += 5;
x += 10;
carcameras.localRotation = Quaternion.Euler(x, y, 0);
}
}
@ -40,7 +40,7 @@ public class Controldrivers : MonoBehaviour
{
if (y <= 140 && y > 40)
{
y -= 5;
y -= 10;
carcameras.localRotation = Quaternion.Euler(x, y, 0);
}
}
@ -48,7 +48,7 @@ public class Controldrivers : MonoBehaviour
{
if (y < 140 && y >= 40)
{
y += 5;
y += 10;
carcameras.localRotation = Quaternion.Euler(x, y, 0);
}
}

View File

@ -12,7 +12,9 @@ public class StopCarTrigger : MonoBehaviour
if (other.CompareTag("Car"))
{
ControlStopCar.instance.Controlpoles(true);
ControlStopCar.instance.Close.isOn = true;
ControlStopCar.instance.Open.isOn = false;
ControlStopCar.instance.Open.interactable = true;
ControlStopCar.instance.Audiosbt.interactable = true;
}
}
}