mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
[unity] Fixed BoneFollowerGraphic throwing null reference exception if it has no Canvas parent. Closes #1603.
This commit is contained in:
parent
28ab23d6d0
commit
c568169821
@ -131,7 +131,7 @@ namespace Spine.Unity {
|
||||
|
||||
var canvas = skeletonGraphic.canvas;
|
||||
if (canvas == null) canvas = skeletonGraphic.GetComponentInParent<Canvas>();
|
||||
float scale = canvas.referencePixelsPerUnit;
|
||||
float scale = canvas != null ? canvas.referencePixelsPerUnit : 100.0f;
|
||||
|
||||
if (skeletonTransformIsParent) {
|
||||
// Recommended setup: Use local transform properties if Spine GameObject is the immediate parent
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user