mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
ac00899175
@ -169,8 +169,8 @@ namespace Spine.Unity.Modules {
|
|||||||
attachment.SetColor(Color.white);
|
attachment.SetColor(Color.white);
|
||||||
attachment.ScaleX = 1;
|
attachment.ScaleX = 1;
|
||||||
attachment.ScaleY = 1;
|
attachment.ScaleY = 1;
|
||||||
attachment.RegionOffsetX = sprite.rect.width * (0.5f - Mathf.InverseLerp(bounds.min.x, bounds.max.x, 0)) / sprite.pixelsPerUnit;
|
attachment.RegionOffsetX = sprite.rect.width * (0.5f - InverseLerp(bounds.min.x, bounds.max.x, 0)) / sprite.pixelsPerUnit;
|
||||||
attachment.RegionOffsetY = sprite.rect.height * (0.5f - Mathf.InverseLerp(bounds.min.y, bounds.max.y, 0)) / sprite.pixelsPerUnit;
|
attachment.RegionOffsetY = sprite.rect.height * (0.5f - InverseLerp(bounds.min.y, bounds.max.y, 0)) / sprite.pixelsPerUnit;
|
||||||
attachment.Width = size.x;
|
attachment.Width = size.x;
|
||||||
attachment.Height = size.y;
|
attachment.Height = size.y;
|
||||||
attachment.RegionWidth = size.x;
|
attachment.RegionWidth = size.x;
|
||||||
@ -194,6 +194,11 @@ namespace Spine.Unity.Modules {
|
|||||||
public BoundingBoxAttachment NewBoundingBoxAttachment (Skin skin, string name) {
|
public BoundingBoxAttachment NewBoundingBoxAttachment (Skin skin, string name) {
|
||||||
throw new System.NotImplementedException();
|
throw new System.NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private float InverseLerp(float a, float b, float value)
|
||||||
|
{
|
||||||
|
return (value - a) / (b - a);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class SpriteAttachmentExtensions {
|
public static class SpriteAttachmentExtensions {
|
||||||
|
|||||||
@ -8,6 +8,7 @@ Shader "Spine/Skeleton" {
|
|||||||
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
|
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
|
||||||
LOD 100
|
LOD 100
|
||||||
|
|
||||||
|
Fog { Mode Off }
|
||||||
Cull Off
|
Cull Off
|
||||||
ZWrite Off
|
ZWrite Off
|
||||||
Blend One OneMinusSrcAlpha
|
Blend One OneMinusSrcAlpha
|
||||||
@ -24,8 +25,7 @@ Shader "Spine/Skeleton" {
|
|||||||
Name "Caster"
|
Name "Caster"
|
||||||
Tags { "LightMode"="ShadowCaster" }
|
Tags { "LightMode"="ShadowCaster" }
|
||||||
Offset 1, 1
|
Offset 1, 1
|
||||||
|
|
||||||
Fog { Mode Off }
|
|
||||||
ZWrite On
|
ZWrite On
|
||||||
ZTest LEqual
|
ZTest LEqual
|
||||||
Cull Off
|
Cull Off
|
||||||
@ -79,4 +79,4 @@ Shader "Spine/Skeleton" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user