using UnityEditor;
using UnityEngine;

[CustomEditor(typeof(OptitrackSkeletonAnimator_Meechu))]
public class OptitrackSkeletonAnimatorEditor : Editor
{
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        OptitrackSkeletonAnimator_Meechu skeletonAnimator = (OptitrackSkeletonAnimator_Meechu)target;

        GUILayout.Space(10);
        EditorGUILayout.LabelField("스켈레톤 상태", EditorStyles.boldLabel);

        GUI.backgroundColor = skeletonAnimator.isSkeletonFound ? Color.green : Color.red;
        EditorGUILayout.BeginHorizontal(EditorStyles.helpBox);
        GUILayout.Label(skeletonAnimator.isSkeletonFound ? "연결됨" : "연결 안됨", 
            new GUIStyle(EditorStyles.boldLabel) { alignment = TextAnchor.MiddleCenter });
        EditorGUILayout.EndHorizontal();
        GUI.backgroundColor = Color.white;

        if (skeletonAnimator.isSkeletonFound)
        {
            EditorGUILayout.LabelField($"스켈레톤 이름: {skeletonAnimator.SkeletonAssetName}");
        }
        else
        {
            EditorGUILayout.HelpBox("Motive에서 스켈레톤이 활성화되어 있는지 확인해주세요.", MessageType.Warning);
        }

        GUILayout.Space(10);
    }
} 