mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
[unity] PhysicsConstraints: Made applyRotationToPhysics and applyTranslationToPhysics protected, added getter/setter automatically resetting last position (see commit 4266c72).
This commit is contained in:
parent
2a42f1a160
commit
c46ae017fd
@ -568,9 +568,9 @@ namespace Spine.Unity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>When enabled, Transform translation is applied to skeleton PhysicsConstraints.</summary>
|
/// <summary>When enabled, Transform translation is applied to skeleton PhysicsConstraints.</summary>
|
||||||
public bool applyTranslationToPhysics = true;
|
[SerializeField] protected bool applyTranslationToPhysics = true;
|
||||||
/// <summary>When enabled, Transform rotation is applied to skeleton PhysicsConstraints.</summary>
|
/// <summary>When enabled, Transform rotation is applied to skeleton PhysicsConstraints.</summary>
|
||||||
public bool applyRotationToPhysics = true;
|
[SerializeField] protected bool applyRotationToPhysics = true;
|
||||||
/// <summary>Reference transform relative to which physics movement will be calculated, or null to use world location.</summary>
|
/// <summary>Reference transform relative to which physics movement will be calculated, or null to use world location.</summary>
|
||||||
[SerializeField] protected Transform physicsMovementRelativeTo = null;
|
[SerializeField] protected Transform physicsMovementRelativeTo = null;
|
||||||
|
|
||||||
@ -579,6 +579,28 @@ namespace Spine.Unity {
|
|||||||
/// <summary>Used for applying Transform rotation to skeleton PhysicsConstraints.</summary>
|
/// <summary>Used for applying Transform rotation to skeleton PhysicsConstraints.</summary>
|
||||||
protected float lastRotation;
|
protected float lastRotation;
|
||||||
|
|
||||||
|
/// <summary>When enabled, Transform translation is applied to skeleton PhysicsConstraints.</summary>
|
||||||
|
public bool ApplyTranslationToPhysics {
|
||||||
|
get {
|
||||||
|
return applyTranslationToPhysics;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
if (value && !applyTranslationToPhysics) ResetLastPosition();
|
||||||
|
applyTranslationToPhysics = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>When enabled, Transform rotation is applied to skeleton PhysicsConstraints.</summary>
|
||||||
|
public bool ApplyRotationToPhysics {
|
||||||
|
get {
|
||||||
|
return applyRotationToPhysics;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
if (value && !applyRotationToPhysics) ResetLastRotation();
|
||||||
|
applyRotationToPhysics = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>Reference transform relative to which physics movement will be calculated, or null to use world location.</summary>
|
/// <summary>Reference transform relative to which physics movement will be calculated, or null to use world location.</summary>
|
||||||
public Transform PhysicsMovementRelativeTo {
|
public Transform PhysicsMovementRelativeTo {
|
||||||
get {
|
get {
|
||||||
|
|||||||
@ -290,9 +290,9 @@ namespace Spine.Unity {
|
|||||||
|
|
||||||
#region Physics
|
#region Physics
|
||||||
/// <summary>When enabled, Transform translation is applied to skeleton PhysicsConstraints.</summary>
|
/// <summary>When enabled, Transform translation is applied to skeleton PhysicsConstraints.</summary>
|
||||||
public bool applyTranslationToPhysics = true;
|
[SerializeField] protected bool applyTranslationToPhysics = true;
|
||||||
/// <summary>When enabled, Transform rotation is applied to skeleton PhysicsConstraints.</summary>
|
/// <summary>When enabled, Transform rotation is applied to skeleton PhysicsConstraints.</summary>
|
||||||
public bool applyRotationToPhysics = true;
|
[SerializeField] protected bool applyRotationToPhysics = true;
|
||||||
/// <summary>Reference transform relative to which physics movement will be calculated, or null to use world location.</summary>
|
/// <summary>Reference transform relative to which physics movement will be calculated, or null to use world location.</summary>
|
||||||
[SerializeField] protected Transform physicsMovementRelativeTo = null;
|
[SerializeField] protected Transform physicsMovementRelativeTo = null;
|
||||||
|
|
||||||
@ -301,6 +301,28 @@ namespace Spine.Unity {
|
|||||||
/// <summary>Used for applying Transform rotation to skeleton PhysicsConstraints.</summary>
|
/// <summary>Used for applying Transform rotation to skeleton PhysicsConstraints.</summary>
|
||||||
protected float lastRotation;
|
protected float lastRotation;
|
||||||
|
|
||||||
|
/// <summary>When enabled, Transform translation is applied to skeleton PhysicsConstraints.</summary>
|
||||||
|
public bool ApplyTranslationToPhysics {
|
||||||
|
get {
|
||||||
|
return applyTranslationToPhysics;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
if (value && !applyTranslationToPhysics) ResetLastPosition();
|
||||||
|
applyTranslationToPhysics = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>When enabled, Transform rotation is applied to skeleton PhysicsConstraints.</summary>
|
||||||
|
public bool ApplyRotationToPhysics {
|
||||||
|
get {
|
||||||
|
return applyRotationToPhysics;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
if (value && !applyRotationToPhysics) ResetLastRotation();
|
||||||
|
applyRotationToPhysics = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>Reference transform relative to which physics movement will be calculated, or null to use world location.</summary>
|
/// <summary>Reference transform relative to which physics movement will be calculated, or null to use world location.</summary>
|
||||||
public Transform PhysicsMovementRelativeTo {
|
public Transform PhysicsMovementRelativeTo {
|
||||||
get {
|
get {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user