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