void OnDisplay(CustomGraphicEvent eventdata) { if (!Contains(eventdata.Tag)) { Debug.LogError("CG tag: " + eventdata.Tag + "is unknown. please add to CGDisplay"); return; } if (eventdata.Tag.ToLower() != ActiveCG.Tag.ToLower()) { ActiveCG = new CGDetails(); ActiveCG.Tag = eventdata.Tag; ActiveCG.Graphic = Instantiate(GetCG(ActiveCG.Tag).Graphic, transform); } StartCoroutine(TextParser.FrameDelay(ActiveCG.Graphic, Events.CG, eventdata)); if (eventdata.ContainsAct(OpenCGTag)) { Space.DispatchEvent(Events.Backdrop, new StageDirectionEvent(Room.None, "", eventdata.HasTransition())); Space.DispatchEvent(Events.CharacterCall, new CastDirectionEvent("all", "exit")); Active = true; } if (eventdata.ContainsAct(CloseCGTag)) { CloseCG(); } //ActiveCG.Graphic.DispatchEvent(Events.CG, eventdata); }
void NextCell(CustomGraphicEvent eventdata) { if (eventdata.ContainsAct(NextCellCall) && CellCount < Cells.Length) { CellCount += 1; } if (CellCount != CurrentCount) { StartCoroutine(CrossFade(Cells[CellCount])); CurrentCount += 1; } }