using MoleMole.Config; using UnityEngine; using UnityEngine.UI; namespace MoleMole { public class DropNewItemDialogContext : BaseSequenceDialogContext { public float TimerSpan = 2f; private StorageDataItemBase _storageItem; private SequenceAnimationManager _animationManager; private bool _onlyShow; private CanvasTimer _timer; public DropNewItemDialogContext(StorageDataItemBase itemData, bool useTimer = true, bool onlyShow = false) { config = new ContextPattern { contextName = "DropNewItemDialogContext", viewPrefabPath = "UI/Menus/Dialog/NewDropItemGotDialog", cacheType = ViewCacheType.DontCache }; _storageItem = itemData; _onlyShow = onlyShow; if (useTimer) { _timer = Singleton.Instance.SceneCanvas.CreateTimer(TimerSpan, 0f); _timer.timeUpCallback = DialogEnd; _timer.StopRun(); } } protected override void BindViewCallbacks() { BindViewCallback(base.view.transform.Find("BG/Button").GetComponent