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>
|
||||
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) =>
|
||||
if (Open.isOn)
|
||||
{
|
||||
Controlpoles(true);
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue