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); } }
public override void Enter() { base.Enter(); if (IsBattleOver()) { if (DidPlayerWin()) { data = Resources.Load <ConvoData>("Convo/" + owner.outroWinScene); } else { data = Resources.Load <ConvoData>("Convo/" + owner.outroLoseScene); } } else { data = Resources.Load <ConvoData>("Convo/" + owner.introScene); } ConvoController.Show(data); }
public void DrawUICamCompOptions(ConvoData nodeConvodata) { //DRAW CAMERASHOT SELECTOR -- SAME CODE IN DIALOGUE EditorGUILayout.LabelField("Shot Composition", labelStyleHead_Panel); EditorGUILayout.Space(); //DRAW CAMERASHOT SELECTOR -- SAME CODE IN DIALOGUE List <string> options_Type = runtime_manager.CameraOptions_Type; List <string> options_Distance = runtime_manager.CameraOptions_Distance; List <string> options_Angle = runtime_manager.CameraOptions_Angle; int index_type = options_Type.IndexOf(nodeConvodata.camerashot.goal_type); int index_dist = options_Distance.IndexOf(nodeConvodata.camerashot.goal_dist); int index_angle = options_Angle.IndexOf(nodeConvodata.camerashot.goal_angle); //DROPDOWN FOR TYPE EditorGUILayout.LabelField("Type", inspectorText, GUILayout.Width(50)); GUILayout.BeginHorizontal("box"); index_type = EditorGUILayout.Popup(index_type, options_Type.ToArray(), GUILayout.Width(140)); //check if it's been updated if (nodeConvodata.camerashot.goal_type != options_Type[index_type]) { nodeConvodata.camerashot.updateType(options_Type[index_type]); } //If it's Exterior or Apex if (options_Type[index_type] == "OverShoulder" || options_Type[index_type] == "FrameShare") { //Generate List Except of actor associated with node List <string> tmp = new List <string>(); tmp.AddRange(runtime_manager.GetActorStringOptions()); tmp.Remove(nodeConvodata.Actor.ActorName); int OppActorIndex = tmp.IndexOf(nodeConvodata.camerashot.oppositeActor); if (OppActorIndex == -1) { OppActorIndex = 0; } if (tmp.Count > 0) { OppActorIndex = EditorGUILayout.Popup(OppActorIndex, tmp.ToArray(), GUILayout.Width(70)); nodeConvodata.camerashot.oppositeActor = tmp[OppActorIndex]; } } GUILayout.EndHorizontal(); //DROPDOWN FOR DISTANCE EditorGUILayout.LabelField("Distance", inspectorText, GUILayout.Width(50)); GUILayout.BeginHorizontal("box"); index_dist = EditorGUILayout.Popup(index_dist, options_Distance.ToArray(), GUILayout.Width(140)); //check if it's been updated if (nodeConvodata.camerashot.goal_dist != options_Distance[index_dist]) { nodeConvodata.camerashot.updateDist(options_Distance[index_dist]); } GUILayout.EndHorizontal(); //DROPDOWN FOR ANGLE EditorGUILayout.LabelField("Y Angle", inspectorText, GUILayout.Width(50)); GUILayout.BeginHorizontal("box"); index_angle = EditorGUILayout.Popup(index_angle, options_Angle.ToArray(), GUILayout.Width(140)); //check if it's been updated if (nodeConvodata.camerashot.goal_angle != options_Angle[index_angle]) { nodeConvodata.camerashot.updateAngle(options_Angle[index_angle]); } GUILayout.EndHorizontal(); }
public void Show(ConvoData data) { canvas.gameObject.SetActive(true); Convo = Sequence(data); Convo.MoveNext(); }