public override void SetData(params object[] paramsObjects) { StoryModel model = RegisterModel <StoryModel>(); model.Reset(); //这里还要赋值StoryType if (paramsObjects[0] is LevelVo) { model.Level = (LevelVo)paramsObjects[0]; _storyId = model.Level.StoryId; model.StoryType = StoryType.MainStory; } else if (paramsObjects[0] is AppointmentGateRuleVo) { //约会的关卡。 var gate = (AppointmentGateRuleVo)paramsObjects[0]; int appointmentid = (int)paramsObjects[1]; _storyId = gate.SceneId; Debug.Log(gate.Gate + " " + _storyId); _appointmentData = new[] { gate.Gate, appointmentid }; model.StoryType = StoryType.LoveAppointment; } else if (paramsObjects[0] is VisitLevelVo) { VisitLevelVo vo = (VisitLevelVo)paramsObjects[0]; model.VisitLevel = vo; _storyId = vo.StoryId; model.StoryType = StoryType.Visit; } else if (paramsObjects[0] is ActivityPlotRulePB) { ActivityPlotRulePB capsuleStoryRule = (ActivityPlotRulePB)paramsObjects[0]; _storyId = capsuleStoryRule.PlotId; //_storyId = "24-10"; model.StoryType = StoryType.ActivityCapsule; } else { _storyId = (string)paramsObjects[0]; if (_storyId == "0-1") { model.StoryType = StoryType.CreateUser; } } }
private IEnumerator ChangeStateCoroutine(GameState newState) { switch (state) { case GameState.Menu: { MenuUI.GetComponent <CanvasGroup>().interactable = false; yield return(StartCoroutine(Fade(MenuFade, MenuFade.color, Color.black))); MenuUI.SetActive(false); MenuCamera.enabled = false; break; } case GameState.SelectWeapon: { SelectionUI.GetComponent <CanvasGroup>().interactable = false; yield return(StartCoroutine(Fade(SelectionFade, SelectionFade.color, Color.black))); SelectionUI.SetActive(false); SelectionCamera.enabled = false; break; } case GameState.InGame: { // Game doesn't really need, may delete GameUI.GetComponent <CanvasGroup>().interactable = false; yield return(StartCoroutine(Fade(GameFade, GameFade.color, Color.black))); GameUI.SetActive(false); GameCamera.enabled = false; break; } case GameState.End: { yield return(StartCoroutine(Fade(EndFade, EndFade.color, Color.black))); EndCamera.enabled = false; storyModel.Reset(); break; } } state = newState; Color clear = new Color(0, 0, 0, 0); switch (state) { case GameState.Menu: { MenuCamera.enabled = true; yield return(StartCoroutine(Fade(MenuFade, MenuFade.color, clear))); MenuUI.SetActive(true); MenuUI.GetComponent <CanvasGroup>().interactable = true; Cursor.lockState = CursorLockMode.None; Cursor.visible = true; //storyMode = false; only 1 mode break; } case GameState.SelectWeapon: { SelectionCamera.enabled = true; yield return(StartCoroutine(Fade(SelectionFade, SelectionFade.color, clear))); SelectionUI.SetActive(true); SelectionUI.GetComponent <CanvasGroup>().interactable = true; if (storyMode) { storyView.SetEntry(storyModel.GetCurrentNarration()); selectionView.Unlock(storyModel.GetChapter()); } Cursor.lockState = CursorLockMode.None; Cursor.visible = true; break; } case GameState.InGame: { GameCamera.enabled = true; yield return(StartCoroutine(Fade(GameFade, GameFade.color, clear))); GameUI.SetActive(true); GameUI.GetComponent <CanvasGroup>().interactable = true; Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; playing = true; break; } case GameState.End: { EndCamera.enabled = true; yield return(StartCoroutine(Fade(EndFade, EndFade.color, clear))); StartCoroutine(WaitTillReadEnd()); break; } } }