diff --git a/Assets/Animations/MopTransition/MopTransition.controller b/Assets/Animations/MopTransition/MopTransition.controller index e0eb79c..65805d0 100644 --- a/Assets/Animations/MopTransition/MopTransition.controller +++ b/Assets/Animations/MopTransition/MopTransition.controller @@ -20,7 +20,7 @@ AnimatorStateTransition: m_TransitionDuration: 0.25 m_TransitionOffset: 0 m_ExitTime: 0.75 - m_HasExitTime: 1 + m_HasExitTime: 0 m_HasFixedDuration: 1 m_InterruptionSource: 0 m_OrderedInterruption: 1 diff --git a/Assets/Scripts/Misc/MainMenuTransitionAnimation.cs b/Assets/Scripts/Misc/MainMenuTransitionAnimation.cs index e8e21c7..045e43e 100644 --- a/Assets/Scripts/Misc/MainMenuTransitionAnimation.cs +++ b/Assets/Scripts/Misc/MainMenuTransitionAnimation.cs @@ -1,6 +1,7 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; +using UnityEngine.SceneManagement; public class MainMenuTransitionAnimation : MonoBehaviour { @@ -13,5 +14,20 @@ public class MainMenuTransitionAnimation : MonoBehaviour public void AnimationMainMenuStart() { animator.SetTrigger("Start"); + + StartCoroutine(WaitBeforeSceneChange()); + } + + private IEnumerator WaitBeforeSceneChange() + { + var animInfo = animator.GetCurrentAnimatorStateInfo(0); + while (!(animInfo.normalizedTime >= 0.99f && animInfo.IsName("MenuTransition"))) + { + animInfo = animator.GetCurrentAnimatorStateInfo(0); + yield return new WaitForSecondsRealtime(0.1f); + } + + + SceneManager.LoadScene(1); } } diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset index 5f7c784..3dde74c 100644 --- a/ProjectSettings/EditorBuildSettings.asset +++ b/ProjectSettings/EditorBuildSettings.asset @@ -6,6 +6,9 @@ EditorBuildSettings: serializedVersion: 2 m_Scenes: - enabled: 1 - path: Assets/Scenes/SampleScene.unity - guid: 8c9cfa26abfee488c85f1582747f6a02 + path: Assets/Scenes/MainMenu.unity + guid: 33b308b02cb61b643b15ad93698b00ee + - enabled: 1 + path: Assets/Scenes/Bloody Mary.unity + guid: dbc458177844bf1ceae76a97e08d3140 m_configObjects: {}