增加表格

This commit is contained in:
Bob.Song
2026-03-06 17:48:22 +08:00
parent 5012097465
commit 68beeb3417
32 changed files with 1258 additions and 22939 deletions

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 4ac59e4ab71247b790b959f91f53c285
timeCreated: 1772788069

View File

@@ -0,0 +1,414 @@
using System;
using System.Text;
using cfg;
using UnityEngine;
namespace NBF
{
public enum GearType
{
SpinningFloat = 0,
Spinning = 1,
Hand = 2,
Feeder = 3,
Pole = 4
}
[Serializable]
public enum PlayerState : uint
{
None = 0,
/// <summary>
/// 闲置等待中
/// </summary>
Idle = 1,
/// <summary>
/// 准备抛竿
/// </summary>
Prepare = 2,
/// <summary>
/// 抛竿中
/// </summary>
Throw = 3,
/// <summary>
/// 钓鱼中
/// </summary>
Fishing = 4,
/// <summary>
/// 溜鱼中
/// </summary>
Fight = 5
}
[Serializable]
public class FPlayerData : MonoService<FPlayerData>
{
public int PlayerID;
/// <summary>
/// 玩家当前装备的钓组
/// </summary>
public FPlayerGearData currentGear;
/// <summary>
/// 玩家位置
/// </summary>
public Vector3 position;
/// <summary>
/// 玩家角度
/// </summary>
public Quaternion rotation;
public float currentReelingSpeed;
public bool isHandOnHandle;
/// <summary>
/// 线长度
/// </summary>
public float lineLength;
/// <summary>
/// 收线速度
/// </summary>
public float reelSpeed;
/// <summary>
/// 打开手电筒
/// </summary>
public bool openLight;
/// <summary>
/// 打开望远镜
/// </summary>
public bool openTelescope;
public float EyeAngle;
public bool Run;
public bool ChangeItem;
public bool IsLureRod;
/// <summary>
/// 是否地面
/// </summary>
public bool IsGrounded;
/// <summary>
/// 移动速度
/// </summary>
public float Speed;
public float RotationSpeed;
public Vector2 MoveInput;
public SelectorRodSetting selectorRodSetting = SelectorRodSetting.Speed;
private PlayerState _previousPlayerState = PlayerState.Idle;
private PlayerState _playerState;
public PlayerState PreviousState => _previousPlayerState;
public PlayerState State
{
get => _playerState;
set
{
_previousPlayerState = _playerState;
_playerState = value;
NextState = value;
OnStateChange?.Invoke(_playerState);
}
}
[SerializeField] private PlayerState NextState;
public event Action<PlayerState> OnStateChange;
private void Start()
{
NextState = State;
}
private void Update()
{
if (NextState != State)
{
State = NextState;
}
}
}
/// <summary>
/// 玩家钓组数据
/// </summary>
[Serializable]
public class FPlayerGearData
{
public GearType Type = GearType.Spinning;
public FRodData rod;
public FReelData reel;
public FBobberData bobber;
public FHookData hook;
public FBaitData bait;
public FLureData lure;
public FWeightData weight;
public FLineData line;
public FLeaderData leader;
public FFeederData feeder;
/// <summary>
/// 获得唯一id
/// </summary>
/// <returns></returns>
public int GetUnitId()
{
int result = 0;
if (rod != null)
{
result += rod.configId;
}
if (reel != null)
{
result += reel.configId;
}
if (bobber != null)
{
result += bobber.configId;
}
if (hook != null)
{
result += hook.configId;
}
if (bait != null)
{
result += bait.configId;
}
if (lure != null)
{
result += lure.configId;
}
if (weight != null)
{
result += weight.configId;
}
if (line != null)
{
result += line.configId;
}
if (leader != null)
{
result += leader.configId;
}
if (feeder != null)
{
result += feeder.configId;
}
return result;
}
public void SetBobberLastSetGroundValue(float value)
{
bobber.lastSetGroundValue = value;
}
public void SetReelSettings(int setType, float val, bool saveToPrefs = false)
{
if (setType == 0)
{
reel.currentSpeed = val;
}
if (setType == 1)
{
reel.currentDrag = val;
}
if (saveToPrefs)
{
// Instance._playerData.SaveEquipment(ItemType.Reel);
}
}
}
[Serializable]
public abstract class FGearData
{
/// <summary>
/// 唯一id
/// </summary>
public int id;
/// <summary>
/// 配置id
/// </summary>
public int configId;
private Item _itemConfig;
public Item ItemConfig
{
get { return _itemConfig ??= Game.Tables.TbItem.Get(configId); }
}
}
/// <summary>
/// 鱼竿数据
/// </summary>
[Serializable]
public class FRodData : FGearData
{
private Rod _config;
public Rod Config
{
get { return _config ??= Game.Tables.TbRod.Get(configId); }
}
}
/// <summary>
/// 线轴数据
/// </summary>
[Serializable]
public class FReelData : FGearData
{
private Reel _config;
public Reel Config
{
get { return _config ??= Game.Tables.TbReel.Get(configId); }
}
public float currentSpeed = 0.5f;
public float currentDrag = 0.7f;
}
/// <summary>
/// 浮漂数据
/// </summary>
[Serializable]
public class FBobberData : FGearData
{
private Bobber _config;
public Bobber Config
{
get { return _config ??= Game.Tables.TbBobber.Get(configId); }
}
public float lastSetGroundValue;
}
/// <summary>
/// 鱼钩数据
/// </summary>
[Serializable]
public class FHookData : FGearData
{
private Hook _config;
public Hook Config
{
get { return _config ??= Game.Tables.TbHook.Get(configId); }
}
}
/// <summary>
/// 鱼饵数据
/// </summary>
[Serializable]
public class FBaitData : FGearData
{
private Bait _config;
public Bait Config
{
get { return _config ??= Game.Tables.TbBait.Get(configId); }
}
}
/// <summary>
/// 鱼饵数据
/// </summary>
[Serializable]
public class FLureData : FGearData
{
private Lure _config;
public Lure Config
{
get { return _config ??= Game.Tables.TbLure.Get(configId); }
}
}
/// <summary>
/// 沉子数据
/// </summary>
[Serializable]
public class FWeightData : FGearData
{
}
/// <summary>
/// 线数据
/// </summary>
[Serializable]
public class FLineData : FGearData
{
private Line _config;
public Line Config
{
get { return _config ??= Game.Tables.TbLine.Get(configId); }
}
}
/// <summary>
/// 引线数据
/// </summary>
[Serializable]
public class FLeaderData : FGearData
{
// private Leader _config;
//
// public Leader Config
// {
// get { return _config ??= Game.Tables.TbLeader.Get(configId); }
// }
}
/// <summary>
/// 菲德数据
/// </summary>
[Serializable]
public class FFeederData : FGearData
{
private Feeder _config;
public Feeder Config
{
get { return _config ??= Game.Tables.TbFeeder.Get(configId); }
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: e64ae505cdc344f5acedf6e55ba67a89
timeCreated: 1744029443

View File

@@ -1,116 +1,87 @@
using System;
using UnityEngine;
// using System;
// using UnityEngine;
//
// namespace NBF
// {
// // [Serializable]
// // public enum PlayerState
// // {
// // idle = 0,
// // move = 1,
// // prepare = 2,
// // casting = 3,
// // fishing = 4,
// // baitFlies = 5,
// // fight = 6,
// // fishView = 7,
// // collectFish = 8,
// // throwFish = 9,
// // vehicle = 10,
// // swiming = 11,
// // flyModeDebug = 12,
// // vehicleFishing = 13,
// // preciseCastIdle = 14,
// // preciseCastThrow = 15
// // }
//
namespace NBF
{
// [Serializable]
// public enum PlayerState
// {
// idle = 0,
// move = 1,
// prepare = 2,
// casting = 3,
// fishing = 4,
// baitFlies = 5,
// fight = 6,
// fishView = 7,
// collectFish = 8,
// throwFish = 9,
// vehicle = 10,
// swiming = 11,
// flyModeDebug = 12,
// vehicleFishing = 13,
// preciseCastIdle = 14,
// preciseCastThrow = 15
// }
[Serializable]
public enum PlayerState : uint
{
None = 0,
/// <summary>
/// 闲置等待中
/// </summary>
Idle = 1,
/// <summary>
/// 准备抛竿
/// </summary>
Prepare = 2,
/// <summary>
/// 抛竿中
/// </summary>
Throw = 3,
/// <summary>
/// 钓鱼中
/// </summary>
Fishing = 4,
/// <summary>
/// 溜鱼中
/// </summary>
Fight = 5
}
public class FPlayerData : MonoService<FPlayerData>
{
private PlayerState _previousPlayerState = PlayerState.Idle;
private PlayerState _playerState;
public bool ChangeItem;
public bool Run;
public bool IsGrounded;
public float Speed;
public float RotationSpeed;
public float ReelSpeed;
public float LineTension;
/// <summary>
/// 是否路亚竿
/// </summary>
public bool IsLureRod;
public Vector2 MoveInput;
/// <summary>
///
/// </summary>
public float EyeAngle;
public PlayerState PreviousState => _previousPlayerState;
public PlayerState State
{
get => _playerState;
set
{
_previousPlayerState = _playerState;
_playerState = value;
NextState = value;
OnStateChange?.Invoke(_playerState);
}
}
[SerializeField] private PlayerState NextState;
public event Action<PlayerState> OnStateChange;
private void Start()
{
NextState = State;
}
private void Update()
{
if (NextState != State)
{
State = NextState;
}
}
}
}
//
// public class FPlayerData : MonoService<FPlayerData>
// {
// private PlayerState _previousPlayerState = PlayerState.Idle;
// private PlayerState _playerState;
//
// public bool ChangeItem;
// public bool Run;
// public bool IsGrounded;
// public float Speed;
// public float RotationSpeed;
// public float ReelSpeed;
// public float LineTension;
//
// /// <summary>
// /// 是否路亚竿
// /// </summary>
// public bool IsLureRod;
//
// public Vector2 MoveInput;
//
// /// <summary>
// ///
// /// </summary>
// public float EyeAngle;
//
//
// public PlayerState PreviousState => _previousPlayerState;
//
// public PlayerState State
// {
// get => _playerState;
// set
// {
// _previousPlayerState = _playerState;
// _playerState = value;
// NextState = value;
// OnStateChange?.Invoke(_playerState);
// }
// }
//
// [SerializeField] private PlayerState NextState;
//
// public event Action<PlayerState> OnStateChange;
//
//
// private void Start()
// {
// NextState = State;
// }
//
// private void Update()
// {
// if (NextState != State)
// {
// State = NextState;
// }
// }
// }
// }

View File

@@ -8,25 +8,27 @@ using UnityEngine;
namespace NBF
{
public enum LineType
{
Hand,
HandDouble,
Spinning,
SpinningFloat,
}
public class FLine : FGearBase
{
// [SerializeField] private ObiParticleAttachment startParticleAttachment;
public LineType LineType;
[SerializeField] private bool isLureConnect;
[SerializeField] private RodLine rodLine;
[SerializeField] private Rope fishingRope;
[SerializeField] private Rope bobberRope;
public LureController Lure;
public BobberController Bobber;
private float _groundSetting = 0.5f;
private float _LineOnSpool = 100f;
private float _LineThickness = 0.0007f;
public bool IsLure => isLureConnect;
// public event Action OnLinePulled;
protected override void OnInit()
@@ -109,16 +111,9 @@ namespace NBF
Lure.RBody.useGravity = true;
}
public void EnableLineRenderers()
{
// foreach (ObiRopeExtrudedRenderer item in GetComponentsInChildren<ObiRopeExtrudedRenderer>().ToList())
// {
// item.enabled = true;
// }
}
public void SetObiRopeStretch(float value)
public void SetTargetLength(float value)
{
Log.Error($"SetObiRopeStretch={value}");
fishingRope.SetTargetLength(value);

View File

@@ -12,8 +12,7 @@ namespace NBF
public class FRod : FHandItem
{
private float _tension;
/// <summary>
/// 可用的
/// </summary>
@@ -33,11 +32,6 @@ namespace NBF
public FLine Line;
// /// <summary>
// /// 鱼线处理器
// /// </summary>
// public FLineHandler lineHandler;
public Transform GearRoot;
// public FWaterDisplacement LureHookWaterDisplacement;
@@ -67,11 +61,7 @@ namespace NBF
}
}
}
public float currentLineTension;
public float linelenghtDiferent;
public float currentLineStrenght;
private void Awake()
{
@@ -99,13 +89,13 @@ namespace NBF
public void SetLineLength(float lineLength, bool stretchRope = true)
{
if (!Line) return;
if (Line.IsLure)
if (Line.LineType == LineType.Spinning)
{
//没有浮漂类型
Line.Lure.SetJointDistance(lineLength);
if (stretchRope)
{
Line.SetObiRopeStretch(Tension > 0f ? 0f : lineLength);
Line.SetTargetLength(Tension > 0f ? 0f : lineLength);
}
}
else
@@ -115,7 +105,7 @@ namespace NBF
Line.Bobber.SetJointDistance(lineLength - floatLength);
if (stretchRope)
{
Line.SetObiRopeStretch(Tension > 0f ? 0f : lineLength - floatLength);
Line.SetTargetLength(Tension > 0f ? 0f : lineLength - floatLength);
}
}
}
@@ -226,7 +216,6 @@ namespace NBF
if (Hook)
{
Hook.Init(Player, this);
// LureHookWaterDisplacement = Hook.GetComponent<FWaterDisplacement>();
}
if (Bait)