Camera.transparencySortAxis

切换到手册
public Vector3 transparencySortAxis ;

描述

描述方向的轴,将沿此方向测量对象距离,从而进行排序。

如果 CameraGraphicsSettingsTransparencySortMode 设置为 TransparencySortMode.CustomAxis,渲染管线将计算对象沿该属性指定的轴的距离。

当其他更高优先级的标准无法区分渲染顺序时,使用此属性对 Renderer 组件进行排序。

This is a useful technique in 2.5D games or isometric games where the SpriteRenderers need to be sorted along the vertical screen axis. For this specific use case, set the TransparencySortMode to TransparencySortMode.CustomAxis and set the axis to (0.0f, 1.0f, 0.0f).