Files
Cielonos/Assets/Scripts/MainGame/Characters/Data/BlockData.cs
SoulliesOfficial 649b7a5ddc 更新
2026-05-23 08:27:50 -04:00

90 lines
3.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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<string, GameObject> blockEffects = new Dictionary<string, GameObject>();
[Title("Animation")]
[Tooltip("格挡动画")]
public List<string> weakHitFuncAnims;
public List<string> 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;
}
}