This commit is contained in:
yzx 2024-01-19 15:55:03 +08:00
parent 44a2b87165
commit 8854d442f5
10 changed files with 21 additions and 8 deletions

View File

@ -441160,8 +441160,8 @@ MonoBehaviour:
shache:
- {fileID: 469820069}
- {fileID: 1337615172}
ui3d: {fileID: 0}
ui2d: {fileID: 0}
ui3d: {fileID: 67935768}
ui2d: {fileID: 1944520099}
--- !u!1 &1276928531
GameObject:
m_ObjectHideFlags: 0
@ -457133,6 +457133,7 @@ MonoBehaviour:
mesh: {fileID: -7193705671270685957, guid: efe2b86486a526a4e809023d89746bad, type: 3}
meshFilter: {fileID: 468594977}
animator: {fileID: 34988786}
isOpen: 1
--- !u!1 &1323235811
GameObject:
m_ObjectHideFlags: 0
@ -712513,7 +712514,7 @@ PrefabInstance:
- target: {fileID: 4279975699638886894, guid: 4292160a5e1fde347934ac660b2c5d30,
type: 3}
propertyPath: m_LocalPosition.y
value: 1.313
value: 1.34
objectReference: {fileID: 0}
- target: {fileID: 4279975699638886894, guid: 4292160a5e1fde347934ac660b2c5d30,
type: 3}

View File

@ -23,7 +23,8 @@ public class AccidentManager : MonoBehaviour
public Animator animator; // 将Animator组件拖拽到这个字段
private bool isPlaying = false;
public bool isOpen = true;
public void Close()
{
for (int i = 0; i < uis.transform.Find("UI").childCount; i++)
@ -47,6 +48,10 @@ public class AccidentManager : MonoBehaviour
public async Task Tr(Transform other, bool b = false)
{
if (isOpen)
return;
triggerName = other.name;
@ -102,6 +107,8 @@ public class AccidentManager : MonoBehaviour
PlayAnimationSequence("MsgWinAnimOpen", "MsgWinAnimClose");
uis.transform.Find("UI").Find("刹车失灵").gameObject.SetActive(true);
}
}
IEnumerator dengdai()
{
@ -150,7 +157,7 @@ public class AccidentManager : MonoBehaviour
//MBOXManager.Instance.Bonk();
Tr(other.transform);
// switch (other.name)
// {
// case "刹车失灵":
@ -196,12 +203,16 @@ public class AccidentManager : MonoBehaviour
// 用于外部调用的方法,启动动画序列
public void PlayAnimationSequence(string firstAnimation, string secondAnimation)
{
Close();
if (!isPlaying)
{
Debug.Log("12312312312312312321");
StartCoroutine(PlayAnimations(firstAnimation, secondAnimation));
}
}
// 协程,按顺序播放动画,并在两个动画之间等待
@ -222,6 +233,8 @@ public class AccidentManager : MonoBehaviour
// 等待第二个动画播放完毕
yield return new WaitUntil(() => !animator.GetCurrentAnimatorStateInfo(0).IsName(secondAnimation));
yield return new WaitForSeconds(20);
isPlaying = false;
}

View File

@ -26,8 +26,7 @@ namespace Script.Manaegr
private bool isYgq = false;
public void Init()
{

View File

@ -220,7 +220,7 @@ public class SteeringWheelController : MonoBehaviour
/// 下一个按钮
/// </summary>
private void SelectNextButton()
{
{
selectedButtonIndex = (selectedButtonIndex + 1) % buttons.Length;
// Debug.Log("前进" + selectedButtonIndex);
HighlightButton(selectedButtonIndex);