private IEnumerator _RiseInfopanel() { Log.Notice(scr, "Start rolling up infopanel"); RectTransform _InfopanelRectTransform = Infopanel.GetComponent <RectTransform>(); while (_InfopanelRectTransform.sizeDelta.y < UISettings.InfopanelHeight) { _InfopanelRectTransform.sizeDelta += Vector2.up * Time.deltaTime * UISettings.InfopanelScrollSpeed; _InfopanelRectTransform.anchoredPosition += Vector2.up * Time.deltaTime * UISettings.InfopanelScrollSpeed / 2; yield return(new WaitForEndOfFrame()); } if (_InfopanelRectTransform.sizeDelta.y > UISettings.InfopanelHeight) { _InfopanelRectTransform.sizeDelta = Vector2.up * UISettings.InfopanelHeight; _InfopanelRectTransform.anchoredPosition = Vector2.up * UISettings.InfopanelHeight / 2; } Log.Notice(scr, "Infopannel rolled up"); }
private IEnumerator _HideInfopanel() { Log.Notice(scr, "Start rolling back infopanel"); Frame.Destroy(); RectTransform _InfopanelRectTransform = Infopanel.GetComponent <RectTransform>(); while (_InfopanelRectTransform.rect.height > 0) { _InfopanelRectTransform.sizeDelta -= Vector2.up * Time.deltaTime * UISettings.InfopanelScrollSpeed; _InfopanelRectTransform.anchoredPosition -= Vector2.up * Time.deltaTime * UISettings.InfopanelScrollSpeed / 2; yield return(new WaitForEndOfFrame()); } if (_InfopanelRectTransform.rect.height < 0) { _InfopanelRectTransform.sizeDelta = Vector2.zero; _InfopanelRectTransform.anchoredPosition = Vector2.zero; } Log.Notice(scr, "Infopannel rolled back"); }