chore: initial commit
This commit is contained in:
28
Assets/Scripts/Player/WeaponManager.cs
Normal file
28
Assets/Scripts/Player/WeaponManager.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user