mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 22:34:53 +08:00
[unity] PhysicsConstraints: Fixed a potential bug with last position and rotation being reset too early in Initialize().
This commit is contained in:
parent
e65f3f61a5
commit
b5f6e8066f
@ -711,8 +711,6 @@ namespace Spine.Unity {
|
||||
}
|
||||
|
||||
public void Initialize (bool overwrite) {
|
||||
ResetLastPositionAndRotation();
|
||||
|
||||
if (this.IsValid && !overwrite) return;
|
||||
#if UNITY_EDITOR
|
||||
if (BuildUtilities.IsInSkeletonAssetBuildPreProcessing)
|
||||
@ -733,6 +731,8 @@ namespace Spine.Unity {
|
||||
baseTexture = skeletonDataAsset.atlasAssets[0].PrimaryMaterial.mainTexture;
|
||||
canvasRenderer.SetTexture(this.mainTexture); // Needed for overwriting initializations.
|
||||
|
||||
ResetLastPositionAndRotation();
|
||||
|
||||
// Set the initial Skin and Animation
|
||||
if (!string.IsNullOrEmpty(initialSkinName))
|
||||
skeleton.SetSkin(initialSkinName);
|
||||
|
||||
@ -396,8 +396,6 @@ namespace Spine.Unity {
|
||||
/// Initialize this component. Attempts to load the SkeletonData and creates the internal Skeleton object and buffers.</summary>
|
||||
/// <param name="overwrite">If set to <c>true</c>, it will overwrite internal objects if they were already generated. Otherwise, the initialized component will ignore subsequent calls to initialize.</param>
|
||||
public virtual void Initialize (bool overwrite, bool quiet = false) {
|
||||
ResetLastPositionAndRotation();
|
||||
|
||||
if (valid && !overwrite)
|
||||
return;
|
||||
#if UNITY_EDITOR
|
||||
@ -434,6 +432,8 @@ namespace Spine.Unity {
|
||||
ScaleY = initialFlipY ? -1 : 1
|
||||
};
|
||||
|
||||
ResetLastPositionAndRotation();
|
||||
|
||||
if (!string.IsNullOrEmpty(initialSkinName) && !string.Equals(initialSkinName, "default", System.StringComparison.Ordinal))
|
||||
skeleton.SetSkin(initialSkinName);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user