using System;
using UnityEngine;
using UnityEngine.UI;
using static SerializableBone;

namespace KF3.UI.Panels
{
    public class HandleSettingsPanel : MonoBehaviour
    {
        public ScrollRect HandleVisibilityToggles;

        private void Start()
        {
            var handleManager = HandleManager.Instance;
            foreach (BoneTags en in Enum.GetValues(typeof(BoneTags)))
            {
                var handle = SliderPanel.CreateToggle(en.ToString(), handleManager.EnabledHandles.Contains(en), HandleVisibilityToggles.content, (value)=>
                {
                    if (value)
                    {
                        handleManager.EnabledHandles.Add(en);
                    }
                    else
                    {
                        handleManager.EnabledHandles.Remove(en);
                    }
                });
            }
        }
    }
}
