示例#1
0
    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);
    }
示例#2
0
    void NextCommand(CustomGraphicEvent eventdata)
    {
        int i = 0;

        foreach (var act in eventdata.Actions)
        {
            print("Action:" + act);
            foreach (var Group in Commands)
            {
                if (act.ToLower() == Group.CloseTag.ToLower())
                {
                    Group.ActiveTag = Group.CloseTag;
                    ClearGrouping(Group);
                }
                else
                {
                    foreach (var command in Group.Details)
                    {
                        if (act.ToLower() == command.Tag.ToLower())
                        {
                            Group.ActiveTag = command.Tag;
                            ClearGrouping(Group, command.Tag);
                            print(command.Tag.ToLower());
                            SendCommand(command);
                            break;
                        }
                    }
                }
            }

            ++i;
        }
    }
    void NextCell(CustomGraphicEvent eventdata)
    {
        if (eventdata.ContainsAct(NextCellCall) && CellCount < Cells.Length)
        {
            CellCount += 1;
        }

        if (CellCount != CurrentCount)
        {
            StartCoroutine(CrossFade(Cells[CellCount]));
            CurrentCount += 1;
        }
    }