mirror of
https://github.com/DCFApixels/DragonECS-Unity.git
synced 2026-04-22 04:35:55 +08:00
update meta
This commit is contained in:
parent
5549e71ac4
commit
535e88f041
@ -78,7 +78,7 @@ namespace DCFApixels.DragonECS
|
|||||||
public override string Name { get { return typeof(T).GetMeta().Name; } }
|
public override string Name { get { return typeof(T).GetMeta().Name; } }
|
||||||
public override MetaGroup Group { get { return UnityComponentConsts.BaseGroup; } }
|
public override MetaGroup Group { get { return UnityComponentConsts.BaseGroup; } }
|
||||||
public override MetaColor? Color { get { return MetaColor.DragonCyan; } }
|
public override MetaColor? Color { get { return MetaColor.DragonCyan; } }
|
||||||
public override MetaDescription Description { get { return new MetaDescription(AUTHOR, $"IEcsComponent component. Holds a reference to a Unity {Name} component."); } }
|
public override MetaDescription Description { get { return new MetaDescription(AUTHOR, $"Template for IEcsComponent component. Holds a reference to a Unity {Name} component."); } }
|
||||||
public UnityComponentMetaProxy(Type type) : base(type) { }
|
public UnityComponentMetaProxy(Type type) : base(type) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,7 +52,6 @@ namespace DCFApixels.DragonECS.Unity.Internal
|
|||||||
{
|
{
|
||||||
[MetaColor(MetaColor.DragonRose)]
|
[MetaColor(MetaColor.DragonRose)]
|
||||||
[MetaGroup(EcsUnityConsts.PACK_GROUP, EcsConsts.PROCESSES_GROUP)]
|
[MetaGroup(EcsUnityConsts.PACK_GROUP, EcsConsts.PROCESSES_GROUP)]
|
||||||
[MetaDescription(EcsConsts.AUTHOR, "...")]
|
|
||||||
[MetaTags(MetaTags.HIDDEN)]
|
[MetaTags(MetaTags.HIDDEN)]
|
||||||
[MetaID("DragonECS_2DD8BC809201633E2761D5AEF65B7090")]
|
[MetaID("DragonECS_2DD8BC809201633E2761D5AEF65B7090")]
|
||||||
public class EcsLateGizmosRunner : EcsRunner<IEcsGizmos>, IEcsGizmos
|
public class EcsLateGizmosRunner : EcsRunner<IEcsGizmos>, IEcsGizmos
|
||||||
@ -70,7 +69,6 @@ namespace DCFApixels.DragonECS.Unity.Internal
|
|||||||
|
|
||||||
[MetaColor(MetaColor.DragonRose)]
|
[MetaColor(MetaColor.DragonRose)]
|
||||||
[MetaGroup(EcsUnityConsts.PACK_GROUP, EcsConsts.PROCESSES_GROUP)]
|
[MetaGroup(EcsUnityConsts.PACK_GROUP, EcsConsts.PROCESSES_GROUP)]
|
||||||
[MetaDescription(EcsConsts.AUTHOR, "...")]
|
|
||||||
[MetaTags(MetaTags.HIDDEN)]
|
[MetaTags(MetaTags.HIDDEN)]
|
||||||
[MetaID("DragonECS_EDE8BC809201603B47C3A9D1EFD4EE95")]
|
[MetaID("DragonECS_EDE8BC809201603B47C3A9D1EFD4EE95")]
|
||||||
public class EcsLateRunRunner : EcsRunner<IEcsLateRun>, IEcsLateRun
|
public class EcsLateRunRunner : EcsRunner<IEcsLateRun>, IEcsLateRun
|
||||||
@ -88,7 +86,6 @@ namespace DCFApixels.DragonECS.Unity.Internal
|
|||||||
|
|
||||||
[MetaColor(MetaColor.DragonRose)]
|
[MetaColor(MetaColor.DragonRose)]
|
||||||
[MetaGroup(EcsUnityConsts.PACK_GROUP, EcsConsts.PROCESSES_GROUP)]
|
[MetaGroup(EcsUnityConsts.PACK_GROUP, EcsConsts.PROCESSES_GROUP)]
|
||||||
[MetaDescription(EcsConsts.AUTHOR, "...")]
|
|
||||||
[MetaTags(MetaTags.HIDDEN)]
|
[MetaTags(MetaTags.HIDDEN)]
|
||||||
[MetaID("DragonECS_45F7BC809201866AA05F6DC096A47F01")]
|
[MetaID("DragonECS_45F7BC809201866AA05F6DC096A47F01")]
|
||||||
public class EcsFixedRunRunner : EcsRunner<IEcsFixedRun>, IEcsFixedRun
|
public class EcsFixedRunRunner : EcsRunner<IEcsFixedRun>, IEcsFixedRun
|
||||||
|
|||||||
@ -41,8 +41,6 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
rect.xMin += 9f;
|
rect.xMin += 9f;
|
||||||
GUI.Label(rect, "User Settings", EditorStyles.whiteLargeLabel);
|
GUI.Label(rect, "User Settings", EditorStyles.whiteLargeLabel);
|
||||||
|
|
||||||
//using (prefs.DisableAutoSave())
|
|
||||||
{
|
|
||||||
prefs.IsShowHidden = EditorGUILayout.ToggleLeft(
|
prefs.IsShowHidden = EditorGUILayout.ToggleLeft(
|
||||||
UnityEditorUtility.TransformFieldName(nameof(UserSettingsPrefs.IsShowHidden)),
|
UnityEditorUtility.TransformFieldName(nameof(UserSettingsPrefs.IsShowHidden)),
|
||||||
prefs.IsShowHidden);
|
prefs.IsShowHidden);
|
||||||
@ -59,12 +57,7 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
UnityEditorUtility.TransformFieldName(nameof(UserSettingsPrefs.IsUseCustomNames)),
|
UnityEditorUtility.TransformFieldName(nameof(UserSettingsPrefs.IsUseCustomNames)),
|
||||||
prefs.IsUseCustomNames);
|
prefs.IsUseCustomNames);
|
||||||
|
|
||||||
//prefs.IsFastModeRuntimeComponents = EditorGUILayout.ToggleLeft(
|
|
||||||
// UnityEditorUtility.TransformFieldName(nameof(UserSettingsPrefs.IsFastModeRuntimeComponents)),
|
|
||||||
// prefs.IsFastModeRuntimeComponents);
|
|
||||||
|
|
||||||
prefs.ComponentColorMode = (ComponentColorMode)EditorGUILayout.EnumPopup(UnityEditorUtility.TransformFieldName(nameof(UserSettingsPrefs.ComponentColorMode)), prefs.ComponentColorMode);
|
prefs.ComponentColorMode = (ComponentColorMode)EditorGUILayout.EnumPopup(UnityEditorUtility.TransformFieldName(nameof(UserSettingsPrefs.ComponentColorMode)), prefs.ComponentColorMode);
|
||||||
}
|
|
||||||
|
|
||||||
GUILayout.EndVertical();
|
GUILayout.EndVertical();
|
||||||
|
|
||||||
|
|||||||
@ -83,20 +83,20 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//[SerializeField]
|
[SerializeField]
|
||||||
//private bool _isFastModeRuntimeComponents = false;
|
private bool _isShowWrappedMemberMeta = true;
|
||||||
//public bool IsFastModeRuntimeComponents
|
public bool IsShowWrappedMemberMeta
|
||||||
//{
|
{
|
||||||
// get => _isFastModeRuntimeComponents;
|
get => _isShowWrappedMemberMeta;
|
||||||
// set
|
set
|
||||||
// {
|
{
|
||||||
// if (_isFastModeRuntimeComponents != value)
|
if (_isShowWrappedMemberMeta != value)
|
||||||
// {
|
{
|
||||||
// _isFastModeRuntimeComponents = value;
|
_isShowWrappedMemberMeta = value;
|
||||||
// AutoSave();
|
AutoSave();
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
|
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
private ComponentColorMode _componentColorMode = ComponentColorMode.Auto;
|
private ComponentColorMode _componentColorMode = ComponentColorMode.Auto;
|
||||||
|
|||||||
@ -101,8 +101,16 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class DragonFieldCahce
|
internal class DragonFieldCahce : ITypeMeta
|
||||||
{
|
{
|
||||||
|
Type ITypeMeta.Type => Meta.Type;
|
||||||
|
string ITypeMeta.Name => Meta.Name;
|
||||||
|
MetaColor ITypeMeta.Color => Meta.Color;
|
||||||
|
MetaDescription ITypeMeta.Description => Meta.Description;
|
||||||
|
MetaGroup ITypeMeta.Group => Meta.Group;
|
||||||
|
IReadOnlyList<string> ITypeMeta.Tags => Meta.Tags;
|
||||||
|
ITypeMeta ITypeMeta.BaseMeta => Meta;
|
||||||
|
|
||||||
internal static Type[] All => UnityEditorUtility._serializableTypes;
|
internal static Type[] All => UnityEditorUtility._serializableTypes;
|
||||||
internal static HashSet<Type> AllDict;
|
internal static HashSet<Type> AllDict;
|
||||||
internal static Dictionary<Type, DragonFieldCahce> RuntimeDict;
|
internal static Dictionary<Type, DragonFieldCahce> RuntimeDict;
|
||||||
@ -160,11 +168,9 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (_meta == null)
|
if (_meta == null)
|
||||||
{
|
|
||||||
{
|
{
|
||||||
_meta = Type.GetMeta();
|
_meta = Type.GetMeta();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return _meta;
|
return _meta;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -199,6 +205,7 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
return _defaultValueDummy;
|
return _defaultValueDummy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public DragonFieldCahce(Type type)
|
public DragonFieldCahce(Type type)
|
||||||
{
|
{
|
||||||
Type = type;
|
Type = type;
|
||||||
|
|||||||
@ -48,8 +48,10 @@ namespace DCFApixels.DragonECS
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
[MetaProxy(typeof(ComponentTemplateMetaProxy))]
|
|
||||||
[DragonMemberWrapper("component")]
|
[DragonMemberWrapper("component")]
|
||||||
|
[MetaColor(MetaColor.DragonCyan)]
|
||||||
|
[MetaGroup(EcsUnityConsts.PACK_GROUP, EcsConsts.OTHER_GROUP)]
|
||||||
|
[MetaProxy(typeof(ComponentTemplateMetaProxy))]
|
||||||
public abstract class ComponentTemplateBase : IComponentTemplate
|
public abstract class ComponentTemplateBase : IComponentTemplate
|
||||||
{
|
{
|
||||||
#region Properties
|
#region Properties
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
using DCFApixels.DragonECS.Unity.Editors;
|
using DCFApixels.DragonECS.Unity.Editors;
|
||||||
using DCFApixels.DragonECS.Unity.Internal;
|
using DCFApixels.DragonECS.Unity.Internal;
|
||||||
|
using DCFApixels.DragonECS.Unity.RefRepairer.Editors;
|
||||||
using System;
|
using System;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@ -57,6 +58,25 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors
|
|||||||
private void OnGUI()
|
private void OnGUI()
|
||||||
{
|
{
|
||||||
Event current = Event.current;
|
Event current = Event.current;
|
||||||
|
int moveSign = 0;
|
||||||
|
if (hasFocus && current.type == EventType.KeyUp && current.isKey)
|
||||||
|
{
|
||||||
|
if(current.keyCode == KeyCode.DownArrow)
|
||||||
|
{
|
||||||
|
moveSign = 1;
|
||||||
|
}
|
||||||
|
if (current.keyCode == KeyCode.UpArrow)
|
||||||
|
{
|
||||||
|
moveSign = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_selectedIndex += moveSign;
|
||||||
|
if(moveSign != 0)
|
||||||
|
{
|
||||||
|
Repaint();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
DragonDocs docs = DragonDocsPrefs.instance.Docs;
|
DragonDocs docs = DragonDocsPrefs.instance.Docs;
|
||||||
if (docs == null || docs.Metas.IsEmpty)
|
if (docs == null || docs.Metas.IsEmpty)
|
||||||
{
|
{
|
||||||
@ -79,7 +99,6 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors
|
|||||||
_selectedIndex = 0;
|
_selectedIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DrawToolbar();
|
DrawToolbar();
|
||||||
|
|
||||||
GUILayout.BeginHorizontal(GUILayout.ExpandHeight(true));
|
GUILayout.BeginHorizontal(GUILayout.ExpandHeight(true));
|
||||||
|
|||||||
@ -39,7 +39,6 @@ namespace DCFApixels.DragonECS.Unity
|
|||||||
namespace DCFApixels.DragonECS.Unity.Editors
|
namespace DCFApixels.DragonECS.Unity.Editors
|
||||||
{
|
{
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine.Serialization;
|
|
||||||
|
|
||||||
[CustomPropertyDrawer(typeof(ReferenceDropDownAttribute), true)]
|
[CustomPropertyDrawer(typeof(ReferenceDropDownAttribute), true)]
|
||||||
[CustomPropertyDrawer(typeof(DragonMetaBlockAttribute), true)]
|
[CustomPropertyDrawer(typeof(DragonMetaBlockAttribute), true)]
|
||||||
@ -294,17 +293,14 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
{
|
{
|
||||||
if (info != null)
|
if (info != null)
|
||||||
{
|
{
|
||||||
meta = info.ComponentType.GetMeta();
|
meta = info.Type.GetMeta();
|
||||||
}
|
}
|
||||||
else
|
else if (mrNull == false)
|
||||||
{
|
|
||||||
if (mrNull == false)
|
|
||||||
{
|
{
|
||||||
var type = GetCachedManagedType(property);
|
var type = GetCachedManagedType(property);
|
||||||
meta = type.GetMeta();
|
meta = type.GetMeta();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (isDrawDropDown && mrNull == false && ReferenceDropDownAttribute.IsHideButtonIfNotNull)
|
if (isDrawDropDown && mrNull == false && ReferenceDropDownAttribute.IsHideButtonIfNotNull)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user