This commit is contained in:
parent
29265515cb
commit
c7b3b1bd76
File diff suppressed because it is too large
Load Diff
|
@ -25,6 +25,10 @@ public class ControlStopCar : MonoBehaviour
|
||||||
/// ºìÂ̵ÆÊÓ½Ç
|
/// ºìÂ̵ÆÊÓ½Ç
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Transform LightPos;
|
public Transform LightPos;
|
||||||
|
/// <summary>
|
||||||
|
/// 语音按钮
|
||||||
|
/// </summary>
|
||||||
|
public Button Audiosbt;
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
instance = this;
|
instance = this;
|
||||||
|
@ -33,12 +37,19 @@ public class ControlStopCar : MonoBehaviour
|
||||||
{
|
{
|
||||||
Open.onValueChanged.AddListener((a) =>
|
Open.onValueChanged.AddListener((a) =>
|
||||||
{
|
{
|
||||||
Controlpoles(false);
|
if (Open.isOn)
|
||||||
});
|
{
|
||||||
Close.onValueChanged.AddListener((a) =>
|
Open.interactable = false;
|
||||||
{
|
Controlpoles(false);
|
||||||
Controlpoles(true);
|
Audiosbt.interactable = false;
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
//Close.onValueChanged.AddListener((a) =>
|
||||||
|
//{
|
||||||
|
// Open.interactable = false;
|
||||||
|
// Controlpoles(true);
|
||||||
|
//});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetPostLight(Transform pos)
|
public void SetPostLight(Transform pos)
|
||||||
|
@ -62,7 +73,6 @@ public class ControlStopCar : MonoBehaviour
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
Parkingpoles.GetComponent<BoxCollider>().enabled = false;
|
Parkingpoles.GetComponent<BoxCollider>().enabled = false;
|
||||||
Parkingpoles.DOLocalRotateQuaternion(Quaternion.Euler(-90, -90, 0), 1);
|
Parkingpoles.DOLocalRotateQuaternion(Quaternion.Euler(-90, -90, 0), 1);
|
||||||
}
|
}
|
||||||
|
@ -70,15 +80,23 @@ public class ControlStopCar : MonoBehaviour
|
||||||
|
|
||||||
public void AudiosTalk(string talk)
|
public void AudiosTalk(string talk)
|
||||||
{
|
{
|
||||||
if (talk == "关闭闸门")
|
//if (talk == "关闭闸门")
|
||||||
{
|
//{
|
||||||
Close.isOn = true;
|
// Open.interactable = true;
|
||||||
Controlpoles(false);
|
// Close.interactable = true;
|
||||||
}
|
// Close.isOn = true;
|
||||||
else if (talk == "开启闸门")
|
// Controlpoles(false);
|
||||||
|
//}
|
||||||
|
if (talk == "开启闸门")
|
||||||
{
|
{
|
||||||
|
Open.interactable = true;
|
||||||
Open.isOn = true;
|
Open.isOn = true;
|
||||||
Controlpoles(false);
|
Controlpoles(false);
|
||||||
}
|
}
|
||||||
|
else if (talk != "开启闸门")
|
||||||
|
{
|
||||||
|
Open.interactable = true;
|
||||||
|
Close.interactable = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ public class Controldrivers : MonoBehaviour
|
||||||
{
|
{
|
||||||
if (x <= 30 && x > -30)
|
if (x <= 30 && x > -30)
|
||||||
{
|
{
|
||||||
x -= 5;
|
x -= 10;
|
||||||
carcameras.localRotation = (Quaternion.Euler(x, y, 0));
|
carcameras.localRotation = (Quaternion.Euler(x, y, 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ public class Controldrivers : MonoBehaviour
|
||||||
{
|
{
|
||||||
if (x < 30 && x >= -30)
|
if (x < 30 && x >= -30)
|
||||||
{
|
{
|
||||||
x += 5;
|
x += 10;
|
||||||
carcameras.localRotation = Quaternion.Euler(x, y, 0);
|
carcameras.localRotation = Quaternion.Euler(x, y, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ public class Controldrivers : MonoBehaviour
|
||||||
{
|
{
|
||||||
if (y <= 140 && y > 40)
|
if (y <= 140 && y > 40)
|
||||||
{
|
{
|
||||||
y -= 5;
|
y -= 10;
|
||||||
carcameras.localRotation = Quaternion.Euler(x, y, 0);
|
carcameras.localRotation = Quaternion.Euler(x, y, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ public class Controldrivers : MonoBehaviour
|
||||||
{
|
{
|
||||||
if (y < 140 && y >= 40)
|
if (y < 140 && y >= 40)
|
||||||
{
|
{
|
||||||
y += 5;
|
y += 10;
|
||||||
carcameras.localRotation = Quaternion.Euler(x, y, 0);
|
carcameras.localRotation = Quaternion.Euler(x, y, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,9 @@ public class StopCarTrigger : MonoBehaviour
|
||||||
if (other.CompareTag("Car"))
|
if (other.CompareTag("Car"))
|
||||||
{
|
{
|
||||||
ControlStopCar.instance.Controlpoles(true);
|
ControlStopCar.instance.Controlpoles(true);
|
||||||
ControlStopCar.instance.Close.isOn = true;
|
ControlStopCar.instance.Open.isOn = false;
|
||||||
|
ControlStopCar.instance.Open.interactable = true;
|
||||||
|
ControlStopCar.instance.Audiosbt.interactable = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue