mirror of
https://github.com/DCFApixels/DragonECS-Unity.git
synced 2025-09-17 17:34:34 +08:00
update meta attributes
This commit is contained in:
parent
547ff3495b
commit
2806ee9cb9
@ -8,9 +8,9 @@ namespace DCFApixels.DragonECS
|
||||
internal static class UnityComponentConsts
|
||||
{
|
||||
private const string UNITY_COMPONENT_NAME = "UnityComponent";
|
||||
public static readonly MetaGroup BaseGroup = new MetaGroupRef(UNITY_COMPONENT_NAME);
|
||||
public static readonly MetaGroup ColliderGroup = new MetaGroupRef($"{UNITY_COMPONENT_NAME}/Collider/");
|
||||
public static readonly MetaGroup JointGroup = new MetaGroupRef($"{UNITY_COMPONENT_NAME}/Joint/");
|
||||
public static readonly MetaGroup BaseGroup = new MetaGroup(UNITY_COMPONENT_NAME);
|
||||
public static readonly MetaGroup ColliderGroup = new MetaGroup($"{UNITY_COMPONENT_NAME}/Collider/");
|
||||
public static readonly MetaGroup JointGroup = new MetaGroup($"{UNITY_COMPONENT_NAME}/Joint/");
|
||||
}
|
||||
[Serializable]
|
||||
[MetaColor(255 / 3, 255, 0)]
|
||||
|
@ -44,7 +44,7 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
||||
{
|
||||
ITypeMeta meta = dummy is ITypeMeta metaOverride ? metaOverride : dummy.Type.ToMeta();
|
||||
string name = meta.Name;
|
||||
string description = meta.Description;
|
||||
string description = meta.Description.Text;
|
||||
MetaGroup group = meta.Group;
|
||||
|
||||
if (group.Name.Length > 0)
|
||||
@ -157,7 +157,7 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
||||
|
||||
ITypeMeta meta = template is ITypeMeta metaOverride ? metaOverride : template.Type.ToMeta();
|
||||
string name = meta.Name;
|
||||
string description = meta.Description;
|
||||
string description = meta.Description.Text;
|
||||
Color panelColor = meta.Color.ToUnityColor().Desaturate(EscEditorConsts.COMPONENT_DRAWER_DESATURATE);
|
||||
|
||||
//GUIContent label = new GUIContent(name);
|
||||
|
@ -36,7 +36,7 @@ namespace DCFApixels.DragonECS
|
||||
public virtual string Name { get { return string.Empty; } }
|
||||
public virtual MetaColor Color { get { return new MetaColor(MetaColor.Black); } }
|
||||
public virtual MetaGroup Group { get { return MetaGroup.Empty; } }
|
||||
public virtual string Description { get { return string.Empty; } }
|
||||
public virtual MetaDescription Description { get { return MetaDescription.Empty; } }
|
||||
public virtual IReadOnlyCollection<string> Tags { get { return Array.Empty<string>(); } }
|
||||
#endregion
|
||||
|
||||
@ -60,7 +60,7 @@ namespace DCFApixels.DragonECS
|
||||
public override Type Type { get { return typeof(T); } }
|
||||
public override string Name { get { return Meta.Name; } }
|
||||
public override MetaGroup Group { get { return Meta.Group; } }
|
||||
public override string Description { get { return Meta.Description; } }
|
||||
public override MetaDescription Description { get { return Meta.Description; } }
|
||||
public override IReadOnlyCollection<string> Tags { get { return Meta.Tags; } }
|
||||
public override MetaColor Color { get { return Meta.Color; } }
|
||||
#endregion
|
||||
|
@ -399,12 +399,12 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
||||
}
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(meta.Description) == false)
|
||||
if (string.IsNullOrEmpty(meta.Description.Text) == false)
|
||||
{
|
||||
Rect tooltipIconRect = TooltipIconRect;
|
||||
tooltipIconRect.center = removeButtonRect.center;
|
||||
tooltipIconRect.center -= Vector2.right * tooltipIconRect.width;
|
||||
EcsGUI.DescriptionIcon(tooltipIconRect, meta.Description);
|
||||
EcsGUI.DescriptionIcon(tooltipIconRect, meta.Description.Text);
|
||||
}
|
||||
|
||||
GUILayout.EndVertical();
|
||||
|
@ -274,7 +274,7 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
||||
}
|
||||
var meta = pool.ComponentType.ToMeta();
|
||||
string name = meta.Group.Name + meta.Name;
|
||||
genericMenu.AddItem(new GUIContent(name, meta.Description), false, OnAddComponent, pool);
|
||||
genericMenu.AddItem(new GUIContent(name, meta.Description.Text), false, OnAddComponent, pool);
|
||||
}
|
||||
return new WorldData(genericMenu, world.PoolsCount);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user