DrawBones() public static method

public static DrawBones ( Transform transform, Skeleton skeleton ) : void
transform UnityEngine.Transform
skeleton Spine.Skeleton
return void
        public void OnSceneGUI()
        {
            var tbf = target as BoneFollowerGraphic;
            var skeletonGraphicComponent = tbf.SkeletonGraphic;

            if (skeletonGraphicComponent == null)
            {
                return;
            }

            var   transform     = skeletonGraphicComponent.transform;
            var   skeleton      = skeletonGraphicComponent.Skeleton;
            var   canvas        = skeletonGraphicComponent.canvas;
            float positionScale = canvas == null ? 1f : skeletonGraphicComponent.canvas.referencePixelsPerUnit;

            if (string.IsNullOrEmpty(boneName.stringValue))
            {
                SpineHandles.DrawBones(transform, skeleton, positionScale);
                SpineHandles.DrawBoneNames(transform, skeleton, positionScale);
                Handles.Label(tbf.transform.position, "No bone selected", EditorStyles.helpBox);
            }
            else
            {
                var targetBone = tbf.bone;
                if (targetBone == null)
                {
                    return;
                }

                SpineHandles.DrawBoneWireframe(transform, targetBone, SpineHandles.TransformContraintColor, positionScale);
                Handles.Label(targetBone.GetWorldPosition(transform, positionScale), targetBone.Data.Name, SpineHandles.BoneNameStyle);
            }
        }
Exemplo n.º 2
0
        public void OnSceneGUI()
        {
            var tbf = target as BoneFollower;
            var skeletonRendererComponent = tbf.skeletonRenderer;

            if (skeletonRendererComponent == null)
            {
                return;
            }

            var transform = skeletonRendererComponent.transform;
            var skeleton  = skeletonRendererComponent.skeleton;

            if (string.IsNullOrEmpty(tbf.boneName))
            {
                SpineHandles.DrawBones(transform, skeleton);
                SpineHandles.DrawBoneNames(transform, skeleton);
                Handles.Label(tbf.transform.position, "No bone selected", EditorStyles.helpBox);
            }
            else
            {
                var targetBone = tbf.bone;
                if (targetBone == null)
                {
                    return;
                }
                SpineHandles.DrawBoneWireframe(transform, targetBone, SpineHandles.TransformContraintColor);
                Handles.Label(targetBone.GetWorldPosition(transform), targetBone.Data.Name, SpineHandles.BoneNameStyle);
            }
        }
        public void OnSceneGUI()
        {
            var skeletonRenderer = (SkeletonRenderer)target;
            var skeleton         = skeletonRenderer.skeleton;
            var transform        = skeletonRenderer.transform;

            if (skeleton == null)
            {
                return;
            }

            if (showPaths)
            {
                SpineHandles.DrawPaths(transform, skeleton);
            }
            SpineHandles.DrawBones(transform, skeleton);
            if (showConstraints)
            {
                SpineHandles.DrawConstraints(transform, skeleton);
            }
            if (showBoneNames)
            {
                SpineHandles.DrawBoneNames(transform, skeleton);
            }
            if (showShapes)
            {
                SpineHandles.DrawBoundingBoxes(transform, skeleton);
            }
        }
Exemplo n.º 4
0
        public void OnSceneGUI()
        {
            var skeletonRenderer = (SkeletonRenderer)target;

            if (loadingFailed)
            {
                return;
            }

            var skeleton = skeletonRenderer.Skeleton;

            if (skeleton == null)
            {
                loadingFailed = true;
                return;
            }
            var transform = skeletonRenderer.transform;

            if (skeleton == null)
            {
                return;
            }

            SpineHandles.DrawBones(transform, skeleton);
        }
        public void OnSceneGUI()
        {
            var skeletonRenderer = (SkeletonRenderer)target;
            var skeleton         = skeletonRenderer.Skeleton;
            var transform        = skeletonRenderer.transform;

            if (skeleton == null)
            {
                return;
            }

            SpineHandles.DrawBones(transform, skeleton);
        }