目录调整,旧钓鱼逻辑全部注释

This commit is contained in:
2025-08-22 00:09:05 +08:00
parent 2f8251fe63
commit 6767dc7019
154 changed files with 937 additions and 483 deletions

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 5a18bd4a09c14040b9ea1de796d645f1
timeCreated: 1743783137

View File

@@ -1,12 +0,0 @@
using UnityEngine;
namespace NBF
{
/// <summary>
/// 鱼饵
/// </summary>
public class BaitAsset : PreviewableAsset
{
public Transform hook;
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 524c26f472e74fa1ad167db68e562324
timeCreated: 1743824319

View File

@@ -1,80 +0,0 @@
using UnityEngine;
namespace NBF
{
/// <summary>
/// 浮漂资产
/// </summary>
public class BobberAsset : PreviewableAsset
{
public Transform body;
public Transform stick;
/// <summary>
/// 顶部连接点
/// </summary>
public Transform topConnector;
/// <summary>
/// 底部连接点
/// </summary>
public Transform bottomConnector;
/// <summary>
/// 水线
/// </summary>
public Transform waterline;
// "previewRotationEnabled": 0,
// "previewRotation": {
// "x": 0.0,
// "y": 0.0,
// "z": 0.0
// },
//
// "idleAnimation": {
// "m_FileID": 0,
// "m_PathID": 2768973905596830902
// },
// "swimAnimation": {
// "m_FileID": 0,
// "m_PathID": 7205922588037503814
// },
// "accelerateAnimation": {
// "m_FileID": 0,
// "m_PathID": 5473833867069321029
// },
// "turnLeftAnimation": {
// "m_FileID": 0,
// "m_PathID": 0
// },
// "turnRightAnimation": {
// "m_FileID": 0,
// "m_PathID": 0
// },
// "shake1Animation": {
// "m_FileID": 0,
// "m_PathID": 748440419864685152
// },
// "shake2Animation": {
// "m_FileID": 0,
// "m_PathID": 748440419864685152
// },
// "shake3Animation": {
// "m_FileID": 0,
// "m_PathID": 748440419864685152
// },
// "StuffedAnimation": {
// "m_FileID": 0,
// "m_PathID": 0
// },
// "useRendererBounds": 0,
// "overrideLengthAxis": 0,
// "lengthAxis": 0,
// "applyLengthFactor": 0,
// "lengthFactor": 0.0,
// "useStuffedAnim": 0,
// "stuffedFrameTime": 0.0
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 3e885da772834bb289c2368be2f6eb5b
timeCreated: 1743824616

View File

@@ -1,14 +0,0 @@
using UnityEngine;
namespace NBF
{
public class FishAsset : PreviewableAsset
{
public Transform root;
/// <summary>
/// 弯曲节点
/// </summary>
public Transform[] spines;
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: c12ba26d0bd74238ab26aee49ef6fd5d
timeCreated: 1743824172

View File

@@ -1,18 +0,0 @@
using UnityEngine;
namespace NBF
{
public class FishGroupAsset : MonoBehaviour
{
// "previewRotationEnabled": 0,
// "previewRotation": {
// "x": 0.0,
// "y": 0.0,
// "z": 0.0
// },
// "previewFitVertical": 1,
// "smallFishName": "ostrea_ed_o",
// "mediumFishName": "ostrea_ed_o",
// "largeFishName": "ostrea_ed_o"
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 2e9e67584f094dcbba9e61f37a55a5b4
timeCreated: 1743824179

View File

@@ -1,12 +0,0 @@
using UnityEngine;
namespace NBF
{
public class HookAsset : PreviewableAsset
{
/// <summary>
/// 鱼饵挂点
/// </summary>
public Transform baitConnector;
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: b6eea50c041f42d5bd95d9e56c3a9c6f
timeCreated: 1743824134

View File

@@ -1,8 +0,0 @@
using UnityEngine;
namespace NBF
{
public class LineAsset : PreviewableAsset
{
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 8059c6be171e47edb0390fa091285100
timeCreated: 1743824214

View File

@@ -1,20 +0,0 @@
using UnityEngine;
namespace NBF
{
public class LureAsset : PreviewableAsset
{
/// <summary>
/// 鱼钩挂点
/// </summary>
public Transform[] hookPoints;
[Tooltip("maksymalny kąt odchylenia przynetu przy sciaganiu, rotacja w osi Y")]
public float rotateVeloMaxAngle = 10f;
[Tooltip("predkosc odchylenia przynetu przy sciaganiu, rotacja w osi Y")]
public float rotateVeloMaxSpeed = 3f;
public Vector3 rotationInFishJaw = Vector3.zero;
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 897c0165284148879a9d158ea8010a15
timeCreated: 1743824269

View File

@@ -1,19 +0,0 @@
using System;
using UnityEngine;
namespace NBF
{
/// <summary>
/// 可以3D预览的资产
/// </summary>
public class PreviewableAsset : MonoBehaviour
{
[Tooltip("默认位置")] public Vector3 position;
[Tooltip("默认旋转")] public Vector3 rotation;
[Tooltip("默认形变")] public Vector3 scale;
[Tooltip("是否可以放大缩小")] public bool canZoom;
[Tooltip("放大缩小配置")] public Vector3 zoom;
[Tooltip("是否可以平移")] public bool canPan;
[Tooltip("平移配置")] public Rect pan;
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: a000ba87cd97499eb23feecf39521ecb
timeCreated: 1750736840

View File

@@ -1,8 +0,0 @@
using UnityEngine;
namespace NBF
{
public class PropAsset : PreviewableAsset
{
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: ea4d172189e248949431bb24b98369cb
timeCreated: 1743824159

View File

@@ -1,113 +0,0 @@
using UnityEngine;
namespace NBF
{
/// <summary>
/// 线轴资产配置
/// </summary>
public class ReelAsset : PreviewableAsset
{
// "previewRotationEnabled": 1,
// "previewRotation": {
// "x": 20.0,
// "y": -130.0,
// "z": 190.0
// },
// "reelType": 3,
// "reelSize": 11,
// "minLineMeshScale": 0.93,
// "maxLineMeshScale": 2.0,
// "scaleX": 0,
// "scaleY": 1,
// "scaleZ": 1,
// "rollHandleAnimation": {
// "m_FileID": 0,
// "m_PathID": 5949981527590265242
// },
// "rollUkladchikAnimation": {
// "m_FileID": 0,
// "m_PathID": 8960665928823962917
// },
// "rollShpulyaAnimation": {
// "m_FileID": 0,
// "m_PathID": -8671758223453786131
// },
// "frictionAnimation": {
// "m_FileID": 0,
// "m_PathID": 0
// },
// "openAnimation": {
// "m_FileID": 0,
// "m_PathID": -2998254598457423134
// },
// "closeAnimation": {
// "m_FileID": 0,
// "m_PathID": -56605426968450186
// },
// "startEngineAnimation": {
// "m_FileID": 0,
// "m_PathID": 0
// },
// "stopEngineAnimation": {
// "m_FileID": 0,
// "m_PathID": 0
// },
// "handleAnimationLoopCycles": 6,
// "ikLocatorFixEnabled": 0,
// "ikLocatorFixRotation": {
// "x": 0.0,
// "y": 0.0,
// "z": 0.0
// },
// "shiftRod": 0.0,
// "materialWithSerial": {
// "m_FileID": 0,
// "m_PathID": 0
// }
public enum Type
{
Normal = 0,
Casting = 1
}
public Type type;
/// <summary>
/// 动画组件
/// </summary>
public Animator animator;
/// <summary>
/// 根连接处
/// </summary>
public Transform rootConnector;
/// <summary>
///
/// </summary>
public Transform rootCompensator;
/// <summary>
/// 线连接处
/// </summary>
public Transform lineConnector;
/// <summary>
/// 线相交处
/// </summary>
public Transform lineIntersect;
public Transform lineIntersectHelper;
/// <summary>
/// ik抓握挂点
/// </summary>
public Transform handle;
/// <summary>
/// 手柄真实结束点
/// </summary>
public Transform handleEnd;
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 8898b66b55404fd3be13b7dcdcfda463
timeCreated: 1743785540

View File

@@ -1,61 +0,0 @@
using System;
using UnityEngine;
namespace NBF
{
/// <summary>
/// 鱼竿资产配置
/// </summary>
public class RodAsset : PreviewableAsset
{
/// <summary>
/// 根节点
/// </summary>
public Transform root;
public Transform gripEnd;
/// <summary>
/// 左手连接点
/// </summary>
public Transform LeftHandConnector;
/// <summary>
/// 右手连接点
/// </summary>
public Transform RightHandConnector;
/// <summary>
/// 线轴连接点
/// </summary>
public Transform ReelConnector;
/// <summary>
/// 弯曲节点
/// </summary>
public Transform[] joints;
/// <summary>
/// 圈挂点
/// </summary>
public Transform[] rings;
/// <summary>
/// rings 画线
/// </summary>
public LineRenderer lineRenderer;
/// <summary>
/// 鱼线连接点
/// </summary>
public Transform lineConnector;
private void Start()
{
if (!lineConnector && joints.Length > 0)
{
lineConnector = joints[^1];
}
}
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 45b047324a3349b9aea42f50cbd1ba71
timeCreated: 1743783252

View File

@@ -1,29 +0,0 @@
using UnityEngine;
namespace NBF
{
/// <summary>
/// 鱼竿导环资产配置
/// </summary>
public class RodRingAsset : MonoBehaviour
{
/// <summary>
/// 导环节点
/// </summary>
public RodRingNode[] rings;
}
[System.Serializable]
public class RodRingNode
{
/// <summary>
/// 导环点位
/// </summary>
public Transform ring;
/// <summary>
/// 线挂点
/// </summary>
public Transform point;
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: cdfd33eb69534a1e87cd523df4bfb430
timeCreated: 1743781816

View File

@@ -1,8 +0,0 @@
using UnityEngine;
namespace NBF
{
public class SpinnerLureAsset : PreviewableAsset
{
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: ed88dcaac7774ce79b04d90a3fa50533
timeCreated: 1745487261

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 0a1247222af84a66be775a4fe0af9a57
timeCreated: 1744041263

View File

@@ -1,199 +0,0 @@
using System.Collections.Generic;
using Unity.Mathematics;
using UnityEngine;
using Random = UnityEngine.Random;
namespace NBF
{
/// <summary>
/// 钓鱼数据源基类
/// </summary>
public class FishingDatasource
{
public readonly Dictionary<int, FPlayerData> Players = new Dictionary<int, FPlayerData>();
public void Init()
{
for (int i = 0; i < 1; i++)
{
var p = GetTestPlayer(i);
AddPlayer(p);
}
}
public void Update()
{
}
public void AddPlayer(FPlayerData player)
{
Players[player.PlayerID] = player;
}
public FPlayerData GetPlayer(int playerID)
{
return Players.GetValueOrDefault(playerID);
}
public FPlayerData GetSelfPlayer()
{
return GetPlayer(GameModel.RoleID);
}
#region
public void SetSelfTestGear(int slot)
{
var player = GetSelfPlayer();
if (player != null)
{
player.currentGear = new FPlayerGearData();
var gear = player.currentGear;
if (slot == 1)
{
player.lineLength = 3.6f;
gear.Type = GearType.Pole;
gear.rod = new FRodData()
{
id = Random.Range(1, 100000),
configId = 100001,
};
gear.line = new FLineData()
{
id = Random.Range(1, 100000),
configId = 400001
};
gear.bobber = new FBobberData()
{
id = Random.Range(1, 100000),
configId = 300001
};
gear.hook = new FHookData()
{
id = Random.Range(1, 100000),
configId = 700001
};
gear.bait = new FBaitData()
{
id = Random.Range(1, 100000),
configId = 500002
};
gear.weight = new FWeightData()
{
id = Random.Range(1, 100000),
configId = 800001
};
gear.reel = null;
}
else if (slot == 2)
{
player.lineLength = 0.4f;
gear.Type = GearType.SpinningFloat;
gear.rod = new FRodData()
{
id = Random.Range(1, 100000),
configId = 100002
};
gear.reel = new FReelData()
{
id = Random.Range(1, 100000),
configId = 200001
};
gear.line = new FLineData()
{
id = Random.Range(1, 100000),
configId = 400001
};
gear.bait = new FBaitData()
{
id = Random.Range(1, 100000),
configId = 500002
};
gear.bobber = new FBobberData()
{
id = Random.Range(1, 100000),
configId = 300001
};
gear.hook = new FHookData()
{
id = Random.Range(1, 100000),
configId = 700001
};
gear.weight = new FWeightData()
{
id = Random.Range(1, 100000),
configId = 800001
};
}
else if (slot == 3)
{
player.lineLength = 0.4f;
gear.Type = GearType.Spinning;
gear.bobber = null;
gear.rod = new FRodData()
{
id = Random.Range(1, 100000),
configId = 100003,
};
gear.reel = new FReelData()
{
id = Random.Range(1, 100000),
configId = 200001
};
gear.line = new FLineData()
{
id = Random.Range(1, 100000),
configId = 400001
};
gear.leader = new FLeaderData()
{
id = Random.Range(1, 100000),
configId = 0
};
gear.lure = new FLureData()
{
id = Random.Range(1, 100000),
configId = 600001
};
}
}
}
private FPlayerData GetTestPlayer(int index)
{
FPlayerData player = new FPlayerData
{
PlayerID = 100 + index
};
var add = 0;//Random.Range(0, 5f) + index * 0.5f;
player.position = new Vector3(325.04f + add, 11, 606.28f);
player.rotation = quaternion.identity;
if (index == 0)
{
player.currentGear = new FPlayerGearData();
}
else if (index == 1)
{
}
else if (index == 2)
{
player.currentGear = new FPlayerGearData();
}
else
{
}
return player;
}
#endregion
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 6b5a6200eb494c0ea9cb0bbe8345046c
timeCreated: 1744041274

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 03e80f6925b44b3dbfd52a46c766b08b
timeCreated: 1744116926

View File

@@ -1,121 +0,0 @@
using System;
using NBC;
using UnityEngine;
namespace NBF
{
public class FishingPlay
{
public FishingDatasource Data { get; private set; }
public FishingPlay(FishingDatasource datasource)
{
Data = datasource;
}
public FPlayer SelfPlayer;
public void Init()
{
// FishingData = fishingData;
LoadLevel();
}
#region Loading UnLoading
private SequenceTaskCollection _battleLoadingTasks;
private SequenceTaskCollection _battleUnLoadingTasks;
protected void ClearLoadingTasks()
{
if (_battleLoadingTasks == null) return;
_battleLoadingTasks.Stop();
_battleLoadingTasks.Clear();
_battleLoadingTasks = null;
}
protected void ClearUnLoadingTasks()
{
if (_battleUnLoadingTasks == null) return;
_battleUnLoadingTasks.Stop();
_battleUnLoadingTasks.Clear();
_battleUnLoadingTasks = null;
}
#endregion
#region Load and Unload
protected void LoadLevel()
{
_battleLoadingTasks = new SequenceTaskCollection();
_battleLoadingTasks.AddTask(LoadBattleTask());
_battleLoadingTasks.AddTask(LoadObjects());
_battleLoadingTasks.OnCompleted(_ => { OnLoadBattleDone(); });
Loading.Show(_battleLoadingTasks);
_battleLoadingTasks.Run(DefRunner.Scheduler);
}
public void UnLoadLevel(Action callback)
{
}
/// <summary>
/// 加载场景需要资源
/// </summary>
/// <returns></returns>
private ParallelTaskCollection LoadBattleTask()
{
ParallelTaskCollection subTask1 = new();
subTask1.AddTask(new LoadSceneTask("Map4"));
return subTask1;
}
/// <summary>
/// 加载实例化场景对象
/// </summary>
/// <returns></returns>
private ParallelTaskCollection LoadObjects()
{
ParallelTaskCollection subTask1 = new();
subTask1.AddTask(new InitPlayersTask(this));
subTask1.AddTask(new RunFunTask(AddCameraStack));
subTask1.AddTask(new RunFunTask(FindSceneObjects));
return subTask1;
}
private void FindSceneObjects()
{
// WaterObject = GameObject.FindWithTag("Water").transform;
}
private void AddCameraStack()
{
// MainPlayer.m_Camera.AddStack(StageCamera.main);
}
private void RemoveCameraStack()
{
// MainPlayer.m_Camera.RemoveStack(StageCamera.main);
}
private void OnLoadBattleDone()
{
Debug.LogError("加载关卡结束===");
FishingPanel.Show();
// BaseCamera.AddStack(StageCamera.main);
Loading.Hide();
}
#endregion
public void Update()
{
}
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: ce4368f9da864c3fb9ff7ebe7322fec6
timeCreated: 1742567951

View File

@@ -1,78 +0,0 @@
using NBC;
namespace NBF
{
public class Fishing
{
Fishing()
{
App.OnUpdate += Update;
}
private static Fishing _inst;
public static Fishing Inst => _inst ??= new Fishing();
public int Map { get; private set; }
public FishingPlay Player { get; private set; }
public FishingDatasource Datasource { get; private set; }
public void Go(int map)
{
Map = map;
EnterMap();
}
#region Load
private void EnterMap()
{
EnterDone();
}
#endregion
void Update()
{
Datasource?.Update();
Player?.Update();
}
/// <summary>
/// 进入地图成功
/// </summary>
private void EnterDone()
{
DataInit();
PlayerInit();
}
private void DataInit()
{
Datasource = new FishingDatasource();
Datasource.Init();
}
private void PlayerInit()
{
if (Player != null)
{
Player.UnLoadLevel(NewBattlePlayInit);
}
else
{
NewBattlePlayInit();
}
}
private void NewBattlePlayInit()
{
Player = new FishingPlay(Datasource);
Player.Init();
}
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 158a88fb17104b1fa7818e84197d4eee
timeCreated: 1742567921

View File

@@ -1,58 +0,0 @@
using RootMotion.FinalIK;
using UnityEngine;
namespace NBF
{
public class PlayerArm : MonoBehaviour
{
public bool IsLeft;
public LimbIK IK;
public Transform RodContainer;
public Transform LeftRigMagnet;
public FingerRig FingerRig;
public PlayerShoulder Shoulder;//PlayerShoulder
[HideInInspector] public float interactionTargetWeight;
public void SetReelHandle(ReelAsset asset)
{
IK.solver.target = asset.handle;
IK.enabled = true;
// var fingers = FingerRig.fingers;
// foreach (var finger in fingers)
// {
// finger.target = asset.handleEnd;
// }
// // 启用整体控制
// FingerRig.weight = 1f;
//
// // 绑定大拇指和食指的目标
// FingerRig.fingers[0].target = asset.handleEnd; // Thumb
// FingerRig.fingers[1].target = asset.handleEnd; // Index
//
// FingerRig.fingers[0].weight = 1f;
// FingerRig.fingers[1].weight = 1f;
// 其余手指握拳(不绑定 target
for (int i = 2; i < 5; i++)
{
FingerRig.fingers[i].target = null;
FingerRig.fingers[i].weight = 1f;
}
}
public void MoveTowardsInteraction()
{
if (!IK)
{
return;
}
IK.solver.SetIKPositionWeight(Mathf.MoveTowards(IK.solver.IKPositionWeight,
interactionTargetWeight, Time.deltaTime * 2f));
}
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 99467c6c370b440d8bdb517bbbcf22cf
timeCreated: 1743435628

View File

@@ -1,37 +0,0 @@
using System;
using UnityEngine;
namespace NBF
{
public class PlayerShoulder : MonoBehaviour
{
private Vector3 startEulerAngles;
private const int MaxAngle = 30;
private const int MinAngle = -30;
public float TestZ;
private void Awake()
{
startEulerAngles = transform.localEulerAngles;
}
public void SetCameraEulerAngleX(float value)
{
value = (value > 180f) ? value - 360f : value;
Debug.Log($"value={value}");
var addValue = value * -1;
if (addValue > MaxAngle)
{
addValue = MaxAngle;
}
else if (addValue < MinAngle)
{
addValue = MinAngle;
}
transform.localEulerAngles =
new Vector3(addValue + startEulerAngles.x, startEulerAngles.y, TestZ);
}
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 0d621debd7244988afb98b7c06605f63
timeCreated: 1747228668

View File

@@ -1,9 +0,0 @@
using UnityEngine;
namespace NBF
{
public class SceneNode : MonoBehaviour
{
public int index = 0;
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 646e0006924a42ba9fbadd56984a61d1
timeCreated: 1744120018

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 763c0b906611497b9c6451178fcf3ddf
timeCreated: 1742644058

View File

@@ -1,12 +0,0 @@
using NBC;
namespace NBF
{
public class EnterMapRoomTask : NTask
{
protected override void OnStart()
{
Finish();
}
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: aed100679224409eb9fe972ab68dfaa4
timeCreated: 1744041480

View File

@@ -1,63 +0,0 @@
using NBC;
using UnityEngine;
namespace NBF
{
public class InitPlayersTask : NTask
{
private ParallelTaskCollection _parallelTaskCollection = new ParallelTaskCollection();
private FishingPlay _fishingPlay;
public InitPlayersTask(FishingPlay fishingPlay)
{
_fishingPlay = fishingPlay;
}
protected override void OnStart()
{
_parallelTaskCollection.ParallelNum = 2;
var players = _fishingPlay.Data.Players.Values;
foreach (var player in players)
{
_parallelTaskCollection.AddTask(new InitPlayerTask(_fishingPlay, player));
}
_parallelTaskCollection.OnCompleted(LoadDone);
_parallelTaskCollection.Run(DefRunner.Scheduler);
// var player = Object.FindFirstObjectByType<FPlayer>();
// _fishingPlay.MainPlayer = player;
// Finish();
}
private void LoadDone(ITask task)
{
Finish();
}
}
public class InitPlayerTask : NTask
{
private FishingPlay _fishingPlay;
private FPlayerData _playerData;
public InitPlayerTask(FishingPlay fishingPlay, FPlayerData playerData)
{
_fishingPlay = fishingPlay;
_playerData = playerData;
}
protected override void OnStart()
{
base.OnStart();
var model = Resources.Load<GameObject>("Prefabs/Player/male");
var playerObject = Object.Instantiate(model, SceneSettings.Instance.Node);
var player = playerObject.GetComponent<FPlayer>();
player.InitData(_playerData);
Finish();
}
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: e21c997927494f67a63ea624a92aee36
timeCreated: 1742644061