update docs

This commit is contained in:
Mikhail 2024-06-13 18:15:02 +08:00
parent 7e15f7bd23
commit a0ca1c3bb0
4 changed files with 15 additions and 7 deletions

View File

@ -101,7 +101,6 @@ namespace DCFApixels.DragonECS.Unity.Editors
private void AutoSave() private void AutoSave()
{ {
Save(true); Save(true);
Debug.Log("AutoSave");
} }
} }
} }

View File

@ -17,7 +17,7 @@ namespace DCFApixels.DragonECS.Unity.Docs
[DataMember, SerializeField] internal string _name = string.Empty; [DataMember, SerializeField] internal string _name = string.Empty;
[DataMember, SerializeField] internal bool _isCustomName = false; [DataMember, SerializeField] internal bool _isCustomName = false;
[DataMember, SerializeField] internal string _typeName = string.Empty; [DataMember, SerializeField] internal string _typeName = string.Empty;
[DataMember, SerializeField] internal MetaColor _color = MetaColor.BlackColor; [DataMember, SerializeField] internal Color32 _color = new Color32(0, 0, 0, 255);
[DataMember, SerializeField] internal bool _isCustomColor = false; [DataMember, SerializeField] internal bool _isCustomColor = false;
[DataMember, SerializeField] internal string _autor = string.Empty; [DataMember, SerializeField] internal string _autor = string.Empty;
[DataMember, SerializeField] internal string _description = string.Empty; [DataMember, SerializeField] internal string _description = string.Empty;
@ -48,7 +48,7 @@ namespace DCFApixels.DragonECS.Unity.Docs
{ {
get { return _typeName; } get { return _typeName; }
} }
public MetaColor Color public Color32 Color
{ {
get { return _color; } get { return _color; }
} }
@ -86,7 +86,7 @@ namespace DCFApixels.DragonECS.Unity.Docs
_name = meta.Name; _name = meta.Name;
_isCustomName = meta.IsCustomName; _isCustomName = meta.IsCustomName;
_typeName = meta.TypeName; _typeName = meta.TypeName;
_color = meta.Color; _color = meta.Color.ToUnityColor32();
_isCustomColor = meta.IsCustomColor; _isCustomColor = meta.IsCustomColor;
_autor = meta.Description.Author; _autor = meta.Description.Author;

View File

@ -136,7 +136,7 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors
GUILayout.Label(""); GUILayout.Label("");
EditorGUI.BeginChangeCheck(); EditorGUI.BeginChangeCheck();
_searchingSampleEnter = EditorGUILayout.TextField(_searchingSampleEnter, EditorStyles.toolbarTextField, GUILayout.ExpandHeight(true), GUILayout.MaxWidth(200f)); _searchingSampleEnter = EditorGUILayout.TextField(_searchingSampleEnter, EditorStyles.toolbarSearchField, GUILayout.ExpandHeight(true), GUILayout.MaxWidth(200f));
if (EditorGUI.EndChangeCheck()) if (EditorGUI.EndChangeCheck())
{ {
_searchingSampleChanged = true; _searchingSampleChanged = true;
@ -233,7 +233,6 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors
i++; i++;
} }
} }
if (iMax <= 0) if (iMax <= 0)
{ {
GUILayout.Label(info.Length <= 0 ? "empty group" : "there are hidden items", EditorStyles.centeredGreyMiniLabel, GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(true)); GUILayout.Label(info.Length <= 0 ? "empty group" : "there are hidden items", EditorStyles.centeredGreyMiniLabel, GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(true));
@ -244,7 +243,7 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors
{ {
using (EcsGUI.SetIndentLevel(0)) using (EcsGUI.SetIndentLevel(0))
{ {
Color panelColor = EcsGUI.SelectPanelColor(meta.Color, meta.IsCustomColor, index, total).Desaturate(EscEditorConsts.COMPONENT_DRAWER_DESATURATE); Color panelColor = EcsGUI.SelectPanelColor(meta.Color.ToMetaColor(), meta.IsCustomColor, index, total).Desaturate(EscEditorConsts.COMPONENT_DRAWER_DESATURATE);
Color alphaPanelColor = panelColor; Color alphaPanelColor = panelColor;
alphaPanelColor.a = EscEditorConsts.COMPONENT_DRAWER_ALPHA; alphaPanelColor.a = EscEditorConsts.COMPONENT_DRAWER_ALPHA;

View File

@ -12,5 +12,15 @@ namespace DCFApixels.DragonECS
{ {
return new Color32(self.R, self.G, self.B, self.A); return new Color32(self.R, self.G, self.B, self.A);
} }
public static MetaColor ToMetaColor(this Color self)
{
return new MetaColor((byte)(self.r * 255), (byte)(self.g * 255), (byte)(self.b * 255), (byte)(self.a * 255));
}
public static MetaColor ToMetaColor(this Color32 self)
{
return new MetaColor(self.r, self.g, self.b, self.a);
}
} }
} }