|
@@ -63,10 +63,15 @@ namespace Spine.Unity {
|
|
|
/// Use this callback when you want to set bone local values.</summary>
|
|
|
public event UpdateBonesDelegate UpdateLocal { add { _UpdateLocal += value; } remove { _UpdateLocal -= value; } }
|
|
|
|
|
|
- /// <summary>
|
|
|
+ /// <summary><para>
|
|
|
/// Occurs after the Skeleton's bone world space values are resolved (including all constraints).
|
|
|
/// Using this callback will cause the world space values to be solved an extra time.
|
|
|
- /// Use this callback if want to use bone world space values, and also set bone local values.</summary>
|
|
|
+ /// Use this callback if want to use bone world space values, and also set bone local values.
|
|
|
+ /// </para><para>
|
|
|
+ /// When used in combination with PhysicsConstraints at your skeleton, you might want to consider adjusting
|
|
|
+ /// <see cref="MainPhysicsUpdate"/> and <see cref="AdditionalPhysicsUpdate"/> to save updates by setting one to
|
|
|
+ /// <see cref="Skeleton.Physics.Pose"/>.
|
|
|
+ /// </para></summary>
|
|
|
public event UpdateBonesDelegate UpdateWorld { add { _UpdateWorld += value; } remove { _UpdateWorld -= value; } }
|
|
|
|
|
|
/// <summary>
|
|
@@ -77,6 +82,15 @@ namespace Spine.Unity {
|
|
|
|
|
|
[SerializeField] protected UpdateTiming updateTiming = UpdateTiming.InUpdate;
|
|
|
public UpdateTiming UpdateTiming { get { return updateTiming; } set { updateTiming = value; } }
|
|
|
+
|
|
|
+ protected Skeleton.Physics mainPhysicsUpdate = Skeleton.Physics.Update;
|
|
|
+ protected Skeleton.Physics additionalPhysicsUpdate = Skeleton.Physics.Update;
|
|
|
+ /// <summary>Physics update mode used in the main call to skeleton.UpdateWorldTransform().</summary>
|
|
|
+ public Skeleton.Physics MainPhysicsUpdate { get { return mainPhysicsUpdate; } set { mainPhysicsUpdate = value; } }
|
|
|
+ /// <summary>Physics update mode used at optional additional calls to skeleton.UpdateWorldTransform(),
|
|
|
+ /// such as after the <see cref="UpdateWorld"/> callback if a method is subscribed at the UpdateWorld delegate.
|
|
|
+ /// </summary>
|
|
|
+ public Skeleton.Physics AdditionalPhysicsUpdate { get { return additionalPhysicsUpdate; } set { additionalPhysicsUpdate = value; } }
|
|
|
#endregion
|
|
|
|
|
|
public override void Initialize (bool overwrite, bool quiet = false) {
|
|
@@ -156,11 +170,11 @@ namespace Spine.Unity {
|
|
|
if (_UpdateLocal != null)
|
|
|
_UpdateLocal(this);
|
|
|
|
|
|
- UpdateWorldTransform();
|
|
|
+ UpdateWorldTransform(mainPhysicsUpdate);
|
|
|
|
|
|
if (_UpdateWorld != null) {
|
|
|
_UpdateWorld(this);
|
|
|
- UpdateWorldTransform();
|
|
|
+ UpdateWorldTransform(additionalPhysicsUpdate);
|
|
|
}
|
|
|
|
|
|
if (_UpdateComplete != null)
|