Files
zeling_v2/Assets/Scripts/Player/WeaponManager.cs
2026-05-08 11:04:00 +08:00

29 lines
821 B
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;
using UnityEngine;
namespace BaseGames.Player
{
/// <summary>
/// 武器管理器Phase 1 实现)。
/// 架构 05_PlayerModule §7ActiveWeaponWeaponSOOnWeaponChanged 事件。
/// ⚠️ 无 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);
}
}
}
}