public void ShowAlert(string title, string message, string[] buttonNames, AlertButtonTappedDelegate alertButtonDelegate) { this.alertButtonDelegate = alertButtonDelegate; Debug.Log("Show alert: " + title); Clean(); this.title.text = title; this.message.text = message; for (int i = 0; i < buttonNames.Length; i++) { Button copy = Instantiate <Button>(buttonPrototype); copy.transform.SetParent(buttonPrototype.transform.parent, false); copy.GetComponentInChildren <Text>().text = buttonNames[i]; copy.gameObject.SetActive(true); this.buttons.Add(copy); } alertViewCanvasGroup.alpha = 1f; alertViewCanvasGroup.interactable = true; alertViewCanvasGroup.blocksRaycasts = true; audioSource.Play(); alertRect.DOKill(); alertRect.DOScale(Vector3.one, 0.3f).SetEase(Ease.OutBack); ViewWillAppear(); SetVisible(true); ViewAppeared(); }
public void Hide(System.Action OnAnimationFinished = null) { alertViewCanvasGroup.alpha = 0; alertViewCanvasGroup.interactable = false; alertViewCanvasGroup.blocksRaycasts = false; ViewWillDissappear(); SetVisible(false); ViewDisappeared(); if (OnAnimationFinished != null) { OnAnimationFinished(); } alertButtonDelegate = null; }
public void Hide(System.Action OnAnimationFinished = null) { alertRect.DOScale(new Vector3(0.01f, 0.01f, 0.01f), 0.1f).OnComplete(delegate() { alertViewCanvasGroup.alpha = 0; alertViewCanvasGroup.interactable = false; alertViewCanvasGroup.blocksRaycasts = false; ViewWillDissappear(); SetVisible(false); ViewDisappeared(); if (OnAnimationFinished != null) { OnAnimationFinished(); } alertButtonDelegate = null; }); }
public void ShowAlert(string title, string message, string[] buttonNames, AlertButtonTappedDelegate alertButtonDelegate) { Debug.Log($"Show alert: {title}"); this.alertButtonDelegate = alertButtonDelegate; activityView.SetActive(false); Debug.Log("Show alert: " + title); Clean(); this.title.text = title; this.message.text = message; for (int i = 0; i < buttonNames.Length; i++) { Button copy = Instantiate <Button>(buttonPrototype); copy.transform.SetParent(buttonPrototype.transform.parent, false); copy.GetComponentInChildren <Text>().text = buttonNames[i]; copy.gameObject.SetActive(true); this.buttons.Add(copy); } if (rebuildLayoutCoroutine != null) { StopCoroutine(rebuildLayoutCoroutine); } alertViewCanvasGroup.alpha = 1f; alertViewCanvasGroup.interactable = true; alertViewCanvasGroup.blocksRaycasts = true; ViewWillAppear(); SetVisible(true); ViewAppeared(); }
public void ShowNoConnectionAlert(string[] buttonNames, AlertButtonTappedDelegate tappedDelegate) { ModalView.instance.ShowAlert("Connection Error", "We can’t seem to connect you to the game. Please check your connection and try again.", buttonNames, tappedDelegate); }