完成基本代码迁移重构

This commit is contained in:
Bob.Song
2026-03-10 16:34:31 +08:00
parent cf2e374998
commit d17d13d7e7
11 changed files with 187 additions and 194 deletions

View File

@@ -2,13 +2,14 @@
using Fantasy;
using Fantasy.Entitas;
using NBF.Utils;
using UnityEngine;
namespace NBF
{
/// <summary>
/// 玩家物品
/// </summary>
public abstract class PlayerItem : Entity
public class PlayerItem : Entity
{
public Player Owner;
@@ -17,11 +18,47 @@ namespace NBF
/// </summary>
public int ConfigID;
public List<int> BindItems = new List<int>();
public virtual void Init(Player player, ItemInfo bindInfo)
#region Rod专属
/// <summary>
/// 线长度
/// </summary>
public float LineLength = 1.5f;
/// <summary>
/// 浮漂线长度
/// </summary>
public float FloatLength = 0.5f;
private float _tension;
/// <summary>
/// 拉力
/// </summary>
public float Tension
{
get => _tension;
private set
{
if (!Mathf.Approximately(_tension, value))
{
_tension = value;
// OnTensionChanged?.Invoke(_tension);
}
}
}
#endregion
public void Init(Player player, int configId, List<int> bindItems)
{
Owner = player;
ConfigID = bindInfo.ConfigId;
ConfigID = configId;
BindItems.Clear();
BindItems.AddRange(bindItems);
// var itemType = bindInfo.Item.GetItemType();
// if (itemType == ItemType.Rod)
// {