@p12pzn 很高兴听到您可以解决您的第一个问题,感谢您告诉我们。
关于“SkeletonGraphic”和“MaterialPropertyBlock”:不幸的是,我们也不知道与 Unity 的“CanvasRenderer”一起使用的“MaterialPropertyBlock”有什么好的替代方案。
不幸的是,我们在这里的 Unity API 非常有限,目前我们可以提供的最好的组件是 SkeletonGraphicCustomMaterials
组件(或通过代码使用 sculptureGraphic.CustomMaterialOverride
),它允许您使用不同的材质覆盖骨架的默认材质。 材料。 这样您就可以使用一种可以激活和停用的白色覆盖材质,避免使用“canvasRenderer.GetMaterial()”和“canvasRenderer.SetMaterial()”。
Glad to hear you could resolve your first problem, thanks for letting us know.
Regarding SkeletonGraphic
and MaterialPropertyBlock
: Unfortunately we also don't know any good alternative to MaterialPropertyBlock
to be used with Unity's CanvasRenderer
.
Unfortunately we're quite limited with Unity's API here, the best that we can currently offer is the SkeletonGraphicCustomMaterials
component (or using skeletonGraphic.CustomMaterialOverride
via code), which allows you to override the default material of the skeleton with a different material. This way you could use one white override material which can be activated and deactivated, avoiding using canvasRenderer.GetMaterial()
and canvasRenderer.SetMaterial()
.