mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-09 08:38:43 +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);
|
||||
|
||||
#if UNITY_EDITOR
|
||||
if (Application.isEditor)
|
||||
if (Application.isEditor) {
|
||||
LateUpdate();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -91,7 +92,9 @@ namespace Spine.Unity {
|
||||
var thisTransform = this.transform as RectTransform;
|
||||
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) {
|
||||
// Recommended setup: Use local transform properties if Spine GameObject is the immediate parent
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user