[unity] Added warning message when 'CanvasGroup Compatible' is enabled at the Material but 'Canvas Group Tint Black' is disabled at SkeletonGraphic.

This commit is contained in:
Harald Csaszar 2022-11-16 12:23:12 +01:00
parent 726ad4ddbe
commit 8fb3876396

View File

@ -96,7 +96,12 @@ namespace Spine.Unity {
"\nWarning: 'Canvas Group Tint Black' is enabled at SkeletonGraphic but not 'CanvasGroup Compatible' at the Material!\n\nPlease\n"
+ "a) enable 'CanvasGroup Compatible' at the Material or\n"
+ "b) disable 'Canvas Group Tint Black' at the SkeletonGraphic component under 'Advanced'.\n"
+ "You may want to duplicate the 'SkeletonGraphicDefault' material and change settings at the duplicate to not affect all instances.";
+ "You may want to duplicate the 'SkeletonGraphicTintBlack' material and change settings at the duplicate to not affect all instances.";
public static readonly string kCanvasGroupCompatibleDisabledMessage =
"\nWarning: 'CanvasGroup Compatible' is enabled at the Material but 'Canvas Group Tint Black' is disabled at SkeletonGraphic!\n\nPlease\n"
+ "a) disable 'CanvasGroup Compatible' at the Material or\n"
+ "b) enable 'Canvas Group Tint Black' at the SkeletonGraphic component under 'Advanced'.\n"
+ "You may want to duplicate the 'SkeletonGraphicTintBlack' material and change settings at the duplicate to not affect all instances.";
public static bool IsMaterialSetupProblematic (SkeletonRenderer renderer, ref string errorMessage) {
var materials = renderer.GetComponent<Renderer>().sharedMaterials;
@ -152,6 +157,11 @@ namespace Spine.Unity {
isProblematic = true;
errorMessage += kCanvasGroupCompatibleMessage;
}
if (settings.tintBlack == true && settings.canvasGroupTintBlack == false
&& IsCanvasGroupCompatible(material)) {
isProblematic = true;
errorMessage += kCanvasGroupCompatibleDisabledMessage;
}
}
return isProblematic;
}