//only hoMove void UpdatePoints() { hoScript.Stop(); hoScript.currentPoint = 0; hoScript.moveToPath = true; hoScript.StartMove(); }
static IEnumerator DoBossCutScene2() { isTestScene = false; if (GameObject.Find("CutSceneTestManager")) { isTestScene = true; } isBossCutSceneProgress = true; yield return(new WaitForSeconds(0.1f)); if (cameraMover == null) { if (GameObject.Find("CutSceneCameraMover") != null) { cameraMover = GameObject.Find("CutSceneCameraMover").GetComponent <hoMove>(); } //cameraMover = new GameObject("CameraMover"); //cameraMover.AddComponent<hoMove>(); } UIHelper.SetMainCameraDepth(100); initStartCamAndShakeCam(); //startCamObj.transform.parent = cameraMover.gameObject.transform; startCamObj.transform.parent = cameraMover.cameraContainer; Unit targetUnit = CutSceneEventDic [0].GetComponent <Unit> (); GameObject targetObject = new GameObject("lookAtTarget"); targetObject.transform.position = targetUnit.transform.position + Vector3.up * 1.23f; cameraMover.bLookAtTarget = true; //if (cameraMover.transformForLookAtTarger == null) { //cameraMover.transformForLookAtTarger = targetUnit.transform; cameraMover.transformForLookAtTarger = targetObject.transform; //} CutSceneSeqHelper csHelper = GameObject.Find("CutSceneCameraMover").GetComponent <CutSceneSeqHelper> (); GameObject abp = null; AppearBossPanel bossPanel = null; bool isPanelInited = false; // fot test loop bool bLoop = true; while (bLoop) { isBossCutSceneProgress = true; // set first pos //startCamObj.transform.localPosition = Vector3.zero; //startCamObj.transform.localRotation = Quaternion.identity; //startCamObj.transform.localPosition = startRootObj.transform.position; //startCamObj.transform.localRotation = startRootObj.transform.rotation; //UIHelper.SetMainCameraActive (false); //Debug.Break(); UIHelper.SetMainCameraDepth(100); yield return(new WaitForSeconds(csHelper.start_delay)); G_GameInfo.GameInfo.FocusingCam.ChangeParent(startCamObj.transform); G_GameInfo.GameInfo.FocusingCam.StartEffect(0, true); G_GameInfo.GameInfo.FocusingCam.AddObject(targetUnit.gameObject); cutSceneCamShaker.cameras.Add(G_GameInfo.GameInfo.FocusingCam.GetComponent <Camera>()); // camera move to first path's position. cameraMover.transform.position = cameraMover.pathContainer.transform.FindChild("WaypointStart").transform.position; cameraMover.transform.LookAt(targetUnit.transform.position); cameraMover.cameraContainerLookat(); startCamObj.transform.localPosition = Vector3.zero; startCamObj.transform.localRotation = Quaternion.identity; cameraMover.StartMove(); // camera change UIHelper.SetMainCameraActive(false); UIHelper.SetMainCameraDepth(0); // wait until cameraMover finish // while(cameraMover.bReachedTweenMove==false){ // yield return null; // } TempCoroutine.instance.FrameDelay(csHelper.delay_for_name_ani, delegate() { if (isPanelInited) { bossPanel.DoNameAniAlphaSound(); } else { UIMgr.OpenAppearBoss(); abp = GameObject.Find("UIPanel/AppearBossPanel"); bossPanel = abp.GetComponent <AppearBossPanel> (); isPanelInited = true; } }); TempCoroutine.instance.FrameDelay(csHelper.delay_for_boss_ani, delegate() { // boss npc animation InGameHUDPanel hudpanel = UIMgr.GetUI("UIPanel/InGameHUDPanel").GetComponent <InGameHUDPanel> (); if (hudpanel != null) { hudpanel.BossUnit.ChangeState(UnitState.Event); } }); // boss npc 의 애니메이션에서 stopBossCutScene()이 호출되어 coroutine이 종료되므로 실제 이 yield를 기다려서 종료하지 않고 loop도 돌지 않는다. . only for test. //yield return new WaitForSeconds (csHelper.sequence_total_time); // for safe. prevent loop dead lock. //G_GameInfo.GameInfo.StartCoroutine("forceFinishCutScene"); forceFinishCutSceneCoroutine = forceFinishCutScene(); G_GameInfo.GameInfo.StartCoroutine(forceFinishCutSceneCoroutine); while (isBossCutSceneProgress) { yield return(null); } bLoop = false; if (isTestScene) { // delay for repeatly loop test bLoop = true; yield return(new WaitForSeconds(1.0f)); } } isBossCutSceneProgress = false; yield return(null); }