表格重构

This commit is contained in:
2025-10-10 17:57:36 +08:00
parent bf2f6d2680
commit bf7b1bbbb2
133 changed files with 4481 additions and 1366 deletions

View File

@@ -0,0 +1,137 @@
using System;
using System.Linq;
using UnityEngine;
namespace NBF
{
[TableName("gameBaits")]
public partial class BaitConfig : ConfigGearBase
{
public enum Type
{
Natural = 0,
Spinning = 1
}
public Type type;
public FishSpecies[] acceptFish;
public Vector2 weightFishAccept = new Vector2(0f, 3f);
public float weight = 10f;
public float lenght;
public int amount = 1;
public int Level = 1;
private Vector2 startedbaitValues;
public virtual bool CheckIsFishAccept(FishSpecies fishSpecies, float fishWeight = 0f)
{
var fish = FishConfig.Get(t => t.speciesName == fishSpecies);
if (fish == null) return false;
if (fish.type == FishConfig.Type.Predator && type == Type.Spinning)
{
Vector2 vector = weightFishAccept;
Debug.Log("Startowa wartosc przynety:" + vector.ToString());
vector = startedbaitValues;
Debug.Log("Kolejna wartosc przynety 1:" + vector.ToString());
Vector2 vector2 = new Vector2(0f, 0f);
if (startedbaitValues == vector2)
{
if (weightFishAccept.x > 0.01f && weightFishAccept.x <= 2.5f)
{
weightFishAccept.x = 0.01f;
}
else if (weightFishAccept.x > 2.5f && weightFishAccept.x <= 9.2f)
{
weightFishAccept.x = 2.5f;
}
else if (weightFishAccept.x > 9.2f && weightFishAccept.x <= 20f)
{
weightFishAccept.x = 8f;
}
else if (weightFishAccept.x > 20f && weightFishAccept.x <= 50f)
{
weightFishAccept.x = 14f;
}
else if (weightFishAccept.x > 50f && weightFishAccept.x <= 700f)
{
weightFishAccept.x = 22f;
}
else if (weightFishAccept.x > 700f)
{
weightFishAccept.x = 150f;
}
if (weightFishAccept.y > 0.1f && weightFishAccept.y <= 3f)
{
weightFishAccept.y = 3f;
}
else if (weightFishAccept.y > 3f && weightFishAccept.y <= 9f)
{
weightFishAccept.y = 12f;
}
else if (weightFishAccept.y > 9f && weightFishAccept.y <= 24f)
{
weightFishAccept.y = 60f;
}
else if (weightFishAccept.y > 24f && weightFishAccept.y <= 50f)
{
weightFishAccept.y = 120f;
}
else if (weightFishAccept.y > 50f && weightFishAccept.y <= 105f)
{
weightFishAccept.y = 350f;
}
else if (weightFishAccept.y > 105f && weightFishAccept.y <= 170f)
{
weightFishAccept.y = 650f;
}
else if (weightFishAccept.y > 170f && weightFishAccept.y <= 500f)
{
weightFishAccept.y = 900f;
}
else if (weightFishAccept.y > 500f)
{
weightFishAccept.y = 1800f;
}
startedbaitValues = weightFishAccept;
vector = startedbaitValues;
Debug.Log("Kolejna wartosc przynety: 2" + vector.ToString());
}
if (fishWeight >= weightFishAccept.x && fishWeight <= weightFishAccept.y)
{
vector = weightFishAccept;
Debug.Log("Fish accept lure: " + vector.ToString() + " weight:" + fishWeight);
return true;
}
}
else if (fish.type == FishConfig.Type.WhiteFish && type == Type.Natural)
{
if (acceptFish.Contains(fishSpecies))
{
Debug.Log("Fish accept bait weight:" + fishWeight);
return true;
}
}
else if (fish.type == FishConfig.Type.Predator && type == Type.Natural &&
acceptFish.Contains(fishSpecies))
{
Debug.Log("Fish accept bait predator weight:" + fishWeight);
return true;
}
return false;
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 29ac65179e8d469d96caa04ce15021d6
timeCreated: 1742999023

View File

@@ -0,0 +1,32 @@
using System;
using UnityEngine;
namespace NBF
{
[TableName("gameFloats")]
public partial class BobberConfig : ConfigGearBase
{
public enum Type
{
Slider = 0,
Waggler = 1,
PoleFloats = 2,
Sport = 3,
Ball = 4,
Sinker = 5
}
public Type type;
public float weight = 10f;
public float displacement = 10f;
public bool isNightLight;
public int Level = 1;
public int amount = 1;
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 6297ba097dac45eb8f14f55dc5ad7d7b
timeCreated: 1742999241

View File

@@ -0,0 +1,68 @@
using System;
using UnityEngine;
namespace NBF
{
public enum CameraUpdateMode
{
Smooth,
Immediate,
}
public enum CameraMode
{
Third,
Free,
}
[Serializable]
public class CameraCfg
{
public CameraMode Mode;
public CameraUpdateMode UpdateMode;
public float SmoothTime;
public float NearClipPlane = 1;
public float FarClipPlane = 500;
public Vector3 Near;
public Vector3 Far;
public float BestRatio = 0.5f;
public Vector3 Distance
{
get { return this.Far - this.Near; }
}
public Vector3 Best
{
get
{
switch (Mode)
{
case CameraMode.Third:
return this.Near + (this.Far - this.Near) * this.BestRatio;
default:
return Quaternion.Euler(this.PitchBest, 0, 0) *
(Vector3.back * (this.Near + (this.Far - this.Near) * this.BestRatio).magnitude);
}
}
}
public float Yaw;
public bool YawAtThird;
public float PitchBest;
public float PitchMin;
public float PitchMax;
}
[CreateAssetMenu(menuName = "ET/CreateCameraConfig", fileName = "CameraCfg", order = 1)]
public class CameraScriptObject : ScriptableObject
{
public float ScaleTime = 6;
public CameraCfg ThirdCfg;
public CameraCfg FreeCfg;
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 5f43c20e40ae42239e4381c12ad7cc00
timeCreated: 1756823027

View File

@@ -0,0 +1,53 @@
using System;
using Newtonsoft.Json.Linq;
using UnityEngine;
using Object = UnityEngine.Object;
namespace NBF
{
public interface IConfigJsonParse
{
void Parse(JToken row);
}
public interface ICustomParse
{
void Parse(JToken row);
}
[Serializable]
public abstract class ConfigBase
{
public string name;
public int id;
}
public abstract class ConfigGearBase : ConfigBase
{
public string modelPath = "Models/Rods/";
protected virtual string ModelRoot => "gfx/";
/// <summary>
/// 所属的组
/// </summary>
public int group;
public GameObject GetModelPrefab()
{
return Resources.Load(ModelRoot + modelPath) as GameObject;
}
public GameObject Instantiate(Transform parent)
{
return Object.Instantiate(GetModelPrefab(), Vector3.zero, Quaternion.identity, parent);
}
public GameObject Instantiate(Transform parent, Vector3 position,
Quaternion rotation)
{
return Object.Instantiate(GetModelPrefab(), position, rotation, parent);
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: bfb754c68ea2417685d3e29804c996fa
timeCreated: 1742998658

View File

@@ -0,0 +1,25 @@
using System;
using UnityEngine;
namespace NBF
{
[TableName("gameFeeders")]
public partial class FeederConfig : ConfigGearBase
{
public enum Type
{
Feeder = 0
}
public Type type;
public float weight = 10f;
public float capacity = 10f;
public int Level = 1;
public int amount = 1;
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 4a3acf5935cc49be8a1e655250ea28e9
timeCreated: 1742999291

View File

@@ -0,0 +1,12 @@
namespace NBF
{
[TableName("gameFishAccepts")]
public partial class FishAcceptConfig : ConfigBase
{
public int bait;
public float min;
public float max;
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 315e92a457a44e67a23cc79710bebdb6
timeCreated: 1744862496

View File

@@ -0,0 +1,134 @@
using System;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
namespace NBF
{
[Serializable]
public class AcceptFishBait
{
public string baitName;
public int baitId;
public float min;
public float max;
}
[TableName("gameFish")]
public partial class FishConfig : ConfigBase
{
public static FishConfig Get(FishSpecies fishSpecies)
{
return Get(t => t.speciesName == fishSpecies);
}
public enum Type
{
WhiteFish = 0,
Predator = 1
}
public FishSpecies speciesName;
public bool isEnabled = true;
public Type type = Type.Predator;
public float maxWeight = 10f;
public float speciesCoins = 4f;
public int rankingPoint = 1;
public string[] modelPath;
public string[] imagePath;
public string[] modelTrophyPath;
public Vector2[] weightLenghtValues;
public AnimationCurve weightLengthCurve;
public List<AcceptFishBait> acceptFishBaits;
public List<AcceptFishBait> acceptFishLures;
public Sprite GetIconImage(int index)
{
return Resources.Load<Sprite>("Icons/Fish/" + imagePath[index]);
}
public float ConvertWeightFishToLength(float weight)
{
// return FishWeightToLength.Instance.ConvertWeightFishToLength(speciesName, weight);
return 1;
}
public void SetupCurvesWeight()
{
weightLengthCurve.keys = null;
for (int i = 0; i < weightLenghtValues.Length; i++)
{
weightLengthCurve.AddKey(weightLenghtValues[i].x, weightLenghtValues[i].y);
}
}
public Vector3 GetFishScale(float weight)
{
// if (!FishWeightToLength.Instance)
// {
// return Vector3.one;
// }
//
// var p = FishWeightToLength.Instance.ConvertWeightFishToLength(speciesName, weight);
// float num = FishWeightToLength.Instance.ConvertWeightFishToLength(speciesName, weight) * 0.0185f;
// return Vector3.one * num;
return Vector3.one;
}
public GameObject GetModelPrefab(string _modelPath)
{
return Resources.Load("GameItemsPrefabs/Fish/" + _modelPath) as GameObject;
}
public GameObject GetTrophyModelPrefab(float weight)
{
if (weight > maxWeight)
{
weight = maxWeight;
}
float num = maxWeight / (float)modelTrophyPath.Length;
int num2 = (int)(weight / num);
if (num2 >= modelTrophyPath.Length)
{
num2 = modelTrophyPath.Length - 1;
}
return Resources.Load("GameItemsPrefabs/Fish Trophies/" + modelTrophyPath[num2]) as GameObject;
}
public GameObject GetFishModel(float weight)
{
if (weight > maxWeight)
{
weight = maxWeight;
}
float num = maxWeight / (float)modelPath.Length;
int num2 = (int)(weight / num);
if (num2 >= modelPath.Length)
{
num2 = modelPath.Length - 1;
}
return GetModelPrefab(modelPath[num2]);
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 036e4898008747fda0a473707565667b
timeCreated: 1742999445

View File

@@ -0,0 +1,167 @@
using System;
using UnityEngine;
namespace NBF
{
[TableName("gameHooks")]
public partial class HookConfig : ConfigGearBase
{
public enum Type
{
Aberdeen = 0,
Bait = 1,
Circle = 2,
Treble = 3,
Octopus = 4,
Carp = 5,
LiveBait = 6,
WideGap = 7
}
public enum Zadzior
{
None = 0,
Barbless = 1
}
public enum Size
{
_16 = 0,
_14 = 1,
_12 = 2,
_10 = 3,
_9 = 4,
_8 = 5,
_7 = 6,
_6 = 7,
_5 = 8,
_4 = 9,
_3 = 10,
_2 = 11,
_1 = 12,
_1x0 = 13,
_2x0 = 14,
_3x0 = 15,
_4x0 = 16,
_5x0 = 17,
_6x0 = 18,
_7x0 = 19,
_8x0 = 20,
_9x0 = 21,
_10x0 = 22,
_11x0 = 23,
_12x0 = 24,
_13x0 = 25,
_14x0 = 26
}
public string color = "Nickel";
public Type type;
public Zadzior zadzior;
public Size size;
public int amount = 1;
public int Level = 1;
public string GetSizetext()
{
return size.ToString().Replace("_", "#").Replace("x", "/");
}
public Vector2 GetFishAcceptWeightBySize()
{
Vector2 result = Vector2.zero;
switch (size)
{
case Size._16:
result = new Vector2(0f, 3.5f);
break;
case Size._14:
result = new Vector2(0.4f, 5.3f);
break;
case Size._12:
result = new Vector2(0.5f, 7.4f);
break;
case Size._10:
result = new Vector2(0.7f, 10.3f);
break;
case Size._9:
result = new Vector2(1f, 14.4f);
break;
case Size._8:
result = new Vector2(1.4f, 20.2f);
break;
case Size._7:
result = new Vector2(1.6f, 26.2f);
break;
case Size._6:
result = new Vector2(1.8f, 31.5f);
break;
case Size._5:
result = new Vector2(2.2f, 34.6f);
break;
case Size._4:
result = new Vector2(2.4f, 45f);
break;
case Size._3:
result = new Vector2(3.1f, 58.5f);
break;
case Size._2:
result = new Vector2(4.1f, 81.9f);
break;
case Size._1:
result = new Vector2(5.7f, 114.6f);
break;
case Size._1x0:
result = new Vector2(9.2f, 160.5f);
break;
case Size._2x0:
result = new Vector2(12.8f, 216.7f);
break;
case Size._3x0:
result = new Vector2(17.3f, 292.5f);
break;
case Size._4x0:
result = new Vector2(23.4f, 394.9f);
break;
case Size._5x0:
result = new Vector2(31.6f, 533.1f);
break;
case Size._6x0:
result = new Vector2(42.6f, 693f);
break;
case Size._7x0:
result = new Vector2(55.4f, 935f);
break;
case Size._8x0:
result = new Vector2(74.8f, 1122f);
break;
case Size._9x0:
result = new Vector2(89f, 1342f);
break;
case Size._10x0:
result = new Vector2(107f, 1616f);
break;
case Size._11x0:
result = new Vector2(129f, 1940f);
break;
case Size._12x0:
result = new Vector2(155f, 2328f);
break;
case Size._13x0:
result = new Vector2(186f, 2793f);
break;
case Size._14x0:
result = new Vector2(223f, 3352f);
break;
}
return result;
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 163f314510a24a43b7f86e22854cde3b
timeCreated: 1742999185

View File

@@ -0,0 +1,19 @@
using System;
using UnityEngine;
namespace NBF
{
[TableName("gameLeaders")]
public partial class LeadersConfig : ConfigGearBase
{
public enum Type
{
Mono = 0,
Wire = 1,
Steel = 2,
Titanium = 3
}
public Type type;
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 4a5ae0258ce84be1b6b2c2cb6a9921f9
timeCreated: 1742998962

View File

@@ -0,0 +1,28 @@
using System;
using UnityEngine;
namespace NBF
{
[TableName("gameLines")]
public partial class LineConfig : ConfigGearBase
{
protected override string ModelRoot => "GameItemsPrefabs/";
public enum Type
{
Mono = 0,
Braid = 1,
Fluro = 2
}
public Type type;
public int length = 125;
public float strength = 1f;
public float size = 0.12f;
public int Level = 1;
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 8f09d37212e24ee2bb9f0b99ca69df42
timeCreated: 1742998906

View File

@@ -0,0 +1,123 @@
using UnityEngine;
namespace NBF
{
[TableName("gameLures")]
public partial class LureConfig : ConfigGearBase
{
public enum Type
{
Natural = 0,
Spinning = 1
}
public Type type;
public FishSpecies[] acceptFish;
public Vector2 weightFishAccept = new Vector2(0f, 3f);
public float weight = 10f;
public float lenght;
public int amount = 1;
public int Level = 1;
/// <summary>
/// 配的鱼钩
/// </summary>
public int[] hook;
private Vector2 startedbaitValues;
private Vector2 _startedbaitValues;
public bool CheckIsFishAccept(FishSpecies fishSpecies, float fishWeight = 0)
{
if (FishConfig.Get(fishSpecies).type == FishConfig.Type.Predator)
{
Vector2 vector = weightFishAccept;
Debug.Log("诱饵的初始值:" + vector.ToString());
vector = _startedbaitValues;
Debug.Log("下一个诱饵值 1:" + vector.ToString());
Vector2 vector2 = new Vector2(0f, 0f);
if (_startedbaitValues == vector2)
{
if (weightFishAccept.x > 0.01f && weightFishAccept.x <= 2.5f)
{
weightFishAccept.x = 0.01f;
}
else if (weightFishAccept.x > 2.5f && weightFishAccept.x <= 9.2f)
{
weightFishAccept.x = 2.5f;
}
else if (weightFishAccept.x > 9.2f && weightFishAccept.x <= 20f)
{
weightFishAccept.x = 8f;
}
else if (weightFishAccept.x > 20f && weightFishAccept.x <= 50f)
{
weightFishAccept.x = 14f;
}
else if (weightFishAccept.x > 50f && weightFishAccept.x <= 700f)
{
weightFishAccept.x = 22f;
}
else if (weightFishAccept.x > 700f)
{
weightFishAccept.x = 150f;
}
if (weightFishAccept.y > 0.1f && weightFishAccept.y <= 3f)
{
weightFishAccept.y = 3f;
}
else if (weightFishAccept.y > 3f && weightFishAccept.y <= 9f)
{
weightFishAccept.y = 12f;
}
else if (weightFishAccept.y > 9f && weightFishAccept.y <= 24f)
{
weightFishAccept.y = 60f;
}
else if (weightFishAccept.y > 24f && weightFishAccept.y <= 50f)
{
weightFishAccept.y = 120f;
}
else if (weightFishAccept.y > 50f && weightFishAccept.y <= 105f)
{
weightFishAccept.y = 350f;
}
else if (weightFishAccept.y > 105f && weightFishAccept.y <= 170f)
{
weightFishAccept.y = 650f;
}
else if (weightFishAccept.y > 170f && weightFishAccept.y <= 500f)
{
weightFishAccept.y = 900f;
}
else if (weightFishAccept.y > 500f)
{
weightFishAccept.y = 1800f;
}
_startedbaitValues = weightFishAccept;
vector = _startedbaitValues;
Debug.Log("另一个有价值的诱饵: 2" + vector.ToString());
}
if (fishWeight >= weightFishAccept.x && fishWeight <= weightFishAccept.y)
{
vector = weightFishAccept;
Debug.Log("Fish accept lure: " + vector.ToString() + " weight:" + fishWeight);
return true;
}
}
return false;
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 184995816e1944d2afc02384ef109693
timeCreated: 1744898827

View File

@@ -0,0 +1,30 @@
using System;
using UnityEngine;
namespace NBF
{
[TableName("gameReels")]
public partial class ReelConfig : ConfigGearBase
{
// protected override string ModelRoot => "GameItemsPrefabs/";
public enum Type
{
Universal = 0,
Spinning = 1,
Casting = 2,
Feeder = 3
}
public Type type;
public float strength = 1f;
public Vector2 gearRatio;
public int size = 2000;
public int Level = 1;
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 13045659d27f4ee89aab30efb1740215
timeCreated: 1742998847

View File

@@ -0,0 +1,7 @@
namespace NBF
{
[TableName("gameRings")]
public partial class RingConfig : ConfigGearBase
{
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 15f2ba6ac6404e9390d9cc2604f2016c
timeCreated: 1744861381

View File

@@ -0,0 +1,41 @@
using System;
using UnityEngine;
namespace NBF
{
[TableName("gameRods")]
public partial class RodConfig : ConfigGearBase
{
public enum Type
{
Universal = 0,
Tele = 1,
SpinningFloat = 2,
Spinning = 3,
}
public enum Action
{
Slow = 0,
Medium = 1,
Fast = 2
}
public Type type;
public string length;
public string weight;
public float strength = 2f;
public int maxRange = 15;
/// <summary>
/// 使用的圈id
/// </summary>
public int ring;
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 01b7a315690b4a2d8f82aec56a3a3971
timeCreated: 1742998702

View File

@@ -0,0 +1,31 @@
namespace NBF
{
[TableName("gameUnit")]
public partial class UnitConfig : ConfigBase
{
public UnitType Type;
}
public enum UnitType : byte
{
/// <summary>
/// 玩家
/// </summary>
Player = 1,
/// <summary>
/// 鱼
/// </summary>
Fish = 2,
/// <summary>
/// 船
/// </summary>
Boat = 3,
/// <summary>
/// 车
/// </summary>
Car = 4,
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 956ed7b067744c369fcff9a8baef77ee
timeCreated: 1756049614

View File

@@ -0,0 +1,26 @@
using System;
using UnityEngine;
namespace NBF
{
[TableName("gameWeights")]
public partial class WeightConfig : ConfigGearBase
{
protected override string ModelRoot => "GameItemsPrefabs/";
public enum Type
{
Ball = 0,
Teardrop = 1,
Olive = 2
}
public Type type;
public float weight = 0.1f;
public int Level = 1;
public int amount = 1;
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 6bfe88a3b2474031aa65c995baebf6f6
timeCreated: 1742999355