mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-13 02:28:44 +08:00
[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:
parent
726ad4ddbe
commit
8fb3876396
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user