override public void OnInspectorGUI()
        {
            if (needsReset)
            {
                component.Initialize();
                component.LateUpdate();
                needsReset = false;
                SceneView.RepaintAll();
            }
            serializedObject.Update();

            // FindRenderer()
            if (skeletonRenderer.objectReferenceValue == null)
            {
                SkeletonRenderer parentRenderer = BoneFollowerInspector.GetInParent <SkeletonRenderer>(component.transform);

                if (parentRenderer != null)
                {
                    Debug.Log("Inspector automatically assigned BoneFollower.SkeletonRenderer");
                    skeletonRenderer.objectReferenceValue = parentRenderer;
                }
            }

            EditorGUILayout.PropertyField(skeletonRenderer);

            if (component.valid)
            {
                EditorGUI.BeginChangeCheck();
                EditorGUILayout.PropertyField(boneName);
                if (EditorGUI.EndChangeCheck())
                {
                    serializedObject.ApplyModifiedProperties();
                    needsReset = true;
                    serializedObject.Update();
                }

                EditorGUILayout.PropertyField(followBoneRotation);
                EditorGUILayout.PropertyField(followZPosition);
            }
            else
            {
                GUILayout.Label("INVALID");
            }

            if (serializedObject.ApplyModifiedProperties() ||
                (UnityEngine.Event.current.type == EventType.ValidateCommand && UnityEngine.Event.current.commandName == "UndoRedoPerformed")
                )
            {
                component.Initialize();
            }
        }
        override public void OnInspectorGUI()
        {
            if (needsReset)
            {
                targetBoneFollower.Initialize();
                targetBoneFollower.LateUpdate();
                needsReset = false;
                SceneView.RepaintAll();
            }
            serializedObject.Update();

            // Find Renderer
            if (skeletonRenderer.objectReferenceValue == null)
            {
                SkeletonRenderer parentRenderer = BoneFollowerInspector.GetInParent <SkeletonRenderer>(targetBoneFollower.transform);
                if (parentRenderer != null)
                {
                    Debug.Log("Inspector automatically assigned BoneFollower.SkeletonRenderer");
                    skeletonRenderer.objectReferenceValue = parentRenderer;
                }
            }

            EditorGUILayout.PropertyField(skeletonRenderer);

            if (targetBoneFollower.valid)
            {
                EditorGUI.BeginChangeCheck();
                EditorGUILayout.PropertyField(boneName);
                if (EditorGUI.EndChangeCheck())
                {
                    serializedObject.ApplyModifiedProperties();
                    needsReset = true;
                    serializedObject.Update();
                }
                EditorGUILayout.PropertyField(followBoneRotation);
                EditorGUILayout.PropertyField(followZPosition);
            }
            else
            {
                var boneFollowerSkeletonRenderer = targetBoneFollower.skeletonRenderer;
                if (boneFollowerSkeletonRenderer == null)
                {
                    EditorGUILayout.HelpBox("SkeletonRenderer is unassigned. Please assign a SkeletonRenderer (SkeletonAnimation or SkeletonAnimator).", MessageType.Warning);
                }
                else
                {
                    boneFollowerSkeletonRenderer.Initialize(false);

                    if (boneFollowerSkeletonRenderer.skeletonDataAsset == null)
                    {
                        EditorGUILayout.HelpBox("Assigned SkeletonRenderer does not have SkeletonData assigned to it.", MessageType.Warning);
                    }

                    if (!boneFollowerSkeletonRenderer.valid)
                    {
                        EditorGUILayout.HelpBox("Assigned SkeletonRenderer is invalid. Check target SkeletonRenderer, its SkeletonDataAsset or the console for other errors.", MessageType.Warning);
                    }
                }
            }

            var  current = UnityEngine.Event.current;
            bool wasUndo = (current.type == EventType.ValidateCommand && current.commandName == "UndoRedoPerformed");

            if (serializedObject.ApplyModifiedProperties() || wasUndo)
            {
                targetBoneFollower.Initialize();
            }
        }