IEnumerator Sequence(ConvoData data) { for (int i = 0; i < data.list.Count; ++i) { SpeakerData sd = data.list[i]; ConvoPanel currentPanel = (sd.anchor == TextAnchor.UpperLeft || sd.anchor == TextAnchor.MiddleLeft || sd.anchor == TextAnchor.LowerLeft) ? leftPanel : rightPanel; IEnumerator presenter = currentPanel.Display(sd); presenter.MoveNext(); string show, hide; if (sd.anchor == TextAnchor.UpperLeft || sd.anchor == TextAnchor.UpperCenter || sd.anchor == TextAnchor.UpperRight) { show = ShowTop; hide = HideTop; } else { show = ShowBottom; hide = HideBottom; } currentPanel.panel.SetPosition(hide, false); MovePanel(currentPanel, show); yield return(null); while (presenter.MoveNext()) { yield return(null); } MovePanel(currentPanel, hide); transition.completedEvent += delegate(object sender, EventArgs e) { Convo.MoveNext(); }; yield return(null); } canvas.gameObject.SetActive(false); if (completeEvent != null) { completeEvent(this, EventArgs.Empty); } }
void MovePanel(ConvoPanel obj, string pos) { transition = obj.panel.SetPosition(pos, true); transition.duration = 0.5f; transition.equation = EasingEquations.EaseOutQuad; }