using System; using UnityEngine; using UnityEngine.UIElements; namespace UnityEditor.U2D.Animation { internal class PastePanel : VisualElement { public class PastePanelFactory : UxmlFactory {} public class PastePanelUxmlTraits : UxmlTraits {} public event Action onPasteActivated = (bones, mesh, flipX, flipY) => {}; private Toggle m_BonesToggle; private Toggle m_MeshToggle; private Toggle m_FlipXToggle; private Toggle m_FlipYToggle; public bool bones { get { return m_BonesToggle.value; } set { m_BonesToggle.value = value; } } public bool mesh { get { return m_MeshToggle.value; } set { m_MeshToggle.value = value; } } public bool flipX { get { return m_FlipXToggle.value; } set { m_FlipXToggle.value = value; } } public bool flipY { get { return m_FlipYToggle.value; } set { m_FlipYToggle.value = value; } } public PastePanel() { styleSheets.Add(ResourceLoader.Load("SkinningModule/PastePanelStyle.uss")); if (EditorGUIUtility.isProSkin) AddToClassList("Dark"); RegisterCallback((e) => { e.StopPropagation(); }); RegisterCallback((e) => { e.StopPropagation(); }); } public void BindElements() { m_BonesToggle = this.Q("BonesField"); m_MeshToggle = this.Q("MeshField"); m_FlipXToggle = this.Q("FlipXField"); m_FlipYToggle = this.Q("FlipYField"); var pasteButton = this.Q