//Temp public StoryActionContainer GetStory(string labelId) { StoryActionContainer container = new StoryActionContainer(); StoryVirtualMachine.Instance.SetStoryActionContainer(container); // container.PushPicture("Role_Heroine",150,150); // container.PushWaiting(1); // container.PushPicture("Role_Heroine",180,150); // container.PushWaiting(1); // container.PushPicMove("Role_Heroine",180,150,120,170,Ease.Linear,3); // container.PushWaiting(2); // container.PushPicMove("Role_Heroine",150,170,190,170,Ease.Linear,2); // container.PushWaiting(1); // container.PushPicMove("Characters_Vera_Confusion",190,150,130,150,Ease.Linear,3); // container.PushWaiting(1); // container.PushPicture("Role_Heroine",100,100); // container.PushWaiting(100); // // return 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()); m_storys.NextStory(); break; case StoryReader.NodeType.jump: container.PushJump(m_storys.GetJump()); // m_storys.NextStory (); //Test return(container); break; case StoryReader.NodeType.label: //m_storys.NextStory (); m_storys.NextStory(); break; break; case StoryReader.NodeType.end: m_storys.NextStory(); return(container); break; case StoryReader.NodeType.exhibit: container.PushShowEvidence(m_storys.GetExhibit(), m_storys.GetExhibitPrefix()); m_storys.NextStory(); //return container; break; case StoryReader.NodeType.raiseEvent: string eventName = m_storys.GetEventName(); switch (m_storys.GetEventType()) { case StoryReader.EventType.loadScene: container.PushLoadGameScene(eventName); break; case StoryReader.EventType.loadMission: MissionEnum needLoadMission = MissionSceneManager.Instance.GetMissionEnumBy(eventName, false); if (needLoadMission == MissionEnum.None) { Debug.LogError(eventName + " is not exist."); } else { container.LoadMission(needLoadMission); } break; case StoryReader.EventType.invokeEvent: container.TriggerEvent(new StarPlatinum.EventManager.RaiseEvent( StoryReader.EventType.invokeEvent, eventName)); break; case StoryReader.EventType.playAnimation: container.PlayAnimation(eventName); break; case StoryReader.EventType.LoadBackground: container.ChangeBackground(eventName); break; default: break; } m_storys.NextStory(); break; default: Debug.LogError("Unknown Node Type"); break; } } return(container); }
public StoryActionContainer GetStory(string labelId) { StoryActionContainer container = new StoryActionContainer(); StoryVirtualMachine.Instance.SetStoryActionContainer(container); 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); } while (!m_storys.IsDone()) { switch (m_storys.GetNodeType()) { case StoryReader.NodeType.word: container.PushName(m_storys.GetName()); StoryVirtualMachine.Instance.Run(m_storys.GetContent()); m_storys.NextStory(); break; case StoryReader.NodeType.jump: container.PushJump(m_storys.GetJump()); // m_storys.NextStory (); //Test return(container); break; case StoryReader.NodeType.label: //m_storys.NextStory (); m_storys.NextStory(); break; break; case StoryReader.NodeType.end: m_storys.NextStory(); return(container); break; case StoryReader.NodeType.exhibit: container.PushShowEvidence(m_storys.GetExhibit(), m_storys.GetExhibitPrefix()); m_storys.NextStory(); //return container; break; case StoryReader.NodeType.raiseEvent: string eventName = m_storys.GetEventName(); switch (m_storys.GetEventType()) { case StoryReader.EventType.loadScene: container.PushLoadGameScene(eventName); break; case StoryReader.EventType.loadMission: { MissionEnum needLoadMission = MissionSceneManager.Instance.GetMissionEnumBy(eventName, false); if (needLoadMission == MissionEnum.None) { Debug.LogError(eventName + " is not exist."); } container.LoadMission(needLoadMission); //m_storys.NextStory(); //return container; } break; case StoryReader.EventType.LoadCgScene: container.LoadCGScene(eventName); break; case StoryReader.EventType.CloseCgScene: container.CloseCGScene(eventName); break; case StoryReader.EventType.LoadControversy: container.PushEnterControversy(eventName); break; case StoryReader.EventType.PlayCutIn: container.PushCutIn(eventName); break; case StoryReader.EventType.invokeEvent: container.TriggerEvent(new StarPlatinum.EventManager.RaiseEvent( StoryReader.EventType.invokeEvent, eventName)); break; case StoryReader.EventType.playAnimation: container.PlayAnimation(eventName); break; case StoryReader.EventType.LoadBackground: container.ChangeBackground(eventName); break; default: break; } m_storys.NextStory(); break; default: Debug.LogError("Unknown Node Type"); break; } } return(container); }
public StoryActionContainer GetStory(string labelId) { StoryActionContainer container = new StoryActionContainer(); StoryVirtualMachine.Instance.SetStoryActionContainer(container); 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 (!IsLabelRead(labelId)) { AddReadLabel(labelId); } // container.PushChangePanelType(1); // container.PushJump(new List<Option>(){new Option("1","这是一个不知道什么内容的选项"),new Option("2","这是一个不知道什么内容的选项")}); // container.PushFrontImg("MG_TalkType1_TalkBGVignetee"); while (!m_storys.IsDone()) { switch (m_storys.GetNodeType()) { case StoryReader.NodeType.word: container.PushName(m_storys.GetName()); StoryVirtualMachine.Instance.Run(m_storys.GetContent()); m_storys.NextStory(); break; case StoryReader.NodeType.jump: container.PushJump(m_storys.GetJump()); // m_storys.NextStory (); //Test return(container); break; case StoryReader.NodeType.label: //m_storys.NextStory (); m_storys.NextStory(); break; case StoryReader.NodeType.end: m_storys.NextStory(); return(container); break; case StoryReader.NodeType.exhibit: container.PushShowEvidence(m_storys.GetExhibit(), m_storys.GetExhibitPrefix()); m_storys.NextStory(); //return container; break; case StoryReader.NodeType.raiseEvent: string eventName = m_storys.GetEventName(); switch (m_storys.GetEventType()) { case StoryReader.EventType.loadScene: container.PushLoadGameScene(eventName); break; case StoryReader.EventType.loadMission: { MissionEnum needLoadMission = MissionSceneManager.Instance.GetMissionEnumBy(eventName, false); if (needLoadMission == MissionEnum.None) { Debug.LogError(eventName + " is not exist."); } container.LoadMission(needLoadMission); //m_storys.NextStory(); //return container; } break; case StoryReader.EventType.LoadCgScene: container.LoadCGScene(eventName); break; case StoryReader.EventType.CloseCgScene: container.CloseCGScene(eventName); break; case StoryReader.EventType.LoadControversy: container.PushEnterControversy(eventName); break; case StoryReader.EventType.PlayCutIn: container.PushCutIn(eventName); break; case StoryReader.EventType.PlayInteractionAnimation: string cleanItemName = eventName; if (cleanItemName.Contains("_")) { cleanItemName = eventName.Substring(0, eventName.IndexOf('_')); } container.PlayInteractionAnimation(cleanItemName); break; case StoryReader.EventType.invokeEvent: container.TriggerEvent(new StarPlatinum.EventManager.RaiseEvent( StoryReader.EventType.invokeEvent, eventName)); break; case StoryReader.EventType.playAnimation: container.PlayAnimation(eventName); break; case StoryReader.EventType.PlayTimeline: container.PushTimeLine(eventName); break; case StoryReader.EventType.LoadFrontground: container.PushFrontImg(eventName); break; case StoryReader.EventType.LoadBackground: container.ChangeBackground(eventName); break; case StoryReader.EventType.LoadSkybox: SkyboxEnum skyboxEnum = (SkyboxEnum)Enum.Parse(typeof(SkyboxEnum), eventName); container.LoadSkybox(skyboxEnum); break; case StoryReader.EventType.SwitchTalkUIType: int UIPanelType = int.Parse(eventName); container.PushChangePanelType(UIPanelType); break; case StoryReader.EventType.RemoveSpecificExhibit: container.PushRemoveEvidence(eventName); break; case StoryReader.EventType.RemoveAllExhibit: container.RemoveAllExhibit(); break; case StoryReader.EventType.GameOver: container.PushGameEvent("GameEnd"); break; default: break; } m_storys.NextStory(); break; default: Debug.LogError("Unknown Node Type"); break; } } return(container); }