将Unity从2021.3.31升级到2022.3.59之后,使用 UIParticleSystem 组件并开启ParticalSystem的Shape设置的 alignToDirection
选项时,会一直出现 MinMaxAABB 和 Mesh 的报错:
1、Converting invalid MinMaxAABB;
2、Mesh '': abnormal mesh bounds - most likely it has some invalid vertices (+/-inifinity or NANs) due to errors exporting. Mesh bounds min=(-nan(ind), -nan(ind), -nan(ind)), max=(-nan(ind), -nan(ind), -nan(ind)). Please make sure the mesh is exported without any errors.
设置alignToDirection为false后报错消失,
猜测原因可能是:
1、alignToDirection
会动态调整粒子方向(可能涉及复杂的旋转矩阵计算),而 UIParticleSystem 需要将粒子系统映射到 UI Canvas 的屏幕空间坐标系中。两者的坐标转换过程中若出现无效数值(如NaN
或Infinity
),会导致网格包围盒(Bounds)计算崩溃。
2、兼容性问题