mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
[unity] Exposed public SkeletonGraphic.SetScaledPivotOffset method outside of the editor.
This commit is contained in:
parent
a6bf66ba32
commit
906793db81
@ -165,6 +165,7 @@
|
|||||||
- `SkeletonRootMotion` components now provide a public `Initialize()` method which is automatically called when calling `skeletonAnimation.Initialize(true)` to update the necessary skeleton references. If a different root bone shall be used, be sure to set `skeletonRootMotion.rootMotionBoneName` before calling `skeletonAnimation.Initialize(true)`.
|
- `SkeletonRootMotion` components now provide a public `Initialize()` method which is automatically called when calling `skeletonAnimation.Initialize(true)` to update the necessary skeleton references. If a different root bone shall be used, be sure to set `skeletonRootMotion.rootMotionBoneName` before calling `skeletonAnimation.Initialize(true)`.
|
||||||
- Skeleton Mecanim: Added new `Mix Mode` `Match`. When selected, Spine animation weights are calculated to best match the provided Mecanim clip weights. This mix mode is recommended on any layer using blend tree nodes.
|
- Skeleton Mecanim: Added new `Mix Mode` `Match`. When selected, Spine animation weights are calculated to best match the provided Mecanim clip weights. This mix mode is recommended on any layer using blend tree nodes.
|
||||||
- URP Shaders: Added `ZWrite` variant of outline shader `Universal Render Pipeline/Spine/Outline/Skeleton-OutlineOnly ZWrite`. Suitable for e.g. depth of field (DoF) effect where writing to the depth buffer is required. Note that for DoF effect, `Render Queue` needs to be set to `Alpha Test`.
|
- URP Shaders: Added `ZWrite` variant of outline shader `Universal Render Pipeline/Spine/Outline/Skeleton-OutlineOnly ZWrite`. Suitable for e.g. depth of field (DoF) effect where writing to the depth buffer is required. Note that for DoF effect, `Render Queue` needs to be set to `Alpha Test`.
|
||||||
|
- SkeletonGraphic: Exposed `SetScaledPivotOffset` as public method outside of the editor to support programatically moving mesh offsets at runtime based on mesh bounds.
|
||||||
|
|
||||||
- **Breaking changes**
|
- **Breaking changes**
|
||||||
|
|
||||||
|
|||||||
@ -1416,11 +1416,11 @@ namespace Spine.Unity {
|
|||||||
public Vector2 GetScaledPivotOffset () {
|
public Vector2 GetScaledPivotOffset () {
|
||||||
return pivotOffset * GetLayoutScale(layoutScaleMode);
|
return pivotOffset * GetLayoutScale(layoutScaleMode);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
public void SetScaledPivotOffset (Vector2 pivotOffsetScaled) {
|
public void SetScaledPivotOffset (Vector2 pivotOffsetScaled) {
|
||||||
pivotOffset = pivotOffsetScaled / GetLayoutScale(layoutScaleMode);
|
pivotOffset = pivotOffsetScaled / GetLayoutScale(layoutScaleMode);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
protected float GetLayoutScale (LayoutMode mode) {
|
protected float GetLayoutScale (LayoutMode mode) {
|
||||||
Vector2 currentSize = GetCurrentRectSize();
|
Vector2 currentSize = GetCurrentRectSize();
|
||||||
mode = GetEffectiveLayoutMode(mode);
|
mode = GetEffectiveLayoutMode(mode);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"name": "com.esotericsoftware.spine.spine-unity",
|
"name": "com.esotericsoftware.spine.spine-unity",
|
||||||
"displayName": "spine-unity Runtime",
|
"displayName": "spine-unity Runtime",
|
||||||
"description": "This plugin provides the spine-unity runtime core.",
|
"description": "This plugin provides the spine-unity runtime core.",
|
||||||
"version": "4.2.91",
|
"version": "4.2.92",
|
||||||
"unity": "2018.3",
|
"unity": "2018.3",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Esoteric Software",
|
"name": "Esoteric Software",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user