增加表格
This commit is contained in:
3
Assets/Scripts/Fishing/Data.meta
Normal file
3
Assets/Scripts/Fishing/Data.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4ac59e4ab71247b790b959f91f53c285
|
||||
timeCreated: 1772788069
|
||||
@@ -1,11 +1,52 @@
|
||||
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 class FPlayerData
|
||||
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;
|
||||
|
||||
@@ -46,9 +87,65 @@ namespace NBF
|
||||
/// 打开望远镜
|
||||
/// </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>
|
||||
@@ -166,6 +263,13 @@ namespace NBF
|
||||
/// 配置id
|
||||
/// </summary>
|
||||
public int configId;
|
||||
|
||||
private Item _itemConfig;
|
||||
|
||||
public Item ItemConfig
|
||||
{
|
||||
get { return _itemConfig ??= Game.Tables.TbItem.Get(configId); }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -174,11 +278,11 @@ namespace NBF
|
||||
[Serializable]
|
||||
public class FRodData : FGearData
|
||||
{
|
||||
private GameRods _config;
|
||||
private Rod _config;
|
||||
|
||||
public GameRods Config
|
||||
public Rod Config
|
||||
{
|
||||
get { return _config ??= GameRods.Get(configId); }
|
||||
get { return _config ??= Game.Tables.TbRod.Get(configId); }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,11 +292,11 @@ namespace NBF
|
||||
[Serializable]
|
||||
public class FReelData : FGearData
|
||||
{
|
||||
private GameReels _config;
|
||||
private Reel _config;
|
||||
|
||||
public GameReels Config
|
||||
public Reel Config
|
||||
{
|
||||
get { return _config ??= GameReels.Get(configId); }
|
||||
get { return _config ??= Game.Tables.TbReel.Get(configId); }
|
||||
}
|
||||
|
||||
public float currentSpeed = 0.5f;
|
||||
@@ -206,11 +310,11 @@ namespace NBF
|
||||
[Serializable]
|
||||
public class FBobberData : FGearData
|
||||
{
|
||||
private GameFloats _config;
|
||||
private Bobber _config;
|
||||
|
||||
public GameFloats Config
|
||||
public Bobber Config
|
||||
{
|
||||
get { return _config ??= GameFloats.Get(configId); }
|
||||
get { return _config ??= Game.Tables.TbBobber.Get(configId); }
|
||||
}
|
||||
|
||||
public float lastSetGroundValue;
|
||||
@@ -222,11 +326,11 @@ namespace NBF
|
||||
[Serializable]
|
||||
public class FHookData : FGearData
|
||||
{
|
||||
private GameHooks _config;
|
||||
private Hook _config;
|
||||
|
||||
public GameHooks Config
|
||||
public Hook Config
|
||||
{
|
||||
get { return _config ??= GameHooks.Get(configId); }
|
||||
get { return _config ??= Game.Tables.TbHook.Get(configId); }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -236,11 +340,11 @@ namespace NBF
|
||||
[Serializable]
|
||||
public class FBaitData : FGearData
|
||||
{
|
||||
private GameBaits _config;
|
||||
private Bait _config;
|
||||
|
||||
public GameBaits Config
|
||||
public Bait Config
|
||||
{
|
||||
get { return _config ??= GameBaits.Get(configId); }
|
||||
get { return _config ??= Game.Tables.TbBait.Get(configId); }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,11 +354,11 @@ namespace NBF
|
||||
[Serializable]
|
||||
public class FLureData : FGearData
|
||||
{
|
||||
private GameLures _config;
|
||||
private Lure _config;
|
||||
|
||||
public GameLures Config
|
||||
public Lure Config
|
||||
{
|
||||
get { return _config ??= GameLures.Get(configId); }
|
||||
get { return _config ??= Game.Tables.TbLure.Get(configId); }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,12 +368,6 @@ namespace NBF
|
||||
[Serializable]
|
||||
public class FWeightData : FGearData
|
||||
{
|
||||
private GameWeights _config;
|
||||
|
||||
public GameWeights Config
|
||||
{
|
||||
get { return _config ??= GameWeights.Get(configId); }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -278,11 +376,11 @@ namespace NBF
|
||||
[Serializable]
|
||||
public class FLineData : FGearData
|
||||
{
|
||||
private GameLines _config;
|
||||
private Line _config;
|
||||
|
||||
public GameLines Config
|
||||
public Line Config
|
||||
{
|
||||
get { return _config ??= GameLines.Get(configId); }
|
||||
get { return _config ??= Game.Tables.TbLine.Get(configId); }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -292,12 +390,12 @@ namespace NBF
|
||||
[Serializable]
|
||||
public class FLeaderData : FGearData
|
||||
{
|
||||
private GameLeaders _config;
|
||||
|
||||
public GameLeaders Config
|
||||
{
|
||||
get { return _config ??= GameLeaders.Get(configId); }
|
||||
}
|
||||
// private Leader _config;
|
||||
//
|
||||
// public Leader Config
|
||||
// {
|
||||
// get { return _config ??= Game.Tables.TbLeader.Get(configId); }
|
||||
// }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -306,11 +404,11 @@ namespace NBF
|
||||
[Serializable]
|
||||
public class FFeederData : FGearData
|
||||
{
|
||||
private GameFeeders _config;
|
||||
private Feeder _config;
|
||||
|
||||
public GameFeeders Config
|
||||
public Feeder Config
|
||||
{
|
||||
get { return _config ??= GameFeeders.Get(configId); }
|
||||
get { return _config ??= Game.Tables.TbFeeder.Get(configId); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 370fe07e6dd1446298721033a240b4fd
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -19,7 +19,7 @@ namespace Test
|
||||
//有浮漂
|
||||
line.Lure.SetJointDistance(floatLength);
|
||||
line.Bobber.SetJointDistance(lineLength - floatLength);
|
||||
line.SetObiRopeStretch(lineLength - floatLength);
|
||||
line.SetTargetLength(lineLength - floatLength);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
@@ -44,13 +44,13 @@ namespace Test
|
||||
{
|
||||
Debug.Log($"lineLength={lineLength}");
|
||||
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
|
||||
@@ -60,7 +60,7 @@ namespace Test
|
||||
line.Bobber.SetJointDistance(lineLength - floatLength);
|
||||
if (stretchRope)
|
||||
{
|
||||
line.SetObiRopeStretch(Tension > 0f ? 0f : lineLength - floatLength);
|
||||
line.SetTargetLength(Tension > 0f ? 0f : lineLength - floatLength);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
8
Assets/Scripts/ThirdParty/Rope.meta
vendored
8
Assets/Scripts/ThirdParty/Rope.meta
vendored
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 77bf606826b396b4892cee2a10698bdc
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Scripts/ThirdParty/Rope/Examples.meta
vendored
8
Assets/Scripts/ThirdParty/Rope/Examples.meta
vendored
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 274ad94c8d1c74add9a9cc85a946ad59
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 386748bc44dcf2c4cb5f81bbd7a1dbbe
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3c7f7f1f33c7e2e41a67b885755052ee
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user