This commit is contained in:
parent
44a2b87165
commit
8854d442f5
|
@ -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}
|
||||
|
|
|
@ -24,6 +24,7 @@ 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()
|
||||
{
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@ namespace Script.Manaegr
|
|||
|
||||
|
||||
|
||||
|
||||
public void Init()
|
||||
{
|
||||
vehicleController.maxSpeedForward = 11;
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue