public void SetCamPos(GUICamPos pos) { Vector3 levPos = MainObjectSingleton.shared(MainObjectType.Player).transform.position; mainCam.transform.rotation = Quaternion.identity; if (pos == GUICamPos.Original) { mainCam.transform.position = oriCamPos; mainCam.transform.rotation = oriCamRotate; } else if (pos == GUICamPos.Up) { mainCam.transform.position = levPos + deltaCamPosFromLev + deltaCamPos; } else if (pos == GUICamPos.Down) { mainCam.transform.position = levPos + deltaCamPosFromLev - deltaCamPos; } else { mainCam.transform.position = levPos + deltaCamPosFromLev; } }
public void MoveCamPos(GUICamPos pos, float camTime, float camDelay, System.Action camCompleteAction) { Vector3 endCamPos = Vector3.zero; Vector3 levPos = MainObjectSingleton.shared(MainObjectType.Player).transform.position; Quaternion endCamRotate = Quaternion.identity; onCamMoveComplete = camCompleteAction; if (pos == GUICamPos.Original) { endCamPos = oriCamPos; endCamRotate = oriCamRotate; } else if (pos == GUICamPos.Up) { endCamPos = levPos + deltaCamPosFromLev + deltaCamPos; } else if (pos == GUICamPos.Down) { endCamPos = levPos + deltaCamPosFromLev - deltaCamPos; } else { endCamPos = levPos + deltaCamPosFromLev; } iTween.MoveTo(mainCam.gameObject, iTween.Hash("position", endCamPos, "time", camTime, "delay", camDelay, "oncomplete", "OnCamMoveComplete", "oncompletetarget", gameObject, "ignoretimescale", (Time.timeScale == 0f), "easetype", "easeInOutSmoothBreak")); iTween.RotateTo(mainCam.gameObject, iTween.Hash("rotation", endCamRotate.eulerAngles, "time", camTime, "delay", camDelay, "ignoretimescale", (Time.timeScale == 0f), "easetype", "easeInOutSmoothBreak")); }