com.soviby.unity.ui.ugui-to.../Assets/Editor/Windows/EditWindow.cs

104 lines
2.5 KiB
C#
Raw Normal View History

2024-12-06 10:46:00 +00:00
#if UNITY_EDITOR
2024-10-28 16:31:38 +00:00
using Sirenix.OdinInspector;
using Sirenix.OdinInspector.Editor;
2024-12-06 10:46:00 +00:00
using System;
2024-10-28 16:31:38 +00:00
using UnityEngine;
namespace UguiToolkit.Editor.Windows
{
public class EditWindow : BaseWindow<EditWindow>
{
2024-12-06 10:46:00 +00:00
/// <summary>
/// <20><><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>ʾԤ<CABE><D4A4>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD>ʱ
/// </summary>
public event Action<bool> showHierarchyOfEntityChanged;
/// <summary>
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD>
/// </summary>
public event Action<bool> showBackgroundChanged;
/// <summary>
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>TextEntity
/// </summary>
public event Action createAllTextEntity;
2024-12-10 10:14:38 +00:00
/// <summary>
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>PrefabEntity
/// </summary>
public event Action createAllPrefabEntity;
/// <summary>
/// Ӧ<><D3A6><EFBFBD>ϴα
/// </summary>
public event Action<Transform> effectLastApplyTransform;
2024-12-06 10:46:00 +00:00
2024-10-28 16:31:38 +00:00
[SerializeField, HideInInspector]
private bool m_showHierarchyOfEntityChange = false;
2024-12-03 05:05:13 +00:00
[SerializeField, HideInInspector]
private bool m_showBackground = true;
[LabelText("Hierarchy<68>Ƿ<EFBFBD><C7B7><EFBFBD>ʾ"), ShowInInspector]
private bool ShowHierarchyOfEntity
2024-10-28 16:31:38 +00:00
{
get => m_showHierarchyOfEntityChange;
set
{
m_showHierarchyOfEntityChange = value;
2024-12-06 10:46:00 +00:00
showHierarchyOfEntityChanged?.Invoke(m_showHierarchyOfEntityChange);
2024-10-28 16:31:38 +00:00
}
}
2024-12-03 05:05:13 +00:00
[LabelText("<22><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>ʾ"), ShowInInspector]
private bool ShowBackground
{
get => m_showBackground;
set
2024-12-06 10:46:00 +00:00
{
2024-12-03 05:05:13 +00:00
m_showBackground = value;
2024-12-06 10:46:00 +00:00
showBackgroundChanged?.Invoke(m_showBackground);
2024-12-03 05:05:13 +00:00
}
}
[Button("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Text")]
private void CreateAllTextEntity()
{
2024-12-06 10:46:00 +00:00
createAllTextEntity?.Invoke();
2024-12-03 05:05:13 +00:00
}
2024-12-10 10:14:38 +00:00
[Button("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD>")]
private void CreateAllPrefabEntity()
{
createAllPrefabEntity?.Invoke();
}
2024-12-09 11:18:10 +00:00
[Title("<22><><EFBFBD><EFBFBD>")]
[LabelText("<22><>ҪӦ<D2AA>ñ任<C3B1>Ķ<EFBFBD><C4B6><EFBFBD>"), SerializeField]
private Transform m_targetTransform;
2024-12-10 10:14:38 +00:00
[Button("Ӧ<><D3A6><EFBFBD>ϴα任 (SPACE)")]
2024-12-09 11:18:10 +00:00
private void EffectLastApplyTransform()
{
if (m_targetTransform)
{
2024-12-10 10:14:38 +00:00
effectLastApplyTransform?.Invoke(m_targetTransform);
2024-12-09 11:18:10 +00:00
}
}
2024-10-28 16:31:38 +00:00
public override string GettitleContent()
{
return "<22><><EFBFBD>ֱ༭<D6B1><E0BCAD><EFBFBD><EFBFBD>";
}
public override void Init(WindowArgs args = null)
{
}
}
}
2024-12-06 10:46:00 +00:00
#endif