public IEnumerator FreshView(PopupWindowData data) { Image_Content.sprite = data.ShowSprite; var rect = gameObject.GetComponent <RectTransform>(); switch (data.Type) { case EPopupType.Act: rect.anchoredPosition = data.OffsetPos; break; case EPopupType.Item: break; } gameObject.SetActive(true); rect.sizeDelta = data.Size; yield break; }
public IEnumerator Open(PopupWindowData data) { var element = CreateWindow(); yield return(element.FreshView(data)); }