29 lines
821 B
C#
29 lines
821 B
C#
using System;
|
||
using UnityEngine;
|
||
|
||
namespace BaseGames.Player
|
||
{
|
||
/// <summary>
|
||
/// 武器管理器(Phase 1 实现)。
|
||
/// 架构 05_PlayerModule §7:ActiveWeapon(WeaponSO),OnWeaponChanged 事件。
|
||
/// ⚠️ 无 Equip() 方法,无 WeaponInstance 类。
|
||
/// Phase 2 §2.3:接入 FormController.OnFormChanged。
|
||
/// </summary>
|
||
public class WeaponManager : MonoBehaviour
|
||
{
|
||
[SerializeField] private WeaponSO _startingWeapon;
|
||
|
||
public WeaponSO ActiveWeapon { get; private set; }
|
||
public event Action<WeaponSO> OnWeaponChanged;
|
||
|
||
private void Start()
|
||
{
|
||
if (_startingWeapon != null)
|
||
{
|
||
ActiveWeapon = _startingWeapon;
|
||
OnWeaponChanged?.Invoke(ActiveWeapon);
|
||
}
|
||
}
|
||
}
|
||
}
|