chore: initial commit
This commit is contained in:
28
Assets/Scripts/Player/WeaponSO.cs
Normal file
28
Assets/Scripts/Player/WeaponSO.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using UnityEngine;
|
||||
using BaseGames.Combat;
|
||||
|
||||
namespace BaseGames.Player
|
||||
{
|
||||
/// <summary>
|
||||
/// 武器数据 SO(纯数据,不含 Prefab 引用)。
|
||||
/// 每个攻击方向对应一个 DamageSourceSO。
|
||||
/// </summary>
|
||||
[CreateAssetMenu(menuName = "Player/Weapon")]
|
||||
public class WeaponSO : ScriptableObject
|
||||
{
|
||||
public string WeaponName;
|
||||
public DamageSourceSO GroundSource;
|
||||
public DamageSourceSO AirSource;
|
||||
public DamageSourceSO UpSource;
|
||||
public DamageSourceSO DownSource;
|
||||
|
||||
public DamageSourceSO GetSourceByDir(AttackDirection dir) => dir switch
|
||||
{
|
||||
AttackDirection.Ground => GroundSource,
|
||||
AttackDirection.Air => AirSource,
|
||||
AttackDirection.Up => UpSource,
|
||||
AttackDirection.Down => DownSource,
|
||||
_ => GroundSource,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user