参考文章:
[2D Pixel Perfect Common] (docs.unity3d.com/Packages/co…)
2D Pixel Perfect | Universal RP | 12.1.7 (unity3d.com)
Cinemachine Extension
As both the Pixel Perfect Camera and Cinemachine modify a Camera’s orthographic size, using these two systems together in a single Scene would cause them to fight for control over the Camera and likely produce unwanted results. To solve this incompatibility, add the Cinemachine Pixel Perfect extension to your virtual cameras. You can find more information about the extension’s features in the Cinemachine documentation.
URP pixel Prefect 文档的正文
The 2D Pixel Perfect package contains the Pixel Perfect Camera component, which ensures your pixel art remains crisp and clear at different resolutions, and stable in motion. Pixel Perfect Camera component附加在Cam上,用于确保pixel art(sprite)在不同的屏幕分辨率下依然能保持图像的清晰明了,并且在sprite运动过程中保持这种特性。 It is a single component that makes all the calculations Unity needs to scale the viewport with resolution changes, so that you don’t need to do it manually. You can use the component settings to adjust the definition of the rendered pixel art within the camera viewport, and you can use the Run in Edit Mode feature to preview any changes immediately in the Game view.
Attach the Pixel Perfect Camera component to the main Camera GameObject in the Scene, it is represented by two green bounding boxes centered on the Camera gizmo in the Scene view. The solid green bounding box shows the visible area in Game view, while the dotted bounding box shows the Reference Resolution.
Pixel Perfect Camera组件附加到MainCam后,在Scene视图中由两个绿色的线框表示,其中外围的绿色实线框用于标示在特定屏幕分辨率下,GameView窗口(也代表屏幕)实际用于显示图像内容的区域(通过控制viewPort Rect来实现)。而绿色的点线框则用于标示Reference Resolution。值得注意的是,这两个线宽的尺寸是以Unit为单位进行标记的。