using System.Collections.Generic; using Sirenix.OdinInspector; using SLSUtilities.WwiseAssistance; using UnityEngine; using UnityEngine.Serialization; using Cielonos.MainGame.Inventory; namespace Cielonos.MainGame.Characters { [CreateAssetMenu(fileName = "Block", menuName = "Cielonos/Characters/BlockData")] public partial class BlockData : SerializedScriptableObject { [Title("General")] [Tooltip("格挡名称")] public string blockName; [Tooltip("格挡优先级,数值越大,优先级越高")] public int blockPriority; [Tooltip("是否为限时格挡")] public bool isLimitedTime = false; [ShowIf("isLimitedTime")] [Tooltip("默认格挡时间")] public float defaultBlockTime = Mathf.Infinity; [Tooltip("完美格挡窗口时间,设为0表示没有完美格挡")] public float perfectTime = 0.2f; [Title("Audio")] [WwiseEvent] [Tooltip("完美格挡音效")] public uint perfectBlockSound; [WwiseEvent] [Tooltip("普通格挡音效")] public uint normalBlockSound; [Title("VFX")] public GameObject perfectBlockEffect; public GameObject normalBlockEffect; public Dictionary blockEffects = new Dictionary(); [Title("Animation")] [Tooltip("格挡动画")] public List weakHitFuncAnims; public List mediumHitFuncAnims; public BlockSource CreateBlockSource(CharacterBase character, ItemBase sourceItem = null) { return new BlockSource(character, sourceItem, this); } public GameObject InstantiateBlockEffect(string effectName, CharacterBase creator, Vector3 position, Quaternion rotation) { if (blockEffects.TryGetValue(effectName, out GameObject effect)) { GameObject obj = VFXObject.Spawn(effect, creator, position, rotation); return obj; } return null; } } public partial class BlockData { [Title("Breakthrough")] [LabelText("Advanced Settings")] public bool advancedBreakthroughSettings; [FormerlySerializedAs("overallBreakType")] [Tooltip("等于和低于该突破类型的攻击都会被格挡")] [EnumToggleButtons] [HideIf("advancedBreakthroughSettings")] public Breakthrough.Type overallBlockType = Breakthrough.Type.Heavy; [FormerlySerializedAs("normalBlockBreakType")] [Tooltip("普通格挡可抵御的最高突破类型,优先级高于整体设置")] [EnumToggleButtons] [ShowIf("advancedBreakthroughSettings")] public Breakthrough.Type normalBlockType = Breakthrough.Type.Heavy; [FormerlySerializedAs("perfectBlockBreakType")] [Tooltip("完美格挡可抵御的最高的突破类型,优先级高于整体设置")] [EnumToggleButtons] [ShowIf("advancedBreakthroughSettings")] public Breakthrough.Type perfectBlockType = Breakthrough.Type.Heavy; } }