public void PlayTranslationAnim(List <VectorAnimation> vs, int i) { if (vs.Count > i) { m.StartCoroutine(SmoothTransformation <Vector3> .SmoothRotateEuler(vs[i].start, vs[i].end, vs[i].time, (v) => animatedTarget.localPosition = v, () => { PlayTranslationAnim(vs, i + 1); })); } else { pFinish = true; CheckIfDone(); } }
//private static void LookAt(CameraDirector director) //{ // director.AnimateCamera(GameManager.PlayerMainCamera.transform); //} public static void LookAtMainIsland() { Vector3 observationPosition = new Vector3(-134.2f, 45.1f, 78.3f); Vector3 observationEuler = new Vector3(30.4f, -18.32f, 0); Transform cam = Camera.main.transform; Vector3 euler = cam.localEulerAngles; Vector3 pos = cam.localPosition; MonoBehaviour source = GameManager.GetPlayerComponent <MonoBehaviour>(); source.StartCoroutine(SmoothTransformation <Vector3> .SmoothRotateAngleEuler(cam.eulerAngles, observationEuler, 2.5f, v => cam.eulerAngles = v)); source.StartCoroutine( SmoothTransformation <Vector3> .SmoothRotateEuler(cam.position, observationPosition, 2.5f, v => cam.position = v, () => { source.StartCoroutine(SmoothTransformation <Vector3> .SmoothRotateAngleEuler(observationPosition, observationPosition, 1.5f, v => { }, () => { cam.localEulerAngles = euler; cam.localPosition = pos; })); }) ); }
private static void LookAtTriangle() { Vector3 observationPosition = new Vector3(-182.81f, 65.13f, 41.95f); Vector3 observationEuler = new Vector3(27.237f, -149.538f, 0); Transform cam = Camera.main.transform; Vector3 euler = cam.localEulerAngles; Vector3 pos = cam.localPosition; MonoBehaviour source = GameManager.GetPlayerComponent <MonoBehaviour>(); source.StartCoroutine(SmoothTransformation <Vector3> .SmoothRotateAngleEuler(cam.eulerAngles, observationEuler, 2.5f, v => cam.eulerAngles = v)); source.StartCoroutine( SmoothTransformation <Vector3> .SmoothRotateEuler(cam.position, observationPosition, 2.5f, v => cam.position = v, () => { source.StartCoroutine(SmoothTransformation <Vector3> .SmoothRotateAngleEuler(observationPosition, observationPosition, 2f, v => { }, () => { cam.localEulerAngles = euler; cam.localPosition = pos; })); }) ); }
public static void EndGame() { GameObject player = GameManager.Player; InterfaceController interfaceController = player.GetComponent <InterfaceController>(); GameObject admiral = FindGameObjectWithTag("Admiral"); admiral.GetComponent <DialogTrigger>().DisableInteraction(); player.transform.parent.GetComponent <EndGameMusic>().PlayMusic(); Transform cam = Camera.main.transform; interfaceController.Clear(); GameManager.FreezePlayer(); MonoBehaviour m = player.GetComponent <MonoBehaviour>(); m.DoDelayed(0.25f, delegate { Vector3 observationPosition = new Vector3(23.68f, 27.49f, -27.52f); Vector3 observationEuler = new Vector3(90.00001f, 0, 38.817f); m.StartCoroutine(SmoothTransformation <Vector3> .SmoothRotateAngleEuler(cam.eulerAngles, observationEuler, 4f, v => cam.eulerAngles = v)); m.StartCoroutine( SmoothTransformation <Vector3> .SmoothRotateEuler(cam.position, observationPosition, 4f, v => cam.position = v, () => { interfaceController.DoDelayed(5f, delegate { admiral.GetComponent <IntroAdmiral>().JumpInWater(); }); Vector3 observationPosition2 = new Vector3(95, 255.7f, -116.1f); Vector3 observationEuler2 = new Vector3(51.937f, -38.817f, 0); m.StartCoroutine(SmoothTransformation <Vector3> .SmoothRotateAngleEuler(cam.eulerAngles, observationEuler2, 16f, v => cam.eulerAngles = v)); m.StartCoroutine( SmoothTransformation <Vector3> .SmoothRotateEuler(cam.position, observationPosition2, 17.8f, v => cam.position = v, delegate { SceneSwitcher.EnterScene("MenueScene", false, false); })); }) ); }); }
public static void LookAtPortal() { Vector3 observationPosition = new Vector3(-253.2f, 35.7f, 119.1f); Vector3 observationEuler = new Vector3(22.306f, -90f, 0); Transform cam = Camera.main.transform; Vector3 pos = cam.localPosition; Vector3 euler = cam.localEulerAngles; MonoBehaviour source = GameManager.GetPlayerComponent <MonoBehaviour>(); source.StartCoroutine(SmoothTransformation <Vector3> .SmoothRotateAngleEuler(cam.eulerAngles, observationEuler, 2.5f, v => cam.eulerAngles = v)); source.StartCoroutine( SmoothTransformation <Vector3> .SmoothRotateEuler(cam.position, observationPosition, 2.5f, v => cam.position = v, () => { source.StartCoroutine(SmoothTransformation <Vector3> .SmoothRotateAngleEuler(observationPosition, observationPosition, 1.5f, v => { }, () => { cam.localEulerAngles = euler; cam.localPosition = pos; })); }) ); }