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

99 lines
2.6 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-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-09 11:18:10 +00:00
[Title("<22><><EFBFBD><EFBFBD>")]
[LabelText("<22>ϴα<CEB1>Ķ<EFBFBD><C4B6><EFBFBD>"), SerializeField]
private IEntity m_lastApplyEntity;
[LabelText("<22><>ҪӦ<D2AA>ñ任<C3B1>Ķ<EFBFBD><C4B6><EFBFBD>"), SerializeField]
private Transform m_targetTransform;
[Button("Ӧ<><D3A6><EFBFBD>ϴα任")]
private void EffectLastApplyTransform()
{
if (m_targetTransform)
{
var m_lastApplyTransform = m_lastApplyEntity.gameObject.transform;
var parent = m_lastApplyTransform.parent;
m_lastApplyTransform.parent = null;
m_lastApplyEntity.ApplyTransformByParent(m_targetTransform);
m_lastApplyTransform.parent = parent;
}
}
public void SetLastApplyEntity(IEntity lastApplyTransform)
{
this.m_lastApplyEntity = lastApplyTransform;
}
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