mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[unity] Handle BoneFollowerGraphic error on editor instantiate.
This commit is contained in:
parent
093d06cfdb
commit
8ee47b2f5a
@ -66,8 +66,9 @@ namespace Spine.Unity {
|
|||||||
bone = skeletonGraphic.Skeleton.FindBone(boneName);
|
bone = skeletonGraphic.Skeleton.FindBone(boneName);
|
||||||
|
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
if (Application.isEditor)
|
if (Application.isEditor) {
|
||||||
LateUpdate();
|
LateUpdate();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,7 +92,9 @@ namespace Spine.Unity {
|
|||||||
var thisTransform = this.transform as RectTransform;
|
var thisTransform = this.transform as RectTransform;
|
||||||
if (thisTransform == null) return;
|
if (thisTransform == null) return;
|
||||||
|
|
||||||
float scale = skeletonGraphic.canvas.referencePixelsPerUnit;
|
var canvas = skeletonGraphic.canvas;
|
||||||
|
if (canvas == null) canvas = skeletonGraphic.GetComponentInParent<Canvas>();
|
||||||
|
float scale = canvas.referencePixelsPerUnit;
|
||||||
|
|
||||||
if (skeletonTransformIsParent) {
|
if (skeletonTransformIsParent) {
|
||||||
// Recommended setup: Use local transform properties if Spine GameObject is the immediate parent
|
// Recommended setup: Use local transform properties if Spine GameObject is the immediate parent
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user