mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 15:24:55 +08:00
[unity] Added missing added changes of previous commit 6a3fb6a.
This commit is contained in:
parent
6a3fb6a42a
commit
b7f4bbc5e3
@ -123,8 +123,7 @@ namespace Spine.Unity {
|
||||
return isProblematic;
|
||||
}
|
||||
|
||||
public static bool IsMaterialSetupProblematic(SkeletonGraphic skeletonGraphic, ref string errorMessage)
|
||||
{
|
||||
public static bool IsMaterialSetupProblematic (SkeletonGraphic skeletonGraphic, ref string errorMessage) {
|
||||
var material = skeletonGraphic.material;
|
||||
bool isProblematic = false;
|
||||
if (material) {
|
||||
@ -157,11 +156,11 @@ namespace Spine.Unity {
|
||||
return isProblematic;
|
||||
}
|
||||
|
||||
public static bool IsMaterialSetupProblematic(Material material, ref string errorMessage) {
|
||||
public static bool IsMaterialSetupProblematic (Material material, ref string errorMessage) {
|
||||
return !IsColorSpaceSupported(material, ref errorMessage);
|
||||
}
|
||||
|
||||
public static bool IsZSpacingRequired(Material material, ref string errorMessage) {
|
||||
public static bool IsZSpacingRequired (Material material, ref string errorMessage) {
|
||||
bool hasForwardAddPass = material.FindPass("FORWARD_DELTA") >= 0;
|
||||
if (hasForwardAddPass) {
|
||||
errorMessage += kZSpacingRequiredMessage;
|
||||
@ -222,8 +221,7 @@ namespace Spine.Unity {
|
||||
"(You can disable this warning in `Edit - Preferences - Spine`)\n", texturePath, materialName);
|
||||
isProblematic = true;
|
||||
}
|
||||
}
|
||||
else { // straight alpha texture
|
||||
} else { // straight alpha texture
|
||||
if (!alphaIsTransparency) {
|
||||
string materialName = System.IO.Path.GetFileName(materialPath);
|
||||
errorMessage += string.Format("`{0}` and material `{1}` : Incorrect" +
|
||||
@ -245,14 +243,12 @@ namespace Spine.Unity {
|
||||
material.DisableKeyword(STRAIGHT_ALPHA_KEYWORD);
|
||||
else
|
||||
material.EnableKeyword(STRAIGHT_ALPHA_KEYWORD);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (enablePMATexture) {
|
||||
material.DisableKeyword(ALPHAPREMULTIPLY_ON_KEYWORD);
|
||||
material.DisableKeyword(ALPHABLEND_ON_KEYWORD);
|
||||
material.EnableKeyword(ALPHAPREMULTIPLY_VERTEX_ONLY_ON_KEYWORD);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
material.DisableKeyword(ALPHAPREMULTIPLY_ON_KEYWORD);
|
||||
material.DisableKeyword(ALPHAPREMULTIPLY_VERTEX_ONLY_ON_KEYWORD);
|
||||
material.EnableKeyword(ALPHABLEND_ON_KEYWORD);
|
||||
@ -260,7 +256,7 @@ namespace Spine.Unity {
|
||||
}
|
||||
}
|
||||
|
||||
static bool IsPMATextureMaterial (Material material) {
|
||||
public static bool IsPMATextureMaterial (Material material) {
|
||||
bool usesAlphaPremultiplyKeyword = IsSpriteShader(material);
|
||||
if (usesAlphaPremultiplyKeyword)
|
||||
return material.IsKeywordEnabled(ALPHAPREMULTIPLY_ON_KEYWORD);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user