public void ShowPanel(Action act, Action act2, string message, ConfirmPanelType type = ConfirmPanelType.EventType) { base.Show(); _BackGround.raycastTarget = true; _BackGround.DOFade(0.3f, 0.3f); SetTypePanel(type, message); switch (type) { case ConfirmPanelType.WrongPanel: ErrorPanelReSelectBtn.ClickEvent -= _lastErrorEvent; ErrorPanelReSelectBtn.ClickEvent += act; ErrorPanelCancelBtn.ClickEvent -= _lastErrorCancelEvent; ErrorPanelCancelBtn.ClickEvent += act2; _lastErrorEvent = act; _lastErrorCancelEvent = act2; break; default: _ConfrimBtn.ClickEvent -= _lastEvent; _ConfrimBtn.ClickEvent += act; _CancelBtn.ClickEvent -= _lastCancelEvent; _CancelBtn.ClickEvent += act2; _lastEvent = act; _lastCancelEvent = act2; break; } GameObject.SetActive(true); }
private void SetTypePanel(ConfirmPanelType type, string message) { switch (type) { case ConfirmPanelType.EventType: Collector.Get <GameObject>("EventPanel").transform.localPosition = _EndPos; _EndPos = Vector3.zero; Collector.Get <GameObject>("EventPanel").GetComponent <UIWindow>().ShowWindow(); Collector.Get <GameObject>("EventPanel").GetComponentInChildren <TMPro.TMP_Text>().text = message; break; case ConfirmPanelType.CompeletePanel: Collector.Get <GameObject>("CompeletePanel").transform.localPosition = _EndPos; _EndPos = Vector3.zero; Collector.Get <GameObject>("CompeletePanel").GetComponentInChildren <TMPro.TMP_Text>().text = message; Collector.Get <GameObject>("CompeletePanel").GetComponent <UIWindow>().ShowWindow(); break; case ConfirmPanelType.WrongPanel: Collector.Get <GameObject>("ErrorPanel").transform.localPosition = _EndPos; _EndPos = Vector3.zero; Collector.Get <GameObject>("ErrorPanel").GetComponent <UIWindow>().ShowWindow(); break; } }
public void ShowPanel(Action act, string message, ConfirmPanelType type = ConfirmPanelType.EventType) { base.Show(); _BackGround.raycastTarget = true; _BackGround.DOFade(0.3f, 0.3f); SetTypePanel(type, message); _ConfrimBtn.ClickEvent -= _lastEvent; _ConfrimBtn.ClickEvent += act; _lastEvent = act; GameObject.SetActive(true); }