public RelationshipSceneInputState(BaseManager baseManager, CutScene relationshipScene, CutsceneController dialogPanel) : base(baseManager) { this.relationshipScene = relationshipScene; this.dialogPanel = dialogPanel; }
/// <summary> /// 1. if newTr doesn't have CutsceneController attached, then do nothing /// 2. set the m_evtGoRoot for the new clipRoot /// </summary> private void _OnRootTransformChange(Transform oldTr, Transform newTr) { //Dbg.Log("RootGO changed: {0}", newTr == null ? "null" : newTr.name); m_evtGoRoot = null; //reset first, will be set to non-null value if needed m_ClipRoot = newTr; if (newTr != null) { //1. m_CC = newTr.GetComponent <CutsceneController>(); if (m_CC != null) { //2. GameObject eventGO = Misc.ForceGetGO(EventGOS, m_ClipRoot.gameObject); Dbg.Assert(eventGO != null, "CCEditor._OnRootTransformChange: failed to force_get eventGO: {0}", EventGOS); m_evtGoRoot = eventGO.transform; } else { } } Repaint(); }
/// <summary> /// undo all replace operations /// </summary> public static void UndoAllReplace(CutsceneController cc) { for (var ie = cc.m_ReplRecord.GetEnumerator(); ie.MoveNext();) { var pr = ie.Current; GameObject extGO = pr.Key; //Transform extTr = extGO.transform; ReplData rData = pr.Value; //Dbg.Log("Undo Replace: extGO: {0}", rData.m_ExtGOOrigName); //1 extGO.name = rData.m_ExtGOOrigName; //3 if (rData.m_ExtGOOrigParent) { Misc.AddChild(rData.m_ExtGOOrigParent, extGO); } else { extGO.transform.parent = null; } //2 if (rData.m_RevertPose) { _ExecuteRevertPose(rData); } //4 if (rData.m_IntGO) { if (cc.m_BlendOutTime < 0) { rData.m_IntGO.SetActive(true); } rData.m_IntGO.name = rData.m_IntGO.name.Substring(1); } //5 if (rData.m_ReEnableAnimator) { _SetAnimatorEnableState(extGO, true); } //6. prepare blend-out if (cc.m_BlendOutTime >= 0) { BlendOutData boData = new BlendOutData(); boData.m_InternalGO = rData.m_IntGO; cc.m_BlendOutCtrl[extGO] = boData; cc._PrepareBlend(extGO.transform, boData.m_BlendDataLst); } } cc.m_ReplRecord.Clear(); cc.m_ToSwapObjPairs.Clear(); }
private void pause() { isPaused = true; enableGuiControl(); BattleController temp = GameObject.Find("Scripts").GetComponent <BattleController>(); if (temp && temp.battleEnabled) { temp.PauseBattle(); battleWasPaused = true; } CutsceneController cc = GameObject.Find("Scripts").GetComponent <CutsceneController>(); if (cc) { cc.pauseDialog = true; } if (mus) { mus.Pause(); } Time.timeScale = 0; }
/// <summary> /// start the cutscene /// </summary> public static void StartCC(CutsceneController cc) { if (!cc.gameObject.activeSelf) { cc.gameObject.SetActive(true); } Transform cctr = cc.transform; var toSwapLst = cc.m_ToSwapObjPairs; //1. add data from user-setting for (int idx = 0; idx < cc.m_ToSwapObjTrPaths.Count; ++idx) { toSwapLst.Add(cc.m_ToSwapObjTrPaths[idx].Convert(cctr)); } //2. execute swap for (int idx = 0; idx < toSwapLst.Count; ++idx) { var pr = toSwapLst[idx]; var extGO = pr.m_ExternalGO; var intGO = pr.m_InternalGO; cc.SwapGO(extGO, intGO, pr.m_RevertPose, pr.m_ReEnableAnimator); } cc.m_BlendOutElapsedTime = 0; cc.m_Anim.Play(); cc.m_StartFrameNumber = Time.frameCount; }
public override IEnumerator ExecuteAction(CutsceneController controller, bool playNextNode = true) { Skill skill = Globals.campaign.contentLibrary.skillDatabase.GetData(skillEffect); yield return(controller.StartCoroutine(PlayAnimations(skill, controller, playNextNode))); }
public CutsceneDialoguInput(CutsceneController controller, CutScene currentScene, CutSceneAction currentAction) { csController = controller; this.scene = currentScene; this.action = currentAction; }
// public method public override void OnAnimEvent() { AnimationState animState = CutsceneController.GetAnimState(m_CC); //Dbg.Log("JumpTo.OnAnimEvent: current time: {0}, FC: {1}", animState.time, Time.frameCount); switch (m_kType) { case JumpType.Time: { CutsceneController.JumpToTime(m_CC, m_time); //Dbg.Log("Jumpto: {0}", m_time); } break; case JumpType.NormalizedTime: { //animState.normalizedTime = m_time; CutsceneController.JumpToTime(m_CC, m_time * animState.clip.length); //Dbg.Log("Jumpto normalized: {0} : {1}", m_time, m_time * animState.clip.length); } break; case JumpType.TimeTag: { CutsceneController.JumpToTimeTag(m_CC, m_timeTag); //Dbg.Log("Jumpto tag: {0}", CutsceneController.GetTimeByTag(m_CC, m_timeTag)); } break; default: Dbg.LogErr("CC_JumpTo.OnAnimEvent: unexpected JumpType: {0}", m_kType); break; } }
void SetTimeline(string sceneName) { if (curLevel != 0) { cutsceneController = GameObject.Find("Timeline").GetComponent <CutsceneController>(); } }
IEnumerator PlayAnimations(Skill skill, CutsceneController controller, bool playNext) { int count = skill.animControllerID.Count; int curr = 0; foreach (string item in skill.GetAnimControllerID()) { curr++; AnimationObject animation = Globals.GenerateAnimationObject(item, spawnPosition, destposition); animation.transform.SetParent(controller.spawnPoint); controller.skillObjects.Add(animation); if (curr == count & playNext) { animation.AnimationObjectDestroyed += controller.NextNode; } animation.InitAnimatorObject(item, destposition.X, destposition.Y, false, null); SFXController.sfxInstance.ChangeSong(skill.GetSFXKey()); yield return(new WaitForSeconds(0.5f)); } }
private void _ExecuteBlendOut(CutsceneController cc) { if (!_IsAnimStopped(cc)) { return; } if (m_BlendOutElapsedTime > m_BlendOutTime) { //if no blend-out, m_BlendOutTime will be negative, so _ExecuteEndAction will be executed no matter we have blend-out or not _ExecuteEndAction(cc); for (var ie = cc.m_BlendOutCtrl.GetEnumerator(); ie.MoveNext();) { BlendOutData boData = ie.Current.Value; boData.m_InternalGO.SetActive(true); } m_BlendOutCtrl.Clear(); } else { float t = m_BlendOutElapsedTime / cc.m_BlendOutTime; for (var ie = cc.m_BlendOutCtrl.GetEnumerator(); ie.MoveNext();) { BlendOutData boData = ie.Current.Value; for (int idx = 0; idx < boData.m_BlendDataLst.Count; ++idx) { BlendData bdata = boData.m_BlendDataLst[idx]; bdata.DoBlend(t); } } m_BlendOutElapsedTime += Time.deltaTime; } }
private void Msg_CubeDropped() { Dbg.Log("DropCube"); m_bCubeThrown = false; CutsceneController.JumpToTimeTag(m_CC, "DropCube"); }
public void SwitchPartner(int partner_id) { SwitchPartner sp = ScriptableObject.CreateInstance <SwitchPartner>(); sp.partner_id = partner_id; CutsceneController.addCutsceneEvent(sp, gameObject, true, GameDataTracker.cutsceneModeOptions.Mobile); OverworldController.ChangePauseState(); }
public override IEnumerator ExecuteAction(CutsceneController controller, bool playNextNode = true) { controller.StartCoroutine(base.ExecuteAction(controller)); controller.choicePanel.InitDialogChoice(this); // Next we need to display the choices yield return(null); }
public CutsceneInputState(BoardManager boardManager, CutScene cs, CutsceneController controller, CinematicStatus status) : base(boardManager) { cutscene = Globals.campaign.GetCutsceneCopy(cs.GetKey()); csController = controller; prevStatus = status; }
public void ManualActivate() { if (!started) { started = true; CutsceneController.BeginCutscene(this, cutsceneName); } }
public static CutsceneController Instance() { if (!cutsceneController) { cutsceneController = FindObjectOfType <CutsceneController>(); } return(cutsceneController); }
public override IEnumerator ExecuteAction(CutsceneController controller, bool playNextNode = true) { controller.ToggleOn(); controller.dialogPanel.UpdateDialog(dialog, actorID, actorID); yield return(null); }
/// <summary> /// get the EventGO by name relative to EventGORoot /// </summary> private static Transform _GetEventTrByName(CutsceneController cc, string name) { Transform tr = cc.m_EvtGORootTr.Find(name); Dbg.Assert(tr != null, "CutsceneController._GetEventTrByName: failed to get EventGO of name: {0}", name); return(tr); }
public override IEnumerator ExecuteAction(CutsceneController controller, bool playNextNode = true) { foreach (CutSceneAction action in actions) { yield return(controller.StartCoroutine(action.ExecuteAction(controller, false))); } controller.NextNode(); }
private void unpauseDialog() { CutsceneController cc = GameObject.Find("Scripts").GetComponent <CutsceneController>(); if (cc) { cc.pauseDialog = false; } }
protected virtual void LaunchCutscene() { CutsceneController csc = this.GetComponent <CutsceneController>(); if (csc != null) { csc.StartCutscene(); } }
// Use this for initialization void Start() { rt = GetComponent <RectTransform>(); FIScript = GetComponent <FadeImage>(); creditsImage = GetComponent <Image>(); firstScreenAfterCredsImage = firstScreenAfterCreds.GetComponent <Image>(); firstScreenAfterCredsCutsceneController = firstScreenAfterCreds.GetComponent <CutsceneController>(); moveSpeed = initial_speed; }
public CutsceneChoiceState(CutsceneController controller, ChoiceAction cs, CinematicStatus duringbattle) : base(null) { this.cutscene = cs; csController = controller; this.prevStatus = duringbattle; this.baseManager = null; }
IEnumerator loadBattleSceneAndStart(Adventure adventure) { switchToNode("Cutscene"); AsyncOperation loading = SceneManager.LoadSceneAsync("Scenes/" + battleScene, LoadSceneMode.Additive); yield return(loading); CutsceneController.Instance().preBattleCutscene(adventure); }
private void Start() { Instance = this; fullSize = Border1.rectTransform.sizeDelta.y; currentSize = Border1.rectTransform.sizeDelta; currentSize.y = 0; Border1.rectTransform.sizeDelta = currentSize; Border2.rectTransform.sizeDelta = currentSize; }
public IEnumerator SnapCamera(CutsceneController cs, bool playNextNode) { cs.cutsceneCamera.transform.position = new Vector3(newPos.X, newPos.Y, cs.cutsceneCamera.transform.position.z); yield return(null); if (playNextNode) { cs.NextNode(); } }
/// <summary> /// reset animationState, /// so the existing binding is broken /// </summary> private static void _ResetAnimationState(CutsceneController cc) { Animation anim = cc.m_Anim; AnimationClip clip = anim.clip; anim.RemoveClip(clip); anim.AddClip(clip, clip.name); anim.clip = clip; cc.m_AnimState = anim[clip.name]; }
public override IEnumerator ExecuteAction(CutsceneController controller, bool playNextNode = true) { if (snapCamera) { yield return(controller.StartCoroutine(SnapCamera(controller, playNextNode))); } else { yield return(controller.StartCoroutine(SmoothMovement(controller, controller.cutsceneCamera, playNextNode))); } }
private void _StartEndCC() { var action = m_EndTitleCC; action.SetActive(true); // start the cutscene CutsceneController cc = action.GetComponent <CutsceneController>(); CutsceneController.StartCC(cc); }
void Start() { Screen.sleepTimeout = SleepTimeout.NeverSleep; if(cam == null) { cam = Camera.main; } playController = GetComponent<PlayController>(); cutsceneController = GetComponent<CutsceneController>(); gameOverController = GetComponent<GameOverController>(); InitLanguage(); if (SceneManager.GetActiveScene().name == "MelonScene") { GotoTitleScreen(); } else { GoToCutScene(); } }
void Awake() { instance = this; }