internal protected void Update() { var cpos = Camera.main.transform.position; var mt = Render.worldToLocalMatrix; mt = Matrix4x4.TRS(Vector3.zero, Quaternion.AngleAxis(180, Vector3.up), Vector3.one) * mt; Camera.transform.localPosition = mt.MultiplyPoint(cpos); Camera.transform.LookAt(Point); Camera.nearClipPlane = -Camera.transform.localPosition.z; const float renderHeight = 3f; Camera.fieldOfView = 2 * Mathf.Atan(renderHeight / 2 / Camera.nearClipPlane) * Mathf.Rad2Deg; }
unity传送门类似效果实现 (2)
内容版权声明:除非注明,否则皆为本站原创文章。