#if UNITY_EDITOR using Sirenix.OdinInspector; using Sirenix.OdinInspector.Editor; using System; using UnityEngine; namespace UguiToolkit.Editor.Windows { public class EditWindow : BaseWindow { /// /// 当是否显示预览实例发生改变时 /// public event Action showHierarchyOfEntityChanged; /// /// 背景显示发生改变 /// public event Action showBackgroundChanged; /// /// 创建所有TextEntity /// public event Action createAllTextEntity; /// /// 创建所有PrefabEntity /// public event Action createAllPrefabEntity; /// /// 应用上次变换 /// public event Action effectLastApplyTransform; /// /// 应用上次变换 /// public event Action recoverDataSelectionObjCache; [SerializeField, HideInInspector] private bool m_showHierarchyOfEntityChange = false; [SerializeField, HideInInspector] private bool m_showBackground = true; [LabelText("Hierarchy是否显示"), ShowInInspector] private bool ShowHierarchyOfEntity { get => m_showHierarchyOfEntityChange; set { m_showHierarchyOfEntityChange = value; showHierarchyOfEntityChanged?.Invoke(m_showHierarchyOfEntityChange); } } [LabelText("背景是否显示"), ShowInInspector] private bool ShowBackground { get => m_showBackground; set { m_showBackground = value; showBackgroundChanged?.Invoke(m_showBackground); } } [Button("创建所有Text")] private void CreateAllTextEntity() { createAllTextEntity?.Invoke(); } [Button("创建所有通用预制体")] private void CreateAllPrefabEntity() { createAllPrefabEntity?.Invoke(); } [Title("工具")] [LabelText("需要应用变换的对象"), SerializeField] private Transform m_targetTransform; [Button("应用上次变换 (SPACE)")] private void EffectLastApplyTransform() { if (m_targetTransform) { effectLastApplyTransform?.Invoke(m_targetTransform); } } [Button("恢复子节点位置 (CTRL + SPACE)")] private void RecoverDataSelectionObjCache() { recoverDataSelectionObjCache?.Invoke(); } public override string GettitleContent() { return "助手编辑界面"; } public override void Init(WindowArgs args = null) { } } } #endif