From 7e15f7bd2331a29ba67d8024996da42ff1c948cb Mon Sep 17 00:00:00 2001 From: Mikhail <99481254+DCFApixels@users.noreply.github.com> Date: Thu, 13 Jun 2024 18:04:47 +0800 Subject: [PATCH] update meta --- src/Buildin/UnityComponents.cs | 9 +- src/Buildin/UnityGameCyclieProcesses.cs | 30 +- src/Connectors/AutoEntityCreator.cs | 5 +- src/Connectors/EcsEntityConnect.cs | 5 +- src/Connectors/GameObjectConnect.cs | 5 +- src/Consts.cs | 8 + ...{EcsUnityConsts.cs.meta => Consts.cs.meta} | 0 src/Debug/Editor/SettingsEditor.cs | 59 ++-- src/Debug/Editor/SettingsPrefs.cs | 72 +++-- src/Debug/Monitors/EntityMonitor.cs | 4 +- src/Debug/Monitors/PipelineMonitor.cs | 8 +- src/Debug/Monitors/PipelineProcessMonitor.cs | 4 +- src/Debug/Monitors/WorldMonitor.cs | 8 +- src/DragonDocs/DragonDocs.cs | 4 +- src/DragonDocs/DragonDocsMeta.cs | 33 ++- src/DragonDocs/Editors/DragonDocsPrefs.cs | 26 +- src/DragonDocs/Editors/DragonDocsWindow.cs | 257 +++++++++++++++--- src/EcsUnityConsts.cs | 7 - .../Templates/MonoEntityTemplate.cs | 7 +- .../Templates/ScriptableEntityTemplate.cs | 7 +- src/Icons/Icons.cs | 18 +- src/Icons/Icons.cs.meta | 19 +- src/Icons/LabelIconMeta.png | Bin 0 -> 2631 bytes src/Icons/LabelIconMeta.png.meta | 122 +++++++++ src/Icons/LabelIconType.png | Bin 0 -> 2538 bytes src/Icons/LabelIconType.png.meta | 122 +++++++++ src/Icons/SearchIcon.png | Bin 0 -> 2642 bytes src/Icons/SearchIcon.png.meta | 122 +++++++++ src/Icons/VisibilityIconOff.png | Bin 0 -> 2243 bytes src/Icons/VisibilityIconOff.png.meta | 122 +++++++++ src/Icons/VisibilityIconOn.png | Bin 0 -> 2089 bytes src/Icons/VisibilityIconOn.png.meta | 122 +++++++++ src/Internal/Editor/EcsGUI.cs | 62 ++++- src/Resources/Icons.asset | 5 + 34 files changed, 1107 insertions(+), 165 deletions(-) create mode 100644 src/Consts.cs rename src/{EcsUnityConsts.cs.meta => Consts.cs.meta} (100%) delete mode 100644 src/EcsUnityConsts.cs create mode 100644 src/Icons/LabelIconMeta.png create mode 100644 src/Icons/LabelIconMeta.png.meta create mode 100644 src/Icons/LabelIconType.png create mode 100644 src/Icons/LabelIconType.png.meta create mode 100644 src/Icons/SearchIcon.png create mode 100644 src/Icons/SearchIcon.png.meta create mode 100644 src/Icons/VisibilityIconOff.png create mode 100644 src/Icons/VisibilityIconOff.png.meta create mode 100644 src/Icons/VisibilityIconOn.png create mode 100644 src/Icons/VisibilityIconOn.png.meta diff --git a/src/Buildin/UnityComponents.cs b/src/Buildin/UnityComponents.cs index 3aef8c9..4667424 100644 --- a/src/Buildin/UnityComponents.cs +++ b/src/Buildin/UnityComponents.cs @@ -1,4 +1,5 @@ -using System; +using DCFApixels.DragonECS.Unity; +using System; using System.Collections; using System.Collections.Generic; using System.Runtime.CompilerServices; @@ -14,9 +15,9 @@ namespace DCFApixels.DragonECS public static readonly MetaGroup JointGroup = new MetaGroup($"{UNITY_COMPONENT_NAME}/Joint/"); } [Serializable] - [MetaColor(255 / 3, 255, 0)] - [MetaGroup(UnityComponentConsts.UNITY_COMPONENT_NAME)] - [MetaDescription(EcsConsts.AUTHOR, "Component-reference to Unity object for EcsPool")] + [MetaColor(MetaColor.Cyan)] + [MetaGroup(EcsUnityConsts.PACK_GROUP, EcsConsts.COMPONENTS_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, "Component-reference to Unity object for EcsPool.")] public struct UnityComponent : IEcsComponent, IEnumerable//IntelliSense hack where T : Component { diff --git a/src/Buildin/UnityGameCyclieProcesses.cs b/src/Buildin/UnityGameCyclieProcesses.cs index 0295178..198ea19 100644 --- a/src/Buildin/UnityGameCyclieProcesses.cs +++ b/src/Buildin/UnityGameCyclieProcesses.cs @@ -1,22 +1,29 @@ using DCFApixels.DragonECS.RunnersCore; +using DCFApixels.DragonECS.Unity; using DCFApixels.DragonECS.Unity.Internal; namespace DCFApixels.DragonECS { [MetaName(nameof(DrawGizmos))] - [MetaColor(MetaColor.Orange)] + [MetaColor(MetaColor.DragonRose)] + [MetaGroup(EcsUnityConsts.PACK_GROUP, EcsConsts.PROCESSES_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, "The process to run when EcsPipeline.DrawGizmos() is called.")] public interface IEcsGizmosProcess : IEcsProcess { public void DrawGizmos(); } [MetaName(nameof(LateRun))] - [MetaColor(MetaColor.Orange)] + [MetaColor(MetaColor.DragonRose)] + [MetaGroup(EcsUnityConsts.PACK_GROUP, EcsConsts.PROCESSES_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, "The process to run when EcsPipeline.LateRun() is called.")] public interface IEcsLateRunProcess : IEcsProcess { public void LateRun(); } [MetaName(nameof(FixedRun))] - [MetaColor(MetaColor.Orange)] + [MetaColor(MetaColor.DragonRose)] + [MetaGroup(EcsUnityConsts.PACK_GROUP, EcsConsts.PROCESSES_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, "The process to run when EcsPipeline.FixedRun() is called.")] public interface IEcsFixedRunProcess : IEcsProcess { public void FixedRun(); @@ -40,8 +47,10 @@ namespace DCFApixels.DragonECS } namespace DCFApixels.DragonECS.Unity.Internal { - - [MetaColor(MetaColor.Orange)] + [MetaColor(MetaColor.DragonRose)] + [MetaGroup(EcsUnityConsts.PACK_GROUP, EcsConsts.PROCESSES_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, "...")] + [MetaTags(MetaTags.HIDDEN)] public class EcsLateGizmosRunner : EcsRunner, IEcsGizmosProcess { #if DEBUG && !DISABLE_DEBUG @@ -74,7 +83,10 @@ namespace DCFApixels.DragonECS.Unity.Internal #endif } - [MetaColor(MetaColor.Orange)] + [MetaColor(MetaColor.DragonRose)] + [MetaGroup(EcsUnityConsts.PACK_GROUP, EcsConsts.PROCESSES_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, "...")] + [MetaTags(MetaTags.HIDDEN)] public class EcsLateRunRunner : EcsRunner, IEcsLateRunProcess { #if DEBUG && !DISABLE_DEBUG @@ -106,7 +118,11 @@ namespace DCFApixels.DragonECS.Unity.Internal } #endif } - [MetaColor(MetaColor.Orange)] + + [MetaColor(MetaColor.DragonRose)] + [MetaGroup(EcsUnityConsts.PACK_GROUP, EcsConsts.PROCESSES_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, "...")] + [MetaTags(MetaTags.HIDDEN)] public class EcsFixedRunRunner : EcsRunner, IEcsFixedRunProcess { #if DEBUG && !DISABLE_DEBUG diff --git a/src/Connectors/AutoEntityCreator.cs b/src/Connectors/AutoEntityCreator.cs index 15a32e9..919f641 100644 --- a/src/Connectors/AutoEntityCreator.cs +++ b/src/Connectors/AutoEntityCreator.cs @@ -1,3 +1,4 @@ +using DCFApixels.DragonECS.Unity; using UnityEngine; namespace DCFApixels.DragonECS @@ -5,8 +6,8 @@ namespace DCFApixels.DragonECS [DisallowMultipleComponent] [AddComponentMenu(EcsConsts.FRAMEWORK_NAME + "/" + nameof(AutoEntityCreator), 30)] [MetaColor(MetaColor.Cyan)] - [MetaGroup(EcsConsts.FRAMEWORK_GROUP, EcsUnityConsts.UNITY_GROUP)] - [MetaDescription(EcsConsts.AUTHOR, "...")] + [MetaGroup(EcsUnityConsts.PACK_GROUP, EcsUnityConsts.ENTITY_BUILDING_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, nameof(MonoBehaviour) + ". Automatically creates an entity in the selected world and connects it to EcsEntityConnect.")] public class AutoEntityCreator : MonoBehaviour { [SerializeField] diff --git a/src/Connectors/EcsEntityConnect.cs b/src/Connectors/EcsEntityConnect.cs index 3e81d66..50fa666 100644 --- a/src/Connectors/EcsEntityConnect.cs +++ b/src/Connectors/EcsEntityConnect.cs @@ -5,6 +5,7 @@ using UnityEngine; #region UNITY_EDITOR using UnityEditor; using DCFApixels.DragonECS.Unity.Internal; +using DCFApixels.DragonECS.Unity; #endregion namespace DCFApixels.DragonECS @@ -57,8 +58,8 @@ namespace DCFApixels.DragonECS [DisallowMultipleComponent] [AddComponentMenu(EcsConsts.FRAMEWORK_NAME + "/" + nameof(EcsEntityConnect), 30)] [MetaColor(MetaColor.Cyan)] - [MetaGroup(EcsConsts.FRAMEWORK_GROUP, EcsUnityConsts.UNITY_GROUP)] - [MetaDescription(EcsConsts.AUTHOR, "...")] + [MetaGroup(EcsUnityConsts.PACK_GROUP, EcsUnityConsts.ENTITY_BUILDING_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, nameof(MonoBehaviour) + ". Responsible for connecting the entity and GameObject using the EcsEntityConnect.ConnectWith method.")] public class EcsEntityConnect : MonoBehaviour { private entlong _entity; diff --git a/src/Connectors/GameObjectConnect.cs b/src/Connectors/GameObjectConnect.cs index bdbd3b4..0f57b23 100644 --- a/src/Connectors/GameObjectConnect.cs +++ b/src/Connectors/GameObjectConnect.cs @@ -1,5 +1,6 @@ using System.Runtime.CompilerServices; using UnityEngine; +using DCFApixels.DragonECS.Unity; #if UNITY_EDITOR using UnityEditor; #endif @@ -7,8 +8,8 @@ using UnityEditor; namespace DCFApixels.DragonECS { [MetaColor(MetaColor.Cyan)] - [MetaGroup(EcsConsts.FRAMEWORK_GROUP, EcsUnityConsts.UNITY_GROUP)] - [MetaDescription(EcsConsts.AUTHOR, "...")] + [MetaGroup(EcsUnityConsts.PACK_GROUP, EcsConsts.COMPONENTS_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, "This component is automatically added if an entity is connected to one of the EcsEntityConnect. It also contains a reference to the connected EcsEntityConnect.")] public readonly struct GameObjectConnect : IEcsComponent, IEcsComponentLifecycle { public readonly EcsEntityConnect Connect; diff --git a/src/Consts.cs b/src/Consts.cs new file mode 100644 index 0000000..95fbc8a --- /dev/null +++ b/src/Consts.cs @@ -0,0 +1,8 @@ +namespace DCFApixels.DragonECS.Unity +{ + public class EcsUnityConsts + { + public const string PACK_GROUP = "_" + EcsConsts.FRAMEWORK_NAME + "/Unity"; + public const string ENTITY_BUILDING_GROUP = "Entity Building"; + } +} diff --git a/src/EcsUnityConsts.cs.meta b/src/Consts.cs.meta similarity index 100% rename from src/EcsUnityConsts.cs.meta rename to src/Consts.cs.meta diff --git a/src/Debug/Editor/SettingsEditor.cs b/src/Debug/Editor/SettingsEditor.cs index be5310a..56990e8 100644 --- a/src/Debug/Editor/SettingsEditor.cs +++ b/src/Debug/Editor/SettingsEditor.cs @@ -41,6 +41,7 @@ namespace DCFApixels.DragonECS.Unity.Editors } private void OnGUI() { + var prefs = SettingsPrefs.instance; float labelWidth = EditorGUIUtility.labelWidth; EditorGUIUtility.labelWidth = 0f; @@ -55,38 +56,35 @@ namespace DCFApixels.DragonECS.Unity.Editors rect.xMin += 9f; GUI.Label(rect, "Settings", EditorStyles.whiteLargeLabel); - EditorGUI.BeginChangeCheck(); - Settings settings = new Settings(); - - GUILayout.BeginHorizontal(); - settings.IsShowHidden = EditorGUILayout.Toggle(SettingsPrefs.instance.IsShowHidden, GUILayout.Width(checkBoxWidth)); - GUILayout.Label(UnityEditorUtility.TransformFieldName(nameof(SettingsPrefs.IsShowHidden)), GUILayout.ExpandWidth(false)); - GUILayout.EndHorizontal(); - - GUILayout.BeginHorizontal(); - settings.IsShowInterfaces = EditorGUILayout.Toggle(SettingsPrefs.instance.IsShowInterfaces, GUILayout.Width(checkBoxWidth)); - GUILayout.Label(UnityEditorUtility.TransformFieldName(nameof(SettingsPrefs.IsShowInterfaces)), GUILayout.ExpandWidth(false)); - GUILayout.EndHorizontal(); - - GUILayout.BeginHorizontal(); - settings.IsShowRuntimeComponents = EditorGUILayout.Toggle(SettingsPrefs.instance.IsShowRuntimeComponents, GUILayout.Width(checkBoxWidth)); - GUILayout.Label(UnityEditorUtility.TransformFieldName(nameof(SettingsPrefs.IsShowRuntimeComponents)), GUILayout.ExpandWidth(false)); - GUILayout.EndHorizontal(); - - settings.AutoColorMode = (ComponentColorMode)EditorGUILayout.EnumPopup(UnityEditorUtility.TransformFieldName(nameof(SettingsPrefs.ComponentColorMode)), SettingsPrefs.instance.ComponentColorMode); - - if (EditorGUI.EndChangeCheck()) + //using (prefs.DisableAutoSave()) { - SettingsPrefs.instance.IsShowHidden = settings.IsShowHidden; - SettingsPrefs.instance.IsShowInterfaces = settings.IsShowInterfaces; - SettingsPrefs.instance.IsShowRuntimeComponents = settings.IsShowRuntimeComponents; - SettingsPrefs.instance.ComponentColorMode = settings.AutoColorMode; + GUILayout.BeginHorizontal(); + prefs.IsShowHidden = EditorGUILayout.Toggle(prefs.IsShowHidden, GUILayout.Width(checkBoxWidth)); + GUILayout.Label(UnityEditorUtility.TransformFieldName(nameof(SettingsPrefs.IsShowHidden)), GUILayout.ExpandWidth(false)); + GUILayout.EndHorizontal(); + + GUILayout.BeginHorizontal(); + prefs.IsShowInterfaces = EditorGUILayout.Toggle(prefs.IsShowInterfaces, GUILayout.Width(checkBoxWidth)); + GUILayout.Label(UnityEditorUtility.TransformFieldName(nameof(SettingsPrefs.IsShowInterfaces)), GUILayout.ExpandWidth(false)); + GUILayout.EndHorizontal(); + + GUILayout.BeginHorizontal(); + prefs.IsShowRuntimeComponents = EditorGUILayout.Toggle(prefs.IsShowRuntimeComponents, GUILayout.Width(checkBoxWidth)); + GUILayout.Label(UnityEditorUtility.TransformFieldName(nameof(SettingsPrefs.IsShowRuntimeComponents)), GUILayout.ExpandWidth(false)); + GUILayout.EndHorizontal(); + + GUILayout.BeginHorizontal(); + prefs.IsUseCustomNames = EditorGUILayout.Toggle(prefs.IsUseCustomNames, GUILayout.Width(checkBoxWidth)); + GUILayout.Label(UnityEditorUtility.TransformFieldName(nameof(SettingsPrefs.IsUseCustomNames)), GUILayout.ExpandWidth(false)); + GUILayout.EndHorizontal(); + + prefs.ComponentColorMode = (ComponentColorMode)EditorGUILayout.EnumPopup(UnityEditorUtility.TransformFieldName(nameof(SettingsPrefs.ComponentColorMode)), prefs.ComponentColorMode); } + GUILayout.EndVertical(); - GUILayout.Space(20f); - using (new EcsGUI.ColorScope(Color.white * 0.5f)) + using (EcsGUI.SetColor(Color.white * 0.5f)) GUILayout.BeginVertical(EditorStyles.helpBox); //using (new EcsGUI.ColorScope(Color.white * 1.2f)) GUILayout.Label("", EditorStyles.toolbar, GUILayout.ExpandWidth(true), GUILayout.Height(22f)); @@ -141,13 +139,6 @@ namespace DCFApixels.DragonECS.Unity.Editors } public static implicit operator DefineSymbolsInfo(string a) => new DefineSymbolsInfo(a, false); } - private struct Settings - { - public bool IsShowHidden; - public bool IsShowInterfaces; - public bool IsShowRuntimeComponents; - public ComponentColorMode AutoColorMode; - } } } #endif \ No newline at end of file diff --git a/src/Debug/Editor/SettingsPrefs.cs b/src/Debug/Editor/SettingsPrefs.cs index a193e42..c81dad2 100644 --- a/src/Debug/Editor/SettingsPrefs.cs +++ b/src/Debug/Editor/SettingsPrefs.cs @@ -13,6 +13,20 @@ namespace DCFApixels.DragonECS.Unity.Editors [FilePath(EcsConsts.AUTHOR + "/" + EcsConsts.FRAMEWORK_NAME + "/" + nameof(SettingsPrefs) + ".prefs", FilePathAttribute.Location.ProjectFolder)] internal class SettingsPrefs : ScriptableSingleton { + [SerializeField] + private bool _isUseCustomNames = true; + public bool IsUseCustomNames + { + get => _isUseCustomNames; + set + { + if (_isUseCustomNames != value) + { + _isUseCustomNames = value; + AutoSave(); + } + } + } [SerializeField] private bool _isShowInterfaces = false; public bool IsShowInterfaces @@ -20,8 +34,11 @@ namespace DCFApixels.DragonECS.Unity.Editors get => _isShowInterfaces; set { - _isShowInterfaces = value; - Save(false); + if (_isShowInterfaces != value) + { + _isShowInterfaces = value; + AutoSave(); + } } } [SerializeField] @@ -31,8 +48,11 @@ namespace DCFApixels.DragonECS.Unity.Editors get => _isShowHidden; set { - _isShowHidden = value; - Save(false); + if (_isShowHidden != value) + { + _isShowHidden = value; + AutoSave(); + } } } [SerializeField] @@ -42,23 +62,26 @@ namespace DCFApixels.DragonECS.Unity.Editors get => _isShowRuntimeComponents; set { - _isShowRuntimeComponents = value; - Save(false); - } - } - - [SerializeField] - private bool _poolsToggle = false; - public bool PoolsToggle - { - get => _poolsToggle; - set - { - _poolsToggle = value; - Save(false); + if (_isShowRuntimeComponents != value) + { + _isShowRuntimeComponents = value; + AutoSave(); + } } } + //[SerializeField] + //private bool _poolsToggle = false; + //public bool PoolsToggle + //{ + // get => _poolsToggle; + // set + // { + // _isChanged = _poolsToggle != value; + // _poolsToggle = value; + // AutoSave(); + // } + //} [SerializeField] private ComponentColorMode _componentColorMode = ComponentColorMode.Auto; @@ -67,10 +90,19 @@ namespace DCFApixels.DragonECS.Unity.Editors get => _componentColorMode; set { - _componentColorMode = value; - Save(false); + if (_componentColorMode != value) + { + _componentColorMode = value; + AutoSave(); + } } } + + private void AutoSave() + { + Save(true); + Debug.Log("AutoSave"); + } } } #endif \ No newline at end of file diff --git a/src/Debug/Monitors/EntityMonitor.cs b/src/Debug/Monitors/EntityMonitor.cs index 6ee1a96..ff521b6 100644 --- a/src/Debug/Monitors/EntityMonitor.cs +++ b/src/Debug/Monitors/EntityMonitor.cs @@ -2,8 +2,10 @@ namespace DCFApixels.DragonECS.Unity.Internal { - [MetaTags(MetaTags.HIDDEN)] [MetaColor(MetaColor.Gray)] + [MetaGroup(EcsUnityConsts.PACK_GROUP, EcsConsts.DEBUG_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, "...")] + [MetaTags(MetaTags.HIDDEN)] internal class EntityMonitor : MonoBehaviour { private entlong _entity; diff --git a/src/Debug/Monitors/PipelineMonitor.cs b/src/Debug/Monitors/PipelineMonitor.cs index b5b1774..ec721b2 100644 --- a/src/Debug/Monitors/PipelineMonitor.cs +++ b/src/Debug/Monitors/PipelineMonitor.cs @@ -3,8 +3,10 @@ using UnityEngine; namespace DCFApixels.DragonECS.Unity.Internal { - [MetaTags(MetaTags.HIDDEN)] [MetaColor(MetaColor.Gray)] + [MetaGroup(EcsUnityConsts.PACK_GROUP, EcsConsts.DEBUG_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, "...")] + [MetaTags(MetaTags.HIDDEN)] internal class PipelineMonitor : MonoBehaviour { private EcsPipeline _pipeline; @@ -18,8 +20,10 @@ namespace DCFApixels.DragonECS.Unity.Internal } } - [MetaTags(MetaTags.HIDDEN)] [MetaColor(MetaColor.Gray)] + [MetaGroup(EcsUnityConsts.PACK_GROUP, EcsConsts.DEBUG_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, "...")] + [MetaTags(MetaTags.HIDDEN)] internal class PipelineMonitorSystem : IEcsInit, IEcsPipelineMember, IEcsDestroy { private PipelineMonitor _monitor; diff --git a/src/Debug/Monitors/PipelineProcessMonitor.cs b/src/Debug/Monitors/PipelineProcessMonitor.cs index 3401463..4106f0e 100644 --- a/src/Debug/Monitors/PipelineProcessMonitor.cs +++ b/src/Debug/Monitors/PipelineProcessMonitor.cs @@ -2,8 +2,10 @@ namespace DCFApixels.DragonECS.Unity.Editors { - [MetaTags(MetaTags.HIDDEN)] [MetaColor(MetaColor.Gray)] + [MetaGroup(EcsUnityConsts.PACK_GROUP, EcsConsts.DEBUG_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, "...")] + [MetaTags(MetaTags.HIDDEN)] internal class PipelineProcessMonitor : MonoBehaviour { private EcsPipeline _pipeline; diff --git a/src/Debug/Monitors/WorldMonitor.cs b/src/Debug/Monitors/WorldMonitor.cs index 5077fe4..435cecd 100644 --- a/src/Debug/Monitors/WorldMonitor.cs +++ b/src/Debug/Monitors/WorldMonitor.cs @@ -4,8 +4,10 @@ using UnityEngine; namespace DCFApixels.DragonECS.Unity.Internal { - [MetaTags(MetaTags.HIDDEN)] [MetaColor(MetaColor.Gray)] + [MetaGroup(EcsUnityConsts.PACK_GROUP, EcsConsts.DEBUG_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, "...")] + [MetaTags(MetaTags.HIDDEN)] internal class WorldMonitor : MonoBehaviour { private EcsWorld _world; @@ -19,8 +21,10 @@ namespace DCFApixels.DragonECS.Unity.Internal } } - [MetaTags(MetaTags.HIDDEN)] [MetaColor(MetaColor.Gray)] + [MetaGroup(EcsUnityConsts.PACK_GROUP, EcsConsts.DEBUG_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, "...")] + [MetaTags(MetaTags.HIDDEN)] internal class WorldMonitorSystem : IEcsInit, IEcsWorldEventListener, IEcsEntityEventListener { private EcsWorld _world; diff --git a/src/DragonDocs/DragonDocs.cs b/src/DragonDocs/DragonDocs.cs index 84f6c92..a4be64a 100644 --- a/src/DragonDocs/DragonDocs.cs +++ b/src/DragonDocs/DragonDocs.cs @@ -11,7 +11,7 @@ namespace DCFApixels.DragonECS.Unity.Docs public class DragonDocs { [DataMember, SerializeField] - private readonly DragonDocsMeta[] _metas; + private DragonDocsMeta[] _metas; public ReadOnlySpan Metas { @@ -42,7 +42,7 @@ namespace DCFApixels.DragonECS.Unity.Docs { foreach (var type in assembly.GetTypes()) { - if (memberType.IsAssignableFrom(type) || Attribute.GetCustomAttributes(type, metaAttributeType, false).Length > 1) + if ((type.IsInterface == false && type.IsAbstract == false && memberType.IsAssignableFrom(type)) || Attribute.GetCustomAttributes(type, metaAttributeType, false).Length > 1) { result.Add(type); } diff --git a/src/DragonDocs/DragonDocsMeta.cs b/src/DragonDocs/DragonDocsMeta.cs index 00db006..17cf780 100644 --- a/src/DragonDocs/DragonDocsMeta.cs +++ b/src/DragonDocs/DragonDocsMeta.cs @@ -12,10 +12,11 @@ namespace DCFApixels.DragonECS.Unity.Docs [NonSerialized] private bool _isInitSourceType = false; [DataMember, SerializeField] internal string _assemblyQualifiedName = string.Empty; - [DataMember, SerializeField] internal EcsMemberType _memberType = EcsMemberType.Undefined; + //[DataMember, SerializeField] internal EcsMemberType _memberType = EcsMemberType.Undefined; [DataMember, SerializeField] internal string _name = string.Empty; [DataMember, SerializeField] internal bool _isCustomName = false; + [DataMember, SerializeField] internal string _typeName = string.Empty; [DataMember, SerializeField] internal MetaColor _color = MetaColor.BlackColor; [DataMember, SerializeField] internal bool _isCustomColor = false; [DataMember, SerializeField] internal string _autor = string.Empty; @@ -24,15 +25,17 @@ namespace DCFApixels.DragonECS.Unity.Docs [DataMember, SerializeField] internal string _group = string.Empty; [DataMember, SerializeField] internal string[] _tags = Array.Empty(); + [DataMember, SerializeField] internal bool _isHidden = false; + public string AssemblyQualifiedName { get { return _assemblyQualifiedName; } } - public EcsMemberType EcsMemberType - { - get { return _memberType; } - } + //public EcsMemberType EcsMemberType + //{ + // get { return _memberType; } + //} public string Name { get { return _name; } @@ -41,6 +44,10 @@ namespace DCFApixels.DragonECS.Unity.Docs { get { return _isCustomName; } } + public string TypeName + { + get { return _typeName; } + } public MetaColor Color { get { return _color; } @@ -65,15 +72,20 @@ namespace DCFApixels.DragonECS.Unity.Docs { get { return _tags; } } + public bool IsHidden + { + get { return _isHidden; } + } public DragonDocsMeta(TypeMeta meta) { _sourceType = meta.Type; _assemblyQualifiedName = meta.Type.AssemblyQualifiedName; - _memberType = meta.EcsMemberType; + //_memberType = meta.EcsMemberType; _name = meta.Name; _isCustomName = meta.IsCustomName; + _typeName = meta.TypeName; _color = meta.Color; _isCustomColor = meta.IsCustomColor; _autor = meta.Description.Author; @@ -94,6 +106,8 @@ namespace DCFApixels.DragonECS.Unity.Docs { _tags[i] = meta.Tags[i]; } + + _isHidden = meta.IsHidden; } public bool TryGetSourceType(out Type type) @@ -111,11 +125,8 @@ namespace DCFApixels.DragonECS.Unity.Docs int IComparable.CompareTo(DragonDocsMeta other) { - // int c = string.Compare(_group, other._group); - // //return c == 0 ? c : string.Compare(_name, other._name); - // return c; - int c = string.Compare(_name, other._name); - return c == 0 ? c : string.Compare(_group, other._group); + int c = string.Compare(_group, other._group); + return c == 0 ? string.Compare(_name, other._name) : c; } } } \ No newline at end of file diff --git a/src/DragonDocs/Editors/DragonDocsPrefs.cs b/src/DragonDocs/Editors/DragonDocsPrefs.cs index 621a4f2..cd0b929 100644 --- a/src/DragonDocs/Editors/DragonDocsPrefs.cs +++ b/src/DragonDocs/Editors/DragonDocsPrefs.cs @@ -9,19 +9,19 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors [FilePath(EcsConsts.AUTHOR + "/" + EcsConsts.FRAMEWORK_NAME + "/" + nameof(DragonDocsPrefs) + ".prefs", FilePathAttribute.Location.ProjectFolder)] internal class DragonDocsPrefs : ScriptableSingleton { - [SerializeField] private DragonDocs _docs; - [SerializeField] private bool[] _isExpands; + [SerializeField] private DragonDocs m_docs; + [SerializeField] private bool[] m_isExpands; [NonSerialized] private bool _isInitInfos = false; [NonSerialized] private MetaGroupInfo[] _infos = null; public DragonDocs Docs { - get { return _docs; } + get { return m_docs; } } public Span IsExpands { - get { return new Span(_isExpands, 0, _docs.Metas.Length); } + get { return new Span(m_isExpands, 0, m_docs.Metas.Length); } } public ReadOnlySpan Infos { @@ -36,7 +36,7 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors { if (_isInitInfos) { return; } ReadOnlySpan metas; - if (_docs == null || (metas = _docs.Metas).IsEmpty) + if (m_docs == null || (metas = m_docs.Metas).IsEmpty) { _infos = Array.Empty(); _isInitInfos = true; @@ -53,7 +53,7 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors { if (string.IsNullOrEmpty(groupPath)) { - groups.Add(new MetaGroupInfo("", "", startIndex, i - startIndex, 0)); + groups.Add(new MetaGroupInfo("", "", startIndex, i - startIndex, 0)); } else { @@ -73,12 +73,12 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors private void AddInfo(List infos, string path, int startIndex, int length) { MetaGroupInfo lastInfo = infos[infos.Count - 1]; - if (lastInfo.Depth == 0) { lastInfo = new MetaGroupInfo("", "", 0, 0, 0); } - int depth = 1; + //if (lastInfo.Depth == 0) { lastInfo = new MetaGroupInfo("", "", 0, 0, 0); } + int depth = 0; int lastSeparatorIndex = 0; int i = 0; int nameLength = 0; - if(lastInfo.Path.Length <= path.Length) + //if(lastInfo.Path.Length <= path.Length) { for (int j = 0, jMax = lastInfo.Path.Length; j < jMax; j++) { @@ -123,11 +123,11 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors public void Save(DragonDocs docs) { - _docs = docs; - if(_isExpands == null || _isExpands.Length != docs.Metas.Length) + m_docs = docs; + if(m_isExpands == null || m_isExpands.Length != docs.Metas.Length) { - Array.Resize(ref _isExpands, docs.Metas.Length); - _isExpands[0] = true; + Array.Resize(ref m_isExpands, docs.Metas.Length); + m_isExpands[0] = true; } _isInitInfos = false; _infos = null; diff --git a/src/DragonDocs/Editors/DragonDocsWindow.cs b/src/DragonDocs/Editors/DragonDocsWindow.cs index 12e38a1..c84b3a6 100644 --- a/src/DragonDocs/Editors/DragonDocsWindow.cs +++ b/src/DragonDocs/Editors/DragonDocsWindow.cs @@ -1,6 +1,7 @@ #if UNITY_EDITOR using DCFApixels.DragonECS.Unity.Editors; using DCFApixels.DragonECS.Unity.Internal; +using System.Collections.Generic; using UnityEditor; using UnityEngine; @@ -13,6 +14,7 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors { var wnd = GetWindow(); wnd.titleContent = new GUIContent($"{EcsConsts.FRAMEWORK_NAME} Documentation"); + wnd.minSize = new Vector2(100f, 120f); wnd.Show(); } @@ -38,22 +40,51 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors get { return SettingsPrefs.instance.IsShowHidden; } set { SettingsPrefs.instance.IsShowHidden = value; } } + private static bool IsUseCustomNames + { + get { return SettingsPrefs.instance.IsUseCustomNames; } + set { SettingsPrefs.instance.IsUseCustomNames = value; } + } + + + private bool _searchingSampleChanged = false; + private string _searchingSampleEnter = string.Empty; + private string _searchingSample = string.Empty; + private bool[] _searchingHideMetaMap = System.Array.Empty(); + private bool[] _searchingHideGroupMap = System.Array.Empty(); private void OnGUI() { Event current = Event.current; DragonDocs docs = DragonDocsPrefs.instance.Docs; - if(docs == null || docs.Metas.IsEmpty) + var metas = docs.Metas; + if (docs == null || docs.Metas.IsEmpty) { docs = DragonDocs.Generate(); DragonDocsPrefs.instance.Save(docs); } + var infos = DragonDocsPrefs.instance.Infos; + if (_searchingHideMetaMap.Length < metas.Length) + { + System.Array.Resize(ref _searchingHideMetaMap, metas.Length); + } + if (_searchingHideGroupMap.Length < infos.Length) + { + System.Array.Resize(ref _searchingHideGroupMap, DragonDocsPrefs.instance.Infos.Length); + } + if(_selectedIndex < 0 || _selectedIndex >= infos.Length) + { + _selectedIndex = 0; + } + + + DrawToolbar(); GUILayout.BeginHorizontal(GUILayout.ExpandHeight(true)); - ButtonsScrolPosition = GUILayout.BeginScrollView(ButtonsScrolPosition, UnityEditorUtility.GetStyle(Color.black, 0.1f), GUILayout.Width(_buttonsWidth)); + ButtonsScrolPosition = GUILayout.BeginScrollView(ButtonsScrolPosition, UnityEditorUtility.GetStyle(Color.black, 0f), GUILayout.Width(_buttonsWidth)); var selectedGroupInfo = DrawGroups(); GUILayout.EndScrollView(); @@ -66,25 +97,146 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors DrawSelectedGroupMeta(selectedGroupInfo); GUILayout.EndScrollView(); - + //GUILayout.Space(EditorGUIUtility.standardVerticalSpacing * -2f); GUILayout.EndHorizontal(); + Rect r = GUILayoutUtility.GetLastRect(); + float h = r.height; + r.height = EditorGUIUtility.standardVerticalSpacing; + //EditorGUI.DrawRect(r, new Color(0, 0, 0, 0.3f)); + r.y += h; + EditorGUI.DrawRect(r, new Color(0, 0, 0, 0.3f)); + GUI.enabled = true; - IsShowHidden = EditorGUILayout.Toggle("Show Hidden", IsShowHidden); - if (GUILayout.Button("Update")) + + GUILayout.Label(infos[_selectedIndex].Path); + } + + private void DrawToolbar() + { + using (EcsGUI.SetColor(GUI.color * 0.8f)) + GUILayout.BeginHorizontal(EditorStyles.toolbar); + GUILayout.Space(EditorGUIUtility.standardVerticalSpacing * 2f); + + if (GUILayout.Button("Update", EditorStyles.toolbarButton, GUILayout.Width(80f))) { - docs = DragonDocs.Generate(); - DragonDocsPrefs.instance.Save(docs); + DragonDocs docs = DragonDocs.Generate(); + DragonDocsPrefs.instance.Save(docs); + } + + if (EcsGUI.Layout.IconButton(IsShowHidden ? Icons.Instance.VisibilityIconOn : Icons.Instance.VisibilityIconOff, 0f, IsShowHidden ? "Show Hidden" : "Don't Show Hidden", EditorStyles.toolbarButton, GUILayout.Width(EditorGUIUtility.singleLineHeight * 1.6f))) + { + IsShowHidden = !IsShowHidden; + } + + if (EcsGUI.Layout.IconButton(IsUseCustomNames ? Icons.Instance.LabelIconMeta : Icons.Instance.LabelIconType, 1f, IsUseCustomNames ? "Use Meta Name" : "Use Type Name", EditorStyles.toolbarButton, GUILayout.Width(EditorGUIUtility.singleLineHeight * 1.6f))) + { + IsUseCustomNames = !IsUseCustomNames; + } + + GUILayout.Label(""); + EditorGUI.BeginChangeCheck(); + _searchingSampleEnter = EditorGUILayout.TextField(_searchingSampleEnter, EditorStyles.toolbarTextField, GUILayout.ExpandHeight(true), GUILayout.MaxWidth(200f)); + if (EditorGUI.EndChangeCheck()) + { + _searchingSampleChanged = true; + } + if ((_searchingSampleChanged && Event.current.keyCode == KeyCode.Return) || + EcsGUI.Layout.IconButton(Icons.Instance.SearchIcon, 3f, null, EditorStyles.toolbarButton, GUILayout.ExpandHeight(true), GUILayout.Width(EditorGUIUtility.singleLineHeight * 1.6f))) + { + Searh(); + } + GUILayout.Space(EditorGUIUtility.standardVerticalSpacing * 2f); + GUILayout.EndHorizontal(); + + GUILayout.Space(EditorGUIUtility.standardVerticalSpacing * -2f); + } + + private void Searh() + { + _searchingSample = _searchingSampleEnter; + _searchingSampleChanged = false; + DragonDocs docs = DragonDocsPrefs.instance.Docs; + var metas = docs.Metas; + if (_searchingSample.Length <= 0) + { + var infos = DragonDocsPrefs.instance.Infos; + var isExpands = DragonDocsPrefs.instance.IsExpands; + + for (int i = 0; i < _searchingHideMetaMap.Length; i++) + { + _searchingHideMetaMap[i] = false; + } + for (int i = 0; i < _searchingHideGroupMap.Length; i++) + { + _searchingHideGroupMap[i] = false; + } + + { + int i = _selectedIndex; + var info = infos[i]; + int depth = info.Depth; + while (depth > 0) + { + i--; + info = infos[i]; + + if (info.Depth >= depth) + { + continue; + } + + depth = info.Depth; + isExpands[i] = true; + } + } + } + else + { + var infos = DragonDocsPrefs.instance.Infos; + + for (int i = 0; i < infos.Length; i++) + { + var info = infos[i]; + int visibleCount = 0; + bool isUseCustomNames = IsUseCustomNames; + for (int j = info.StartIndex, jMax = j + info.Length; j < jMax; j++) + { + var b = (isUseCustomNames ? metas[j].Name : metas[j].TypeName).Contains(_searchingSample, System.StringComparison.InvariantCultureIgnoreCase); + _searchingHideMetaMap[j] = !b; + + if (b) + { + visibleCount++; + } + } + + _searchingHideGroupMap[i] = visibleCount == 0; + } } } - private void DrawSelectedGroupMeta(MetaGroupInfo info) { + bool hide = IsShowHidden == false; var metas = Prefs.Docs.Metas; - for (int i = 0, j = info.StartIndex; i < info.Length; i++, j++) + int iMax = info.Length; + for (int i = 0, j = info.StartIndex; i < iMax; j++) { - DrawMeta(metas[j], i, 12); + if (_searchingHideMetaMap[j] || (metas[j]._isHidden && hide)) + { + iMax--; + } + else + { + DrawMeta(metas[j], i, 12); + i++; + } + } + + if (iMax <= 0) + { + GUILayout.Label(info.Length <= 0 ? "empty group" : "there are hidden items", EditorStyles.centeredGreyMiniLabel, GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(true)); } } @@ -96,10 +248,19 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors Color alphaPanelColor = panelColor; alphaPanelColor.a = EscEditorConsts.COMPONENT_DRAWER_ALPHA; - GUILayout.BeginVertical(UnityEditorUtility.GetStyle(alphaPanelColor)); GUILayout.Space(1f); - GUILayout.TextArea(meta.Name, EditorStyles.boldLabel); + + GUILayout.BeginHorizontal(); + GUILayout.TextArea(IsUseCustomNames ? meta.Name : meta.TypeName, EditorStyles.boldLabel, GUILayout.ExpandWidth(false)); + if (meta.IsCustomName) + { + using (EcsGUI.SetAlpha(0.64f)) using (EcsGUI.SetAlignment(GUI.skin.label, TextAnchor.MiddleRight)) + { + GUILayout.TextArea(IsUseCustomNames ? meta.TypeName : meta.Name, GUI.skin.label); + } + } + GUILayout.EndHorizontal(); Rect lastRect = GUILayoutUtility.GetLastRect(); if (string.IsNullOrEmpty(meta.Description) == false) @@ -140,21 +301,27 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors private MetaGroupInfo DrawGroups() { + Event current = Event.current; + MetaGroupInfo result = new MetaGroupInfo("NO_NAME", "NO_NAME", 0, 0, 0); + var infos = Prefs.Infos; + var isExpands = Prefs.IsExpands; + using (EcsGUI.SetIndentLevel(0)) { - Event current = Event.current; - MetaGroupInfo result = new MetaGroupInfo("NO_NAME", "NO_NAME", 0, 0, 0); - var infos = Prefs.Infos; - var IsExpands = Prefs.IsExpands; - int clippingDepth = int.MaxValue; - for (int i = 0; i < infos.Length; i++) { + if (_searchingHideGroupMap[i]) { continue; } + var groupInfo = infos[i]; - if (groupInfo.Depth > clippingDepth) + if (i == _selectedIndex) + { + result = groupInfo; + } + + if (_searchingSample.Length == 0 && groupInfo.Depth > clippingDepth) { continue; } @@ -163,47 +330,58 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors clippingDepth = int.MaxValue; } - EditorGUI.indentLevel = groupInfo.Depth; + if(_searchingSample.Length == 0) + { + EditorGUI.indentLevel = groupInfo.Depth; + } - GUIContent label = UnityEditorUtility.GetLabel(groupInfo.Name); + GUIContent label = UnityEditorUtility.GetLabel(_searchingSample.Length == 0 ? groupInfo.Name : groupInfo.Path); Rect r = GUILayoutUtility.GetRect(label, EditorStyles.foldout); if (i == _selectedIndex) { EditorGUI.DrawRect(r, new Color(0.12f, 0.5f, 1f, 0.40f)); - result = groupInfo; } - bool isClick; - using (EcsGUI.SetColor(0, 0, 0, 0)) - using (EcsGUI.Disable) - { - isClick = GUI.Button(r, ""); - } + using (EcsGUI.SetColor(0, 0, 0, 0)) using (EcsGUI.Disable) { GUI.Button(r, ""); } + + bool isClick = false; if (EcsGUI.HitTest(r)) { EditorGUI.DrawRect(r, new Color(1f, 1f, 1f, 0.12f)); - if (current.type == EventType.MouseDown) + if (current.type == EventType.MouseUp) { - _selectedIndex = i; + isClick = true; + + //_selectedIndex = i; + //current.Use(); } } - if (i + 1 == infos.Length || infos[i + 1].Depth <= groupInfo.Depth) + if (_searchingSample.Length != 0 || (i + 1 == infos.Length || infos[i + 1].Depth <= groupInfo.Depth)) { using (EcsGUI.SetBackgroundColor(0, 0, 0, 0)) + { EditorGUI.Foldout(r, false, label, EditorStyles.foldout); + } } else { - IsExpands[i] = EditorGUI.Foldout(r, IsExpands[i], label, EditorStyles.foldout); - if (i == 0) + EditorGUI.BeginChangeCheck(); + isExpands[i] = EditorGUI.Foldout(r, isExpands[i], label, EditorStyles.foldout); + if (EditorGUI.EndChangeCheck()) { - IsExpands[i] = true; + isClick = false; } } - if (IsExpands[i] == false) + if (isClick) + { + _selectedIndex = i; + current.Use(); + } + + if (isExpands[i] == false) { clippingDepth = groupInfo.Depth; } @@ -218,16 +396,15 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors EditorGUI.DrawRect(r, new Color(0.2f, 0.6f, 1f)); } } - - return result; } + return result; } private void DrawDragger() { const float DRAG_RESIZE_WIDTH = 4f; - Rect rect = GUILayoutUtility.GetLastRect(); + Rect rect = GUILayoutUtility.GetLastRect(); float m = DRAG_RESIZE_WIDTH; if (_dragState != DragState.None) { @@ -237,7 +414,7 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors rect.x -= m / 2f; rect.width = m; - EditorGUI.DrawRect(rect.AddPadding(1f, 0), new Color(0,0,0,0.5f)); + EditorGUI.DrawRect(rect.AddPadding(1f, 0), new Color(0, 0, 0, 0.3f)); Event current = Event.current; switch (current.type) @@ -252,7 +429,7 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors } break; case EventType.MouseUp: - if(_dragState != DragState.None) + if (_dragState != DragState.None) { _dragState = DragState.None; current.Use(); diff --git a/src/EcsUnityConsts.cs b/src/EcsUnityConsts.cs deleted file mode 100644 index 6281d53..0000000 --- a/src/EcsUnityConsts.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace DCFApixels.DragonECS -{ - public class EcsUnityConsts - { - public const string UNITY_GROUP = "Unity"; - } -} diff --git a/src/EntityTemplate/Templates/MonoEntityTemplate.cs b/src/EntityTemplate/Templates/MonoEntityTemplate.cs index aa8f6f9..276ec44 100644 --- a/src/EntityTemplate/Templates/MonoEntityTemplate.cs +++ b/src/EntityTemplate/Templates/MonoEntityTemplate.cs @@ -1,4 +1,5 @@ -using DCFApixels.DragonECS.Unity.Internal; +using DCFApixels.DragonECS.Unity; +using DCFApixels.DragonECS.Unity.Internal; using System; using UnityEngine; @@ -12,8 +13,8 @@ namespace DCFApixels.DragonECS [DisallowMultipleComponent] [AddComponentMenu(EcsConsts.FRAMEWORK_NAME + "/" + nameof(MonoEntityTemplate), 30)] [MetaColor(MetaColor.Cyan)] - [MetaGroup(EcsConsts.FRAMEWORK_GROUP, EcsUnityConsts.UNITY_GROUP)] - [MetaDescription(EcsConsts.AUTHOR, "...")] + [MetaGroup(EcsUnityConsts.PACK_GROUP, EcsUnityConsts.ENTITY_BUILDING_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, nameof(MonoBehaviour) + " implementation of an entity template. Templates are a set of components that are applied to entities.")] public class MonoEntityTemplate : MonoEntityTemplateBase, ITemplateInternal { [SerializeReference] diff --git a/src/EntityTemplate/Templates/ScriptableEntityTemplate.cs b/src/EntityTemplate/Templates/ScriptableEntityTemplate.cs index e7c0a99..45e81dc 100644 --- a/src/EntityTemplate/Templates/ScriptableEntityTemplate.cs +++ b/src/EntityTemplate/Templates/ScriptableEntityTemplate.cs @@ -1,4 +1,5 @@ -using DCFApixels.DragonECS.Unity.Internal; +using DCFApixels.DragonECS.Unity; +using DCFApixels.DragonECS.Unity.Internal; using System; using UnityEngine; @@ -10,8 +11,8 @@ namespace DCFApixels.DragonECS } [MetaColor(MetaColor.Cyan)] - [MetaGroup(EcsConsts.FRAMEWORK_GROUP, EcsUnityConsts.UNITY_GROUP)] - [MetaDescription(EcsConsts.AUTHOR, "...")] + [MetaGroup(EcsUnityConsts.PACK_GROUP, EcsUnityConsts.ENTITY_BUILDING_GROUP)] + [MetaDescription(EcsConsts.AUTHOR, nameof(ScriptableObject) + " implementation of an entity template. Templates are a set of components that are applied to entities.")] [CreateAssetMenu(fileName = nameof(ScriptableEntityTemplate), menuName = EcsConsts.FRAMEWORK_NAME + "/" + nameof(ScriptableEntityTemplate), order = 1)] public class ScriptableEntityTemplate : ScriptableEntityTemplateBase, ITemplateInternal { diff --git a/src/Icons/Icons.cs b/src/Icons/Icons.cs index fdd6ccf..802d89a 100644 --- a/src/Icons/Icons.cs +++ b/src/Icons/Icons.cs @@ -4,7 +4,7 @@ namespace DCFApixels.DragonECS.Unity.Internal { internal class Icons : Config { - //Thank f*cking balls, everything inside #if UNITY_EDITOR is not serialized in the release build + //Everything inside #if UNITY_EDITOR is not serialized in the release build #if UNITY_EDITOR [SerializeField] private Texture _helpIcon; @@ -18,12 +18,28 @@ namespace DCFApixels.DragonECS.Unity.Internal private Texture _auotsetIcon; [SerializeField] private Texture _auotsetCascadeIcon; + [SerializeField] + private Texture _searchIcon; + [SerializeField] + private Texture _visibilityIconOn; + [SerializeField] + private Texture _visibilityIconOff; + [SerializeField] + private Texture _labelIconType; + [SerializeField] + private Texture _labelIconMeta; + internal Texture HelpIcon { get { return _helpIcon; } } internal Texture CloseIcon { get { return _closeIcon; } } internal Texture CloseIconOn { get { return _closeIconOn; } } internal Texture UnlinkIcon { get { return _unlinkIcon; } } internal Texture AuotsetIcon { get { return _auotsetIcon; } } internal Texture AutosetCascadeIcon { get { return _auotsetCascadeIcon; } } + internal Texture SearchIcon { get { return _searchIcon; } } + internal Texture VisibilityIconOn { get { return _visibilityIconOn; } } + internal Texture VisibilityIconOff { get { return _visibilityIconOff; } } + internal Texture LabelIconType { get { return _labelIconType; } } + internal Texture LabelIconMeta { get { return _labelIconMeta; } } #endif } } diff --git a/src/Icons/Icons.cs.meta b/src/Icons/Icons.cs.meta index f7d20bb..e4c286a 100644 --- a/src/Icons/Icons.cs.meta +++ b/src/Icons/Icons.cs.meta @@ -3,13 +3,18 @@ guid: 2ce72fefbf3696f4fb3861773bd997df MonoImporter: externalObjects: {} serializedVersion: 2 - defaultReferences: - - _helpIcon: {fileID: 2800000, guid: e135cf23a5d53ce48a75e163b41e39d5, type: 3} - - _closeIcon: {fileID: 2800000, guid: 8a708e50662813d4a99c107e6431a60b, type: 3} - - _closeIconOn: {fileID: 2800000, guid: 6a1d402595b00c24db2ba647fed93a5c, type: 3} - - _unlinkIcon: {fileID: 2800000, guid: 5baead89a941e034e9f44d63617d3246, type: 3} - - _auotsetIcon: {fileID: 2800000, guid: d01e651682f48b548b597714f47e14b9, type: 3} - - _auotsetCascadeIcon: {fileID: 2800000, guid: 8f9fb2a8877577940971d81a98aeaaaa, type: 3} + defaultReferences: + - _helpIcon: {fileID: 2800000, guid: e135cf23a5d53ce48a75e163b41e39d5, type: 3} + - _closeIcon: {fileID: 2800000, guid: 8a708e50662813d4a99c107e6431a60b, type: 3} + - _closeIconOn: {fileID: 2800000, guid: 6a1d402595b00c24db2ba647fed93a5c, type: 3} + - _unlinkIcon: {fileID: 2800000, guid: 5baead89a941e034e9f44d63617d3246, type: 3} + - _auotsetIcon: {fileID: 2800000, guid: d01e651682f48b548b597714f47e14b9, type: 3} + - _auotsetCascadeIcon: {fileID: 2800000, guid: 8f9fb2a8877577940971d81a98aeaaaa, type: 3} + - _searchIcon: {fileID: 2800000, guid: 239e73d04c7ba4649bc4cc10e70e62e5, type: 3} + - _visibilityIconOn: {fileID: 2800000, guid: 9ce9d719a106be04fa4cf0c369c61e1c, type: 3} + - _visibilityIconOff: {fileID: 2800000, guid: 1f25a5ca611092642a8ee4e08fafcd43, type: 3} + - _labelIconType: {fileID: 2800000, guid: 5476d6e1435981e4cbc915a080f93ee6, type: 3} + - _labelIconMeta: {fileID: 2800000, guid: ebb82b09315bde749a10dfa45e64067c, type: 3} executionOrder: 0 icon: {instanceID: 0} userData: diff --git a/src/Icons/LabelIconMeta.png b/src/Icons/LabelIconMeta.png new file mode 100644 index 0000000000000000000000000000000000000000..fc62acccfba14f3108bd05a34939e7f48ca0a911 GIT binary patch literal 2631 zcmbVO4Nwzj8r}d>e##*y2b@xG2_On?cJoKbp3#d0AxeNEm3X$5&F+%qNU|ZjAqj^{ zbSU0A&Ujc)>8PD+J%45@*w%uz2&tvEb>!}_c8JF)c;_Ad0qI#~T28$$Aw=w8?ObLy z`|~~T^E}`CzTda|yRwqPxS07d5Cp}ki&W*{4Ev9$Nbt|r*M9>}(bl5%ECj{Q^B+9u zjr}PQ6xn2~&~jQ$F-|gO0YNc3THrKW0UCmqt#DcivWDhh9j!N76#Vgzdib!BQt&IK z8cbu&rwzuUdK6qs7Q=pdAKwe7t7$_j}PQ* zR5f0%S``!ncM86NQv%TY{(ibM!NAgs&65l+OyrcX1dXqL1Y zt(=juzrSJl{qW9Am3s7}Ip6%BC&DB8fl-FRnCND8|7qnGry%2#!|pLDeJ(mWv3* z6+#&<7UL304k#anO+hsbWvq713eCl(*b`9DGZeuQ&jeE>Ud`Cd1embVOz3IUYSHuI zP#W=k#>CiwFmNXhxX@^DwT0yf3rVY03O<;#z-Xj!5h;@jB^YSM-0D0eS1yqwc~U8X z(76(VA}KLJi$d`#hP3-D>yMx6a*81V$759zBPBW+Nh4&QPKU^J5(3eQ2q{7nGE7QW zi^)7JciK&<%?K76VVcS6cSQk4xlAIL(gcZ+Bn4cN5)#pgMHrHYNyT!EluF?&p z$`!PeD<)jDjSVi7m4rTcWirmlO8`?sm_c4N@XUk-2K+360rVNM6;F!=1O8alzpkb% zpieOwXl}g7$bz?f2;@7LK+B*o(8)<`nZf! zMM1w`uRw`sY^Bpx2m7=CGW2EuH=%b6Z2{Ca@aDLhwJ;lk!VPMbvO?R`x3_fro|jV2 zZTa%L>d=j*_f{mH*CKC~b*QpNy;@rnaxic(C64 z??m3 zqDsy|@%e(pSQX<~Orv$%7>UE_&X7iM=Hc=6u*b?(uTqP?F($Ns*T zH$e~g!C0p8mCkLwo44>LpyrI7Kl|={l=s!=Q{#O}K4)}8%;Ff69`&Vc6K?#=p7-q^ zU%t?BFwvdb#k&K|Z<((=9chZYQjr|yT2r^mbHC8@cG?)P8*wvfUlq*T7xiZCFgN$c z;^M*dLx!*hd5(MW;mZ7F=uKpJ_wx;jDdDfV;~U=?RhJKbb+$dJf64uqV;U0v5vT64 z@A%aD+|z;u>$%*4{3mr@3)s#gA$&+xZKk-;FL-P43+F8(rk7(H+G@ z^^=)qbX)$XimJ)Ns>~&E`7OV0Jzlc<<0N(8sZ4$2;KB$2Z=!ia{>5|I)}xkB?s?)9 znsy%wi+HFh{KHVT?^DlTi#K*YmtnuI_{9t66jYnu`$30e&wy$}-{&8W9w{p2c-=k8 zd0fx$x6D}>Q(JnHvb66$_^-pGd)1|;{@a5YX9i-slHF;;jw4hy;F+%;`EJg*8cw%C-q(-C9N}NryY=V$ zKO`fz_L80f&%8|j_?r6Pwt3h^yAoWGw*-Ii%a*na$qlbYjD4f^J$fy+WH|SNfxOX# SYDfH^dg_7_Rolv{t^Wfn|HNVd literal 0 HcmV?d00001 diff --git a/src/Icons/LabelIconMeta.png.meta b/src/Icons/LabelIconMeta.png.meta new file mode 100644 index 0000000..738f52f --- /dev/null +++ b/src/Icons/LabelIconMeta.png.meta @@ -0,0 +1,122 @@ +fileFormatVersion: 2 +guid: ebb82b09315bde749a10dfa45e64067c +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Icons/LabelIconType.png b/src/Icons/LabelIconType.png new file mode 100644 index 0000000000000000000000000000000000000000..d6c10b3299e4daeaa7c31d9a78b748f9f6bea9fd GIT binary patch literal 2538 zcmbVO4^$KP9S;cv!9S1r4<2=Ro?6@L<&s>IORh!>1SLw4Art7tak)Rql_VGM4hWzF zsqFkiU9*a(c2%CYx@}wG@Ig6h5XX!M9jjI}A=q-rQ1ACYw4de8kDx z+S6n*L@Kf65ftxMku+~-R6e&Cpk=boLp|Lz^t#$FQRHIC=(5@Tmdcj5rDwWNF?NQyF4P{Gs6*H0$hiGMqwxdkt)n^ zW>^p^u@yksyud&vl?I{IY7K;&RHTvC;d*Qtq*ZG%RE?op3{e{iy@9}RDEfhcoItZg zp=DK64BVMvrzCj^6s@kVR#jsvUT~lqlgWgtwWwB$00bh|cqGz?c*KR{3>HSD1kNjQ zyax(1l6JmQGQ+^?SPpJ)jMgJY>jWx>`baOTQK`c@MSwIF!+9$OS45nqP{zf$8IL3a ztR{x_I(dl~o&0^MW6SplfZEz@F^x&RxZN=cQOcKp(Ed}jUtH+==p61w^Nui*@ntPyNW@u6(9|)!?g5?D_2@>Yqq=P}d9tRA?%1C7M zE?xk_z#SHGVY3ldk0_BIim_VEFvwZOaWuhbD7DsZ*CGatp%J4|XGcto-GmsmqyaaQ zdRi0B0>oQ*sxsW!aQxVm(>w(@?y4G1Ivm&PjR?asEP|VKBw|$SbO@`#4O#=M)v8H+ z+|4?H0~?KWO=Jzbq5&h0vm~aYHHaSgL$s6*M~pa2AqEyBL4E8DOR?c;zN=is_@q3t zh7rW*HpwC#(JL1>p)L_jKIsN^u|X3H7Fh_hL>ABo#1`Ez7A%Bg(eS<+vw+^mWMsIB zTuuaIR}+<6&uqRc9GPc=q{92u3{&9&WoQ^0`cB<~ta#p@m62202P<+uZC!qP!OW{Q z^R~Ua!tvM7+6UXkgB9z}9M7n`^G*N96^HKZJ77P0?um{}#ZO09rlft{8Q1HAkIa50 z@kHE}zYQxxvSE4ZqOEV7=sDPGnIX{p-!D##RKL*8FhR$<8&mUJ9L1ygWtW-0L@+&@U6xlH2!OY93h1 z26|V?Kl*;RtT*?)xJ7;P+KqWwa|c_0W>?Ffb_FwjHKPtMBTE0I2&xTfW!hxB)_U9BXICe6wZ_lZ# zGF-7WkXF3!#Y?3ZdM+|2wih&Qn^NqoV~2ioUNJwZ`%3SQX0p)L69Uj$0C@M(z|mQ#lVTdX&)B^ay$=$wR8WHP~ en`adH!PMlnSzAAt<~kPsH)hSrw{&EcKmA`$1efCg literal 0 HcmV?d00001 diff --git a/src/Icons/LabelIconType.png.meta b/src/Icons/LabelIconType.png.meta new file mode 100644 index 0000000..ab7b750 --- /dev/null +++ b/src/Icons/LabelIconType.png.meta @@ -0,0 +1,122 @@ +fileFormatVersion: 2 +guid: 5476d6e1435981e4cbc915a080f93ee6 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Icons/SearchIcon.png b/src/Icons/SearchIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..f771052c4a62c4e2712ddd64628633c7be9ff398 GIT binary patch literal 2642 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 literal 0 HcmV?d00001 diff --git a/src/Icons/VisibilityIconOff.png.meta b/src/Icons/VisibilityIconOff.png.meta new file mode 100644 index 0000000..52d6222 --- /dev/null +++ b/src/Icons/VisibilityIconOff.png.meta @@ -0,0 +1,122 @@ +fileFormatVersion: 2 +guid: 1f25a5ca611092642a8ee4e08fafcd43 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Icons/VisibilityIconOn.png b/src/Icons/VisibilityIconOn.png new file mode 100644 index 0000000000000000000000000000000000000000..484b4144e07b5c6d101114083a67238bde027d07 GIT binary patch literal 2089 zcmbVN4NTN#818VWfaoUE8I@UzY%bDkd%ZjE3Wq@s1oapo8*I9a{(L~k-Sub-ci_~4 z&dI=^8Dj_|60_*kWx#aF;{QZ(7>v%jIGrZ^3^Sc>=s;zV=)S^nQRiQ5()Mfnyzl$G z@AH0dE7Q~Fg$7RzMi3-4HN}<*@2GZ;9SyHaSy>;v1-Vn+RS+a3OgmpdYU`#TNZ@`k zD@V<-FJyShsbd9+13ItM4bcb^H^=K{`9h$g9LN`4R;*|LVGI=oE0%4vlXiC^C=gT1 zWU#0#EsHNJ378q|g|Pjx`I07$Y5x>PbCKkTjvEanj5fO$;4_`VI_+lZ8Ac)0XTD2A`~0 zfvUP0g7A1eIuEUr!c#a#FEs z#URz;9Gq^yTbJUi6Ra5FW!(g&Bek4{fCBHwxr=4TP;h}KfCD&zOI0A2@?+fvk}4?$ z(qmlvKR*xv*4A$K$9N=}Vo*{6a9p2?GBCkqo6ooqfJ+^&2K^_P)JlpK-_14DN7 z5DUAVNp&eI>*7JG&5FUCb)qORTpr-q7&Zpi>p2rn8x1thk!AtsSdKDL1~N}i8b|DH z5?`z-J7OrN!!Sk4 zQ$4H<67pfSp4v{t& zg}S|)7KAzj!e3=>vhq%plSM@qF2KMTiD>=io#AeZO{B? ze)yGRm)G2lEdw~Qb<$#L&&hn_mM(H%VT60!SJ=SU=OYU}mhoH13@QV3&9v*kZ+NdF zys~TA5z|yIw(0$I0~5!0IA;Eht~(ZNOo~t5bJNl_7<#sO+3bOpM0IZDYpefQUo+#x znTqc(f0i?5fLmBZweIw0zOw|qjVR5%du{6q<+d$vG=*H7c%*Tq<7oG))7#PZsOxP) z+vhVk%pZ5SqAsh0zFo2{pnlGW-9dFfR@pj!Mh8PSwvUxFn&Yb*uz;qhmk-3YHs-9a zw=9i~Up08Ja{3oHznoYeag)AS9n!fR>1`tVbwAw7jg44*EpFcpb7OV*QL3-iS@W^$ zf?CySPD}1PxVw}ZpY&qKth9N3_3ofXVOm3A?6&qeX4S3;q!4`bLBuGr{b+yd z&f3P#$P3*US1*0Le?qJ2de{7xoeiT(zsrr9%q9P{w)J?=f~)-WBz%QUYQB}7erHAV g=Q@+}w))0MC@<;{X5v literal 0 HcmV?d00001 diff --git a/src/Icons/VisibilityIconOn.png.meta b/src/Icons/VisibilityIconOn.png.meta new file mode 100644 index 0000000..d9d61b9 --- /dev/null +++ b/src/Icons/VisibilityIconOn.png.meta @@ -0,0 +1,122 @@ +fileFormatVersion: 2 +guid: 9ce9d719a106be04fa4cf0c369c61e1c +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Internal/Editor/EcsGUI.cs b/src/Internal/Editor/EcsGUI.cs index 65bc0aa..01d0ed9 100644 --- a/src/Internal/Editor/EcsGUI.cs +++ b/src/Internal/Editor/EcsGUI.cs @@ -80,6 +80,24 @@ namespace DCFApixels.DragonECS.Unity.Editors EditorGUI.indentLevel = _value; } } + public struct AlignmentScope : IDisposable + { + private readonly GUIStyle _target; + private readonly TextAnchor _value; + public AlignmentScope(GUIStyle target, TextAnchor value) + { + _target = target; + _value = _target.alignment; + _target.alignment = value; + } + public void Dispose() + { + _target.alignment = _value; + } + } + #endregion + + public static AlignmentScope SetAlignment(GUIStyle target, TextAnchor value) => new AlignmentScope(target, value); public static IndentLevelScope SetIndentLevel(int level) => new IndentLevelScope(level); public static ContentColorScope SetContentColor(Color value) => new ContentColorScope(value); public static ContentColorScope SetContentColor(float r, float g, float b, float a = 1f) => new ContentColorScope(r, g, b, a); @@ -91,7 +109,8 @@ namespace DCFApixels.DragonECS.Unity.Editors public static EditorGUI.DisabledScope Enable => new EditorGUI.DisabledScope(false); public static EditorGUI.DisabledScope Disable => new EditorGUI.DisabledScope(true); public static EditorGUI.DisabledScope SetEnable(bool value) => new EditorGUI.DisabledScope(!value); - #endregion + + private static readonly BindingFlags fieldFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; @@ -161,6 +180,14 @@ namespace DCFApixels.DragonECS.Unity.Editors #region small elems public static void DrawIcon(Rect position, Texture icon, float iconPadding, string description) { + if(position.width != position.height) + { + Vector2 center = position.center; + float size = Mathf.Min(position.width, position.height); + position.height = size; + position.width = size; + position.center = center; + } using (SetColor(GUI.enabled ? GUI.color : GUI.color * new Color(1f, 1f, 1f, 0.4f))) { GUI.Label(position, UnityEditorUtility.GetLabel(string.Empty, description)); @@ -389,8 +416,41 @@ namespace DCFApixels.DragonECS.Unity.Editors EditorGUI.EndProperty(); } + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + + public static class Layout { + public static bool IconButton(Texture icon, params GUILayoutOption[] options) + { + bool result = GUILayout.Button(UnityEditorUtility.GetLabel(string.Empty), options); + DrawIcon(GUILayoutUtility.GetLastRect(), icon, 0, null); + return result; + } + public static bool IconButton(Texture icon, float iconPadding = 0, string description = null) + { + bool result = GUILayout.Button(UnityEditorUtility.GetLabel(string.Empty)); + DrawIcon(GUILayoutUtility.GetLastRect(), icon, iconPadding, description); + return result; + } + public static bool IconButton(Texture icon, float iconPadding = 0, string description = null, GUIStyle style = null, params GUILayoutOption[] options) + { + bool result; + if(style == null) + { + result = GUILayout.Button(UnityEditorUtility.GetLabel(string.Empty), options); + } + else + { + result = GUILayout.Button(UnityEditorUtility.GetLabel(string.Empty), style, options); + } + DrawIcon(GUILayoutUtility.GetLastRect(), icon, iconPadding, description); + return result; + } + public static void DrawEmptyComponentProperty(SerializedProperty property, string name, bool isDisplayEmpty) { EcsGUI.DrawEmptyComponentProperty(GUILayoutUtility.GetRect(UnityEditorUtility.GetLabel(name), EditorStyles.label), property, name, isDisplayEmpty); diff --git a/src/Resources/Icons.asset b/src/Resources/Icons.asset index 9ec76e5..57bd43f 100644 --- a/src/Resources/Icons.asset +++ b/src/Resources/Icons.asset @@ -18,3 +18,8 @@ MonoBehaviour: _unlinkIcon: {fileID: 2800000, guid: 5baead89a941e034e9f44d63617d3246, type: 3} _auotsetIcon: {fileID: 2800000, guid: d01e651682f48b548b597714f47e14b9, type: 3} _auotsetCascadeIcon: {fileID: 2800000, guid: 8f9fb2a8877577940971d81a98aeaaaa, type: 3} + _searchIcon: {fileID: 2800000, guid: 239e73d04c7ba4649bc4cc10e70e62e5, type: 3} + _visibilityIconOn: {fileID: 2800000, guid: 9ce9d719a106be04fa4cf0c369c61e1c, type: 3} + _visibilityIconOff: {fileID: 2800000, guid: 1f25a5ca611092642a8ee4e08fafcd43, type: 3} + _labelIconType: {fileID: 2800000, guid: 5476d6e1435981e4cbc915a080f93ee6, type: 3} + _labelIconMeta: {fileID: 2800000, guid: ebb82b09315bde749a10dfa45e64067c, type: 3}