using System; using System.Collections; using MoleMole.Config; using UnityEngine; using UnityEngine.UI; namespace MoleMole { public class VideoDisplayDialogContext : BaseDialogContext { public enum SkipButtonState { Open = 0, Close = 1, TransitFromOpen = 2, TransitFromClose = 3 } private CgDataItem _currentCgDataItem; private MonoVideoPlayer _currentVideoPlayer; private GeneralDialogContext _currentGeneralDialog; private bool _withSkipBtn; private float _originalSkipBtnPosY; public Action SkipVideoClickedCallback; public Action SkipVideoConfirmCallback; public Action SkipVideoCancelCallback; private SkipButtonState _skipBtnState = SkipButtonState.Close; public VideoDisplayDialogContext(CgDataItem cgDataItem, MonoVideoPlayer videoPlayer, bool withSkipBtn = true) { config = new ContextPattern { contextName = "VideoDisplayDialogContext", viewPrefabPath = "UI/Menus/Dialog/VideoDisplayDialog", ignoreNotify = true }; _currentCgDataItem = cgDataItem; _currentVideoPlayer = videoPlayer; if (_currentVideoPlayer != null) { MonoVideoPlayer currentVideoPlayer = _currentVideoPlayer; currentVideoPlayer.OnVideoEnd = (Action)Delegate.Combine(currentVideoPlayer.OnVideoEnd, new Action(OnVideoEndCallback)); } _withSkipBtn = withSkipBtn; } protected override void BindViewCallbacks() { BindViewCallback(base.view.transform.Find("SkipBtn").GetComponent