diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index f9525cb..13465fc 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -815,9 +815,9 @@ MonoBehaviour: m_OnClick: m_PersistentCalls: m_Calls: - - m_Target: {fileID: 1703079399} - m_TargetAssemblyTypeName: LobbyUI, Assembly-CSharp - m_MethodName: Go_Home + - m_Target: {fileID: 2013608479} + m_TargetAssemblyTypeName: GachaUI, Assembly-CSharp + m_MethodName: OnClick_Close m_Mode: 1 m_Arguments: m_ObjectArgument: {fileID: 0} diff --git a/Assets/Scripts/UI/GachaUI.cs b/Assets/Scripts/UI/GachaUI.cs index 609aca6..4c5151d 100644 --- a/Assets/Scripts/UI/GachaUI.cs +++ b/Assets/Scripts/UI/GachaUI.cs @@ -54,8 +54,6 @@ public class GachaUI : uScrollViewMgr Set_UI(false); Init_GachaAnim(); Set_Video(); - - } void Set_UI(bool updateSlider) @@ -333,18 +331,27 @@ public class GachaUI : uScrollViewMgr Application.OpenURL("https://mergehero.notion.site/2cce9deec1718075a553d4f9012e538a"); } + public void OnClick_Close() + { + Set_Video(() => + { + LobbyUI.Ins.Go_Home(); + gameObject.SetActive(false); + }); + } + #region 동영상 public RawImage rawImage; public VideoPlayer videoPlayer; public GameObject[] gos_off_isPlaying; - void Set_Video() + void Set_Video(Action end = null) { - StartCoroutine(PrepareVideo()); + StartCoroutine(PrepareVideo(end)); } // 1. 비디오 준비 및 첫 프레임 보여주기 - IEnumerator PrepareVideo() + IEnumerator PrepareVideo(Action end = null) { videoPlayer.Prepare(); @@ -361,8 +368,13 @@ public class GachaUI : uScrollViewMgr // 1프레임만 기다림 (화면에 그려질 시간 확보) yield return null; + videoPlayer.frame = 0; videoPlayer.Pause(); videoPlayer.time = 0; // 혹시 시간이 흘렀다면 0초로 강제 고정 + + yield return null; + yield return null; + end?.Invoke(); } // 2. 외부에서 이 함수를 호출하여 재생 시작