using System; using System.Collections.Generic; using Cielonos.Core; using Cielonos.MainGame.Inventory; using DamageNumbersPro; using Sirenix.OdinInspector; using SLSUtilities.General; using UnityEngine; using UnityEngine.Serialization; namespace Cielonos.MainGame { [CreateAssetMenu(fileName = "BasePrefabsCollection", menuName = "Cielonos/BaseCollections/MainGameBaseCollection")] public partial class MainGameBaseCollection : BaseCollection { } public partial class MainGameBaseCollection { public Dictionary outlineColorCollection = new Dictionary(); public Dictionary itemRarityColorCollection = new Dictionary(); } public partial class MainGameBaseCollection { public Dictionary meshEffectCollection = new Dictionary(); } public partial class MainGameBaseCollection { public Dictionary hudTextCollection = new Dictionary(); public DamageNumber DamageNumber(Attack.Type type, bool isCritical) { if (type == Attack.Type.Blank) { return hudTextCollection["DN_Blank"]; } string prefix = "DN"; string typeStr = type.ToString(); string criticalStr = isCritical ? "Critical" : "Normal"; string dnKey = $"{prefix}_{typeStr}_{criticalStr}"; if (hudTextCollection.TryGetValue(dnKey, out var hudTextPrefab)) { return hudTextPrefab; } throw new KeyNotFoundException($"HUD Text Prefab with key '{dnKey}' not found in BasePrefabsCollection."); } public DamageNumber InfoText() { return hudTextCollection.GetValueOrDefault("Info_Normal"); } public DamageNumber HealText() { return hudTextCollection.GetValueOrDefault("Heal"); } public DamageNumber ShieldedDamageNumber() { return hudTextCollection.GetValueOrDefault("DN_Shielded"); } } public partial class MainGameBaseCollection { public SerializedDictionary buffVFXCollection = new SerializedDictionary(); /// /// 通过 Buff 类型获取对应的 VFXData。 /// public VFXData BuffVFX(Type buffType) { return buffVFXCollection.GetValueOrDefault(buffType.Name); } /// /// 通过 Buff 类名字符串获取对应的 VFXData。 /// public VFXData BuffVFX(string key) { return buffVFXCollection.GetValueOrDefault(key); } [Serializable] public struct BuffVFXPair : ISerializedPair { [SerializeField, HideInInspector] private string buffKey; [SerializeField, HideInInspector] private bool useManualInput; [ShowInInspector] [PropertyOrder(0)] [HideIf("useManualInput")] [HorizontalGroup("H")] [HideLabel] [ValueDropdown("@EditorBaseCollection.GetCharacterBuffDropdown($property)", IsUniqueList = true, DropdownHeight = 400)] [InlineButton("ToggleMode", Icon = SdfIconType.ListUl, Label = "")] public string DropdownKey { get => buffKey; set => buffKey = value; } [ShowInInspector] [PropertyOrder(0)] [ShowIf("useManualInput")] [HorizontalGroup("H")] [HideLabel] [InlineButton("ToggleMode", Icon = SdfIconType.PencilSquare, Label = "")] public string ManualKey { get => buffKey; set => buffKey = value; } [PropertyOrder(10)] [HorizontalGroup("H", MarginLeft = 10, Width = 150)] [HideLabel] public VFXData vfxData; public string Key => buffKey; public VFXData Value => vfxData; private void ToggleMode() { useManualInput = !useManualInput; } } } public partial class MainGameBaseCollection { //Music Beat Combat System [FormerlySerializedAs("beatPointerCollection")] public SerializedDictionary beatMarkerCollection = new SerializedDictionary(); } }