架构大更

This commit is contained in:
SoulliesOfficial
2026-03-20 11:56:50 -04:00
parent e60ef64d01
commit d09b58fd80
3663 changed files with 15232012 additions and 105579 deletions

View File

@@ -0,0 +1,56 @@
using System.Collections.Generic;
using System.Linq;
using Cielonos.Core;
using Sirenix.OdinInspector;
using SLSUtilities.General;
using UnityEngine;
#if UNITY_EDITOR
using Sirenix.OdinInspector.Editor;
#endif
namespace Cielonos.MainGame
{
[CreateAssetMenu(fileName = "EditorBaseCollection", menuName = "Cielonos/BaseCollections/EditorBaseCollection")]
public partial class EditorBaseCollection : BaseCollection<EditorBaseCollection>
{
[Tooltip("Key 为词条 IDValue 为词条描述(将显示在 Tooltip 中)")]
[SerializedDictionarySettings("Key", "Description")]
[ToolbarButton("OpenAttributeGenerator", SdfIconType.FileCode, "打开词条生成器窗口")]
public SerializedDictionary<string, string> characterAttributes = new SerializedDictionary<string, string>();
#if UNITY_EDITOR
public static IEnumerable<ValueDropdownItem<string>> GetCharacterAttributesDropdown(InspectorProperty property)
{
IEnumerable<ValueDropdownItem<string>> allItems = Instance.characterAttributes
.Select(kvp => new ValueDropdownItem<string>
{
Text = $"{kvp.Key} ({kvp.Value})",
Value = kvp.Key
});
object dict = SerializedDictionaryHelper.GetDictionaryFromKey(property);
if (dict is IEnumerable<KeyValuePair<string, float>> existingDict)
{
var usedKeys = existingDict.Select(k => k.Key).ToHashSet();
string currentKey = property.ValueEntry.WeakSmartValue as string;
return allItems.Where(x => !usedKeys.Contains(x.Value) || x.Value == currentKey);
}
return allItems;
}
private void OpenAttributeGenerator(SerializedDictionary<string, string> dict)
{
// 打开我们刚才写的窗口,并传入当前的字典数据
DictionaryCodeGeneratorWindow.Open(dict, "CharacterAttribute", "Cielonos.MainGame");
}
#endif
}
public partial class EditorBaseCollection
{
}
}