Ejemplo n.º 1
0
        //Temp
        public StoryActionContainer GetStory(string labelId)
        {
            StoryActionContainer container = new StoryActionContainer();

            StoryVirtualMachine.Instance.SetStoryActionContainer(container);

            //List<StoryBasicData> datas = m_storys.GetSotry();

            //for(int i = 0; i < datas.Count(); i++)
            //{
            //    if(datas[i].typename == StoryReader.NodeType.word.ToString())
            //    {
            //        StoryWordData data = datas[i] as StoryWordData;
            //        container.PushName(data.name);
            //        container.PushContent(data.content);
            //    }
            //    else if (datas[i].typename == StoryReader.NodeType.jump.ToString())
            //    {
            //        StoryJumpData data = datas[i] as StoryJumpData;
            //        container.PushJump(data.jump, );

            //    }
            //}
            if (m_storys == null)
            {
                Debug.LogError("Story doesn`t exist.");
                return(null);
            }

            if (!m_storys.RequestLabel(labelId))
            {
                Debug.LogError($"Label {labelId} doesn`t exist");
            }
            else
            {
                m_storys.JumpToWordAfterLabel(labelId);
            }

            if (m_storys.Chapter == "Ep2" &&
                m_storys.Scene == "Pier")
            {
                PushPicture(container, hero, heroine);
            }

            if (labelId == "Ep2_Jeep_PoliceQuestion_0")
            {
                PushPicture(container, hero, "");
            }

            if (labelId == "Ep2_Jeep_PoliceQuestion_1")
            {
                PushPicture(container, hero, "");
            }
            if (labelId == "Ep2_Jeep_PoliceQuestion_2")
            {
                PushPicture(container, hero, "");
            }
            if (labelId == "Ep2_Jeep_PoliceQuestion_4")
            {
                PushPicture(container, hero, "");
            }

            while (!m_storys.IsDone())
            {
                switch (m_storys.GetNodeType())
                {
                case StoryReader.NodeType.word:
                    container.PushName(m_storys.GetName());
                    StoryVirtualMachine.Instance.Run(m_storys.GetContent());
                    container.PushWaiting(1f);
                    m_storys.NextStory();
                    break;

                case StoryReader.NodeType.jump:
                    container.PushJump(m_storys.GetJump());
                    //						m_storys.NextStory ();
                    //Test
                    return(container);

                case StoryReader.NodeType.label:
                    //m_storys.NextStory ();
                    m_storys.NextStory();
                    break;

                default:
                    break;
                }
            }


            return(container);
        }