表格重构
This commit is contained in:
@@ -1,7 +1,373 @@
|
|||||||
{
|
{
|
||||||
|
"WeightConfig": [
|
||||||
|
{
|
||||||
|
"Id": 100001,
|
||||||
|
"Model": "Weights/Weight2_5g",
|
||||||
|
"Type": 0,
|
||||||
|
"Weight": 3
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"RingConfig": [
|
||||||
|
{
|
||||||
|
"Id": 120001,
|
||||||
|
"Model": "rod_rings/rumoi/rumoi_oxiline_spin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 120002,
|
||||||
|
"Model": "rod_rings/smt/smt_pure_ceramic_bolo"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"LureConfig": [
|
||||||
|
{
|
||||||
|
"Id": 80001,
|
||||||
|
"Model": "lures/express_fishing/crankbaits_1/775/crankbaits_775",
|
||||||
|
"Hook": [
|
||||||
|
700102
|
||||||
|
],
|
||||||
|
"EfficacyBase": 50,
|
||||||
|
"Length": 0,
|
||||||
|
"Weight": 250
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 80002,
|
||||||
|
"Model": "lures/express_fishing/poppers_1/poppers_590/poppers_590",
|
||||||
|
"Hook": [
|
||||||
|
700102
|
||||||
|
],
|
||||||
|
"EfficacyBase": 50,
|
||||||
|
"Length": 0,
|
||||||
|
"Weight": 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 80003,
|
||||||
|
"Model": "lures/express_fishing/softplastic/ef_supergrab_6/softplastic_g_1622",
|
||||||
|
"Hook": [
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"EfficacyBase": 50,
|
||||||
|
"Length": 0,
|
||||||
|
"Weight": 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 80004,
|
||||||
|
"Model": "lures/express_fishing/softplastic/ef_superminnow_6/softplastic_m_1634",
|
||||||
|
"Hook": [
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"EfficacyBase": 50,
|
||||||
|
"Length": 0,
|
||||||
|
"Weight": 120
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"ItemConfig": [
|
||||||
|
{
|
||||||
|
"Id": 10001,
|
||||||
|
"Model": "rods/syberia/tele_10037/tele_10037_t13",
|
||||||
|
"Type": 1,
|
||||||
|
"Max": 0,
|
||||||
|
"AutoUse": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 10002,
|
||||||
|
"Model": "rods/syberia/bolo_10021/bolo_10021_LB400",
|
||||||
|
"Type": 0,
|
||||||
|
"Max": 1100002,
|
||||||
|
"AutoUse": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 10003,
|
||||||
|
"Model": "rods/syberia/spin_10034/spin_10034_S60H",
|
||||||
|
"Type": 0,
|
||||||
|
"Max": 1100001,
|
||||||
|
"AutoUse": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"ReelConfig": [
|
||||||
|
{
|
||||||
|
"Id": 40001,
|
||||||
|
"Model": "reels/syberia/spin_5002/spin_5002",
|
||||||
|
"Type": 0,
|
||||||
|
"GearRatio": [
|
||||||
|
"7"
|
||||||
|
],
|
||||||
|
"Size": 250,
|
||||||
|
"Strength": 40
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 40002,
|
||||||
|
"Model": "reels/syberia/spin_5036/spin_5036",
|
||||||
|
"Type": 0,
|
||||||
|
"GearRatio": [
|
||||||
|
"5"
|
||||||
|
],
|
||||||
|
"Size": 120,
|
||||||
|
"Strength": 40
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"LineConfig": [
|
||||||
|
{
|
||||||
|
"Id": 60001,
|
||||||
|
"Model": "Lines/UFE Mono/UFE monoClear",
|
||||||
|
"Type": 0,
|
||||||
|
"Length": 7,
|
||||||
|
"Strength": 40,
|
||||||
|
"Size": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 60002,
|
||||||
|
"Model": "rods/syberia/bolo_10021/bolo_10021_LB400",
|
||||||
|
"Type": 0,
|
||||||
|
"Length": 5,
|
||||||
|
"Strength": 40,
|
||||||
|
"Size": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"HookConfig": [
|
||||||
|
{
|
||||||
|
"Id": 90001,
|
||||||
|
"Model": "hooks/alliance/c_hook_20789_20794/c_hook_20789",
|
||||||
|
"Type": 1,
|
||||||
|
"Zadzior": 1,
|
||||||
|
"Length": 0,
|
||||||
|
"Weight": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 90002,
|
||||||
|
"Model": "hooks/berserk_hooks/triple_20569_20577/triple_20569",
|
||||||
|
"Type": 1,
|
||||||
|
"Zadzior": 1,
|
||||||
|
"Length": 0,
|
||||||
|
"Weight": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"RodConfig": [
|
||||||
|
{
|
||||||
|
"Id": 30001,
|
||||||
|
"Model": "rods/syberia/tele_10037/tele_10037_t13",
|
||||||
|
"Type": 1,
|
||||||
|
"Ring": 0,
|
||||||
|
"Length": 7,
|
||||||
|
"Weight": 250,
|
||||||
|
"Strength": 40,
|
||||||
|
"MaxRange": 67,
|
||||||
|
"ConstructionType": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 30002,
|
||||||
|
"Model": "rods/syberia/bolo_10021/bolo_10021_LB400",
|
||||||
|
"Type": 0,
|
||||||
|
"Ring": 1100002,
|
||||||
|
"Length": 5,
|
||||||
|
"Weight": 120,
|
||||||
|
"Strength": 40,
|
||||||
|
"MaxRange": 30,
|
||||||
|
"ConstructionType": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 30003,
|
||||||
|
"Model": "rods/syberia/spin_10034/spin_10034_S60H",
|
||||||
|
"Type": 0,
|
||||||
|
"Ring": 1100001,
|
||||||
|
"Length": 5,
|
||||||
|
"Weight": 120,
|
||||||
|
"Strength": 40,
|
||||||
|
"MaxRange": 30,
|
||||||
|
"ConstructionType": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"FishConfig": [
|
||||||
|
{
|
||||||
|
"Id": 210001,
|
||||||
|
"Model": [
|
||||||
|
"Burbot_B"
|
||||||
|
],
|
||||||
|
"Type": 0,
|
||||||
|
"SpeciesName": 10,
|
||||||
|
"MinWeight": 1,
|
||||||
|
"MaxWeight": 34,
|
||||||
|
"Accept": 2100001
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 210002,
|
||||||
|
"Model": [
|
||||||
|
"CarpCommon_B"
|
||||||
|
],
|
||||||
|
"Type": 0,
|
||||||
|
"SpeciesName": 11,
|
||||||
|
"MinWeight": 1,
|
||||||
|
"MaxWeight": 34,
|
||||||
|
"Accept": 2100001
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 210003,
|
||||||
|
"Model": [
|
||||||
|
"CarpGrass_B"
|
||||||
|
],
|
||||||
|
"Type": 0,
|
||||||
|
"SpeciesName": 14,
|
||||||
|
"MinWeight": 1,
|
||||||
|
"MaxWeight": 34,
|
||||||
|
"Accept": 2100001
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 210004,
|
||||||
|
"Model": [
|
||||||
|
"CarpCrucian_B"
|
||||||
|
],
|
||||||
|
"Type": 0,
|
||||||
|
"SpeciesName": 16,
|
||||||
|
"MinWeight": 1,
|
||||||
|
"MaxWeight": 34,
|
||||||
|
"Accept": 2100001
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"BasicConfig": [
|
||||||
|
{
|
||||||
|
"Id": 1001,
|
||||||
|
"Name": "Weights/Weight2_5g",
|
||||||
|
"Val": [
|
||||||
|
"0"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"InitConfig": [
|
||||||
|
{
|
||||||
|
"Id": 1,
|
||||||
|
"ItemId": 30001,
|
||||||
|
"Amount": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 2,
|
||||||
|
"ItemId": 30002,
|
||||||
|
"Amount": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 3,
|
||||||
|
"ItemId": 30003,
|
||||||
|
"Amount": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 4,
|
||||||
|
"ItemId": 40001,
|
||||||
|
"Amount": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 5,
|
||||||
|
"ItemId": 50001,
|
||||||
|
"Amount": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 6,
|
||||||
|
"ItemId": 50002,
|
||||||
|
"Amount": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 7,
|
||||||
|
"ItemId": 50003,
|
||||||
|
"Amount": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 8,
|
||||||
|
"ItemId": 60001,
|
||||||
|
"Amount": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 9,
|
||||||
|
"ItemId": 70001,
|
||||||
|
"Amount": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 10,
|
||||||
|
"ItemId": 70002,
|
||||||
|
"Amount": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 11,
|
||||||
|
"ItemId": 80001,
|
||||||
|
"Amount": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 12,
|
||||||
|
"ItemId": 80002,
|
||||||
|
"Amount": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 13,
|
||||||
|
"ItemId": 80003,
|
||||||
|
"Amount": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 14,
|
||||||
|
"ItemId": 80004,
|
||||||
|
"Amount": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 15,
|
||||||
|
"ItemId": 90001,
|
||||||
|
"Amount": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 16,
|
||||||
|
"ItemId": 100001,
|
||||||
|
"Amount": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 17,
|
||||||
|
"ItemId": 10001,
|
||||||
|
"Amount": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 18,
|
||||||
|
"ItemId": 10002,
|
||||||
|
"Amount": 200
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"BobberConfig": [
|
||||||
|
{
|
||||||
|
"Id": 50001,
|
||||||
|
"Model": "bobbers/expressfishing/bob_25003/bob_25003",
|
||||||
|
"Type": 2,
|
||||||
|
"Weight": 1,
|
||||||
|
"Displacement": 40,
|
||||||
|
"NightLight": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 50002,
|
||||||
|
"Model": "bobbers/expressfishing/bob_25162_25163/bob_25162",
|
||||||
|
"Type": 0,
|
||||||
|
"Weight": 1,
|
||||||
|
"Displacement": 40,
|
||||||
|
"NightLight": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 50003,
|
||||||
|
"Model": "bobbers/expressfishing/bob_25166_25167/bob_25166",
|
||||||
|
"Type": 0,
|
||||||
|
"Weight": 1,
|
||||||
|
"Displacement": 40,
|
||||||
|
"NightLight": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 50004,
|
||||||
|
"Model": "bobbers/expressfishing/bob_25001/bob_25001",
|
||||||
|
"Type": 0,
|
||||||
|
"Weight": 1,
|
||||||
|
"Displacement": 40,
|
||||||
|
"NightLight": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"FeederConfig": [
|
||||||
|
{
|
||||||
|
"Id": 110001,
|
||||||
|
"Model": "Feeders/Feeder 1/FeedTrash 1",
|
||||||
|
"Type": 0,
|
||||||
|
"Capacity": 100,
|
||||||
|
"Weight": 5
|
||||||
|
}
|
||||||
|
],
|
||||||
"BaitConfig": [
|
"BaitConfig": [
|
||||||
{
|
{
|
||||||
"Id": 500001,
|
"Id": 70001,
|
||||||
"Model": "baits/worm_01/worm_01",
|
"Model": "baits/worm_01/worm_01",
|
||||||
"EfficacyBase": 15,
|
"EfficacyBase": 15,
|
||||||
"Length": 0,
|
"Length": 0,
|
||||||
@@ -20,7 +386,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Id": 500002,
|
"Id": 70002,
|
||||||
"Model": "baits/fly/fly",
|
"Model": "baits/fly/fly",
|
||||||
"EfficacyBase": 15,
|
"EfficacyBase": 15,
|
||||||
"Length": 0,
|
"Length": 0,
|
||||||
@@ -37,7 +403,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Id": 500003,
|
"Id": 70003,
|
||||||
"Model": "baits/black_leech/black_leech",
|
"Model": "baits/black_leech/black_leech",
|
||||||
"EfficacyBase": 15,
|
"EfficacyBase": 15,
|
||||||
"Length": 0,
|
"Length": 0,
|
||||||
@@ -50,7 +416,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Id": 500004,
|
"Id": 70004,
|
||||||
"Model": "baits/bread/bread",
|
"Model": "baits/bread/bread",
|
||||||
"EfficacyBase": 15,
|
"EfficacyBase": 15,
|
||||||
"Length": 0,
|
"Length": 0,
|
||||||
@@ -63,261 +429,5 @@
|
|||||||
"44|2"
|
"44|2"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
|
||||||
"ReelConfig": [
|
|
||||||
{
|
|
||||||
"Id": 200001,
|
|
||||||
"Model": "reels/syberia/spin_5002/spin_5002",
|
|
||||||
"Type": 0,
|
|
||||||
"GearRatio": [
|
|
||||||
"7"
|
|
||||||
],
|
|
||||||
"Size": 250,
|
|
||||||
"Strength": 40
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Id": 200002,
|
|
||||||
"Model": "reels/syberia/spin_5036/spin_5036",
|
|
||||||
"Type": 0,
|
|
||||||
"GearRatio": [
|
|
||||||
"5"
|
|
||||||
],
|
|
||||||
"Size": 120,
|
|
||||||
"Strength": 40
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"FishConfig": [
|
|
||||||
{
|
|
||||||
"Id": 2200001,
|
|
||||||
"Model": [
|
|
||||||
"Burbot_B"
|
|
||||||
],
|
|
||||||
"Type": 0,
|
|
||||||
"SpeciesName": 10,
|
|
||||||
"MinWeight": 1,
|
|
||||||
"MaxWeight": 34,
|
|
||||||
"Accept": 2100001
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Id": 2200002,
|
|
||||||
"Model": [
|
|
||||||
"CarpCommon_B"
|
|
||||||
],
|
|
||||||
"Type": 0,
|
|
||||||
"SpeciesName": 11,
|
|
||||||
"MinWeight": 1,
|
|
||||||
"MaxWeight": 34,
|
|
||||||
"Accept": 2100001
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Id": 2200003,
|
|
||||||
"Model": [
|
|
||||||
"CarpGrass_B"
|
|
||||||
],
|
|
||||||
"Type": 0,
|
|
||||||
"SpeciesName": 14,
|
|
||||||
"MinWeight": 1,
|
|
||||||
"MaxWeight": 34,
|
|
||||||
"Accept": 2100001
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Id": 2200004,
|
|
||||||
"Model": [
|
|
||||||
"CarpCrucian_B"
|
|
||||||
],
|
|
||||||
"Type": 0,
|
|
||||||
"SpeciesName": 16,
|
|
||||||
"MinWeight": 1,
|
|
||||||
"MaxWeight": 34,
|
|
||||||
"Accept": 2100001
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"RodConfig": [
|
|
||||||
{
|
|
||||||
"Id": 100001,
|
|
||||||
"Model": "rods/syberia/tele_10037/tele_10037_t13",
|
|
||||||
"Type": 1,
|
|
||||||
"Ring": 0,
|
|
||||||
"Length": 7,
|
|
||||||
"Weight": 250,
|
|
||||||
"Strength": 40,
|
|
||||||
"MaxRange": 67,
|
|
||||||
"ConstructionType": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Id": 100002,
|
|
||||||
"Model": "rods/syberia/bolo_10021/bolo_10021_LB400",
|
|
||||||
"Type": 0,
|
|
||||||
"Ring": 1100002,
|
|
||||||
"Length": 5,
|
|
||||||
"Weight": 120,
|
|
||||||
"Strength": 40,
|
|
||||||
"MaxRange": 30,
|
|
||||||
"ConstructionType": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Id": 100003,
|
|
||||||
"Model": "rods/syberia/spin_10034/spin_10034_S60H",
|
|
||||||
"Type": 0,
|
|
||||||
"Ring": 1100001,
|
|
||||||
"Length": 5,
|
|
||||||
"Weight": 120,
|
|
||||||
"Strength": 40,
|
|
||||||
"MaxRange": 30,
|
|
||||||
"ConstructionType": 0
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"HookConfig": [
|
|
||||||
{
|
|
||||||
"Id": 700001,
|
|
||||||
"Model": "hooks/alliance/c_hook_20789_20794/c_hook_20789",
|
|
||||||
"Type": 1,
|
|
||||||
"Zadzior": 1,
|
|
||||||
"Length": 0,
|
|
||||||
"Weight": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Id": 700002,
|
|
||||||
"Model": "hooks/berserk_hooks/triple_20569_20577/triple_20569",
|
|
||||||
"Type": 1,
|
|
||||||
"Zadzior": 1,
|
|
||||||
"Length": 0,
|
|
||||||
"Weight": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"LureConfig": [
|
|
||||||
{
|
|
||||||
"Id": 600001,
|
|
||||||
"Model": "lures/express_fishing/crankbaits_1/775/crankbaits_775",
|
|
||||||
"Hook": [
|
|
||||||
700102
|
|
||||||
],
|
|
||||||
"EfficacyBase": 50,
|
|
||||||
"Length": 0,
|
|
||||||
"Weight": 250
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Id": 600002,
|
|
||||||
"Model": "lures/express_fishing/poppers_1/poppers_590/poppers_590",
|
|
||||||
"Hook": [
|
|
||||||
700102
|
|
||||||
],
|
|
||||||
"EfficacyBase": 50,
|
|
||||||
"Length": 0,
|
|
||||||
"Weight": 120
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Id": 600003,
|
|
||||||
"Model": "lures/express_fishing/softplastic/ef_supergrab_6/softplastic_g_1622",
|
|
||||||
"Hook": [
|
|
||||||
0
|
|
||||||
],
|
|
||||||
"EfficacyBase": 50,
|
|
||||||
"Length": 0,
|
|
||||||
"Weight": 120
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Id": 600004,
|
|
||||||
"Model": "lures/express_fishing/softplastic/ef_superminnow_6/softplastic_m_1634",
|
|
||||||
"Hook": [
|
|
||||||
0
|
|
||||||
],
|
|
||||||
"EfficacyBase": 50,
|
|
||||||
"Length": 0,
|
|
||||||
"Weight": 120
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"Unit2Config": [
|
|
||||||
{
|
|
||||||
"Id": 1,
|
|
||||||
"Name": "Unit01",
|
|
||||||
"Model": "Unit01"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"RingConfig": [
|
|
||||||
{
|
|
||||||
"Id": 1100001,
|
|
||||||
"Model": "rod_rings/rumoi/rumoi_oxiline_spin"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Id": 1100002,
|
|
||||||
"Model": "rod_rings/smt/smt_pure_ceramic_bolo"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"FeederConfig": [
|
|
||||||
{
|
|
||||||
"Id": 900001,
|
|
||||||
"Model": "Feeders/Feeder 1/FeedTrash 1",
|
|
||||||
"Type": 0,
|
|
||||||
"Capacity": 100,
|
|
||||||
"Weight": 5
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"BobberConfig": [
|
|
||||||
{
|
|
||||||
"Id": 300001,
|
|
||||||
"Model": "bobbers/expressfishing/bob_25003/bob_25003",
|
|
||||||
"Type": 2,
|
|
||||||
"Weight": 1,
|
|
||||||
"Displacement": 40,
|
|
||||||
"NightLight": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Id": 300002,
|
|
||||||
"Model": "bobbers/expressfishing/bob_25162_25163/bob_25162",
|
|
||||||
"Type": 0,
|
|
||||||
"Weight": 1,
|
|
||||||
"Displacement": 40,
|
|
||||||
"NightLight": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Id": 300003,
|
|
||||||
"Model": "bobbers/expressfishing/bob_25166_25167/bob_25166",
|
|
||||||
"Type": 0,
|
|
||||||
"Weight": 1,
|
|
||||||
"Displacement": 40,
|
|
||||||
"NightLight": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Id": 300004,
|
|
||||||
"Model": "bobbers/expressfishing/bob_25001/bob_25001",
|
|
||||||
"Type": 0,
|
|
||||||
"Weight": 1,
|
|
||||||
"Displacement": 40,
|
|
||||||
"NightLight": 0
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"LineConfig": [
|
|
||||||
{
|
|
||||||
"Id": 400001,
|
|
||||||
"Model": "Lines/UFE Mono/UFE monoClear",
|
|
||||||
"Type": 0,
|
|
||||||
"Length": 7,
|
|
||||||
"Strength": 40,
|
|
||||||
"Size": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Id": 400002,
|
|
||||||
"Model": "rods/syberia/bolo_10021/bolo_10021_LB400",
|
|
||||||
"Type": 0,
|
|
||||||
"Length": 5,
|
|
||||||
"Strength": 40,
|
|
||||||
"Size": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"WeightConfig": [
|
|
||||||
{
|
|
||||||
"Id": 800001,
|
|
||||||
"Model": "Weights/Weight2_5g",
|
|
||||||
"Type": 0,
|
|
||||||
"Weight": 3
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"UnitConfig": [
|
|
||||||
{
|
|
||||||
"Id": 1,
|
|
||||||
"Name": "Unit01",
|
|
||||||
"Model": "Unit01"
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
8
Assets/Scripts/Configs~/Cache.meta
Normal file
8
Assets/Scripts/Configs~/Cache.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d89005a134404b88b748787a74946d20
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
90
Assets/Scripts/Configs~/Cache/ConfigContext.cs
Normal file
90
Assets/Scripts/Configs~/Cache/ConfigContext.cs
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
public interface IConfigContext
|
||||||
|
{
|
||||||
|
// 定义非泛型接口
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ConfigContext<T> : IConfigContext where T : ConfigBase
|
||||||
|
{
|
||||||
|
private static List<T> _cacheList = new List<T>();
|
||||||
|
|
||||||
|
#region Cache
|
||||||
|
|
||||||
|
public void Association(List<T> list)
|
||||||
|
{
|
||||||
|
if (list != null)
|
||||||
|
{
|
||||||
|
_cacheList = list;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public int Count()
|
||||||
|
{
|
||||||
|
return _cacheList.Count;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int Count(Func<T, bool> predicate)
|
||||||
|
{
|
||||||
|
return _cacheList.Count(predicate);
|
||||||
|
}
|
||||||
|
|
||||||
|
public T Get(int key)
|
||||||
|
{
|
||||||
|
return First(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public T Fist()
|
||||||
|
{
|
||||||
|
return _cacheList.First();
|
||||||
|
}
|
||||||
|
|
||||||
|
public T Last()
|
||||||
|
{
|
||||||
|
return _cacheList.Last();
|
||||||
|
}
|
||||||
|
|
||||||
|
public T Fist(Predicate<T> match)
|
||||||
|
{
|
||||||
|
return Get(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public T Last(Predicate<T> match)
|
||||||
|
{
|
||||||
|
return _cacheList.FindLast(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public T Get(Predicate<T> match)
|
||||||
|
{
|
||||||
|
return _cacheList.Find(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public T GetRandom()
|
||||||
|
{
|
||||||
|
Random random = new Random();
|
||||||
|
// 随机从列表中取一个对象
|
||||||
|
return _cacheList[random.Next(_cacheList.Count)];
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<T> GetList()
|
||||||
|
{
|
||||||
|
return _cacheList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<T> GetList(Predicate<T> match)
|
||||||
|
{
|
||||||
|
return _cacheList.FindAll(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
private T First(int key)
|
||||||
|
{
|
||||||
|
return _cacheList.Find(t => t.id == key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/Configs~/Cache/ConfigContext.cs.meta
Normal file
2
Assets/Scripts/Configs~/Cache/ConfigContext.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 82dbb868b2724a85aa866e0bf9e88e91
|
||||||
27
Assets/Scripts/Configs~/Cache/Configs.cs
Normal file
27
Assets/Scripts/Configs~/Cache/Configs.cs
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
public static class Configs
|
||||||
|
{
|
||||||
|
private static readonly Dictionary<Type, IConfigContext> _dictionary = new Dictionary<Type, IConfigContext>();
|
||||||
|
|
||||||
|
static Configs()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ConfigContext<T> Table<T>() where T : ConfigBase
|
||||||
|
{
|
||||||
|
var type = typeof(T);
|
||||||
|
if (_dictionary.TryGetValue(type, out var context))
|
||||||
|
{
|
||||||
|
return context as ConfigContext<T>;
|
||||||
|
}
|
||||||
|
|
||||||
|
var jsonContext = new ConfigContext<T>();
|
||||||
|
_dictionary[type] = jsonContext;
|
||||||
|
return jsonContext;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/Configs~/Cache/Configs.cs.meta
Normal file
2
Assets/Scripts/Configs~/Cache/Configs.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1881c9eee25240ddbaecbf99546a8750
|
||||||
17
Assets/Scripts/Configs~/Cache/TableNameAttribute.cs
Normal file
17
Assets/Scripts/Configs~/Cache/TableNameAttribute.cs
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
[AttributeUsage(AttributeTargets.Class)]
|
||||||
|
public class TableNameAttribute : Attribute
|
||||||
|
{
|
||||||
|
public string Name;
|
||||||
|
public string Key;
|
||||||
|
|
||||||
|
public TableNameAttribute(string name, string key = "id")
|
||||||
|
{
|
||||||
|
Name = name;
|
||||||
|
Key = key;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Configs~/Cache/TableNameAttribute.cs.meta
Normal file
3
Assets/Scripts/Configs~/Cache/TableNameAttribute.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 737030131eba4fd6ba6067b47fcae5d3
|
||||||
|
timeCreated: 1744862554
|
||||||
68
Assets/Scripts/Configs~/ConfigAssets.Parse.cs
Normal file
68
Assets/Scripts/Configs~/ConfigAssets.Parse.cs
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using NBC;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
public partial class ConfigAssets
|
||||||
|
{
|
||||||
|
private static readonly Type CustomType = typeof(ICustomParse);
|
||||||
|
|
||||||
|
private static List<T> ParseLine<T>(JToken[] arr, TableNameAttribute tableNameAttribute) where T : ConfigBase
|
||||||
|
{
|
||||||
|
List<T> list = new List<T>();
|
||||||
|
var type = typeof(T);
|
||||||
|
foreach (var jToken in arr)
|
||||||
|
{
|
||||||
|
T instance = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (CustomType.IsAssignableFrom(type)) //自定义解析
|
||||||
|
{
|
||||||
|
instance = Activator.CreateInstance<T>();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
instance = jToken.ToObject<T>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Log.Error(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (instance != null)
|
||||||
|
{
|
||||||
|
var key = jToken[tableNameAttribute.Key].ToInt();
|
||||||
|
if (key < 1)
|
||||||
|
{
|
||||||
|
if (instance.id > 0)
|
||||||
|
{
|
||||||
|
key = instance.id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (key < 1) continue;
|
||||||
|
if (instance is ICustomParse customParse)
|
||||||
|
{
|
||||||
|
customParse.Parse(jToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
instance.id = key;
|
||||||
|
list.Add(instance);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Log.Error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Configs~/ConfigAssets.Parse.cs.meta
Normal file
3
Assets/Scripts/Configs~/ConfigAssets.Parse.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 09494bd809bd47b29be0723c8671afb8
|
||||||
|
timeCreated: 1744898106
|
||||||
30
Assets/Scripts/Configs~/ConfigAssets.cs
Normal file
30
Assets/Scripts/Configs~/ConfigAssets.cs
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
public partial class ConfigAssets : ScriptableObject
|
||||||
|
{
|
||||||
|
// public static string SavePath => $"Assets/ResRaw/Config/ConfigAssets.asset";
|
||||||
|
public static string SavePath => $"Assets/Resources/Config/ConfigAssets.asset";
|
||||||
|
private static ConfigAssets _inst;
|
||||||
|
|
||||||
|
public static ConfigAssets Instance => _inst;
|
||||||
|
|
||||||
|
public static void Init()
|
||||||
|
{
|
||||||
|
var asset = Resources.Load<ConfigAssets>("config/ConfigAssets");
|
||||||
|
if (asset != null)
|
||||||
|
{
|
||||||
|
asset.AssociationContexts();
|
||||||
|
_inst = asset;
|
||||||
|
}
|
||||||
|
|
||||||
|
// var assetProvider = NBC.Asset.Assets.LoadAsset<ConfigAssets>(SavePath);
|
||||||
|
// if (assetProvider != null && assetProvider.Asset is ConfigAssets asset)
|
||||||
|
// {
|
||||||
|
// asset.AssociationContexts();
|
||||||
|
// _inst = asset;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Configs~/ConfigAssets.cs.meta
Normal file
3
Assets/Scripts/Configs~/ConfigAssets.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3d8691ef03f74aedb6cfd67e53cf664f
|
||||||
|
timeCreated: 1742999693
|
||||||
3
Assets/Scripts/Configs~/Editor.meta
Normal file
3
Assets/Scripts/Configs~/Editor.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2178333fb882410eb05c0f66a95c8880
|
||||||
|
timeCreated: 1742998269
|
||||||
197
Assets/Scripts/Configs~/Editor/CfgEditorUtil.cs
Normal file
197
Assets/Scripts/Configs~/Editor/CfgEditorUtil.cs
Normal file
@@ -0,0 +1,197 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
public static class CfgEditorUtil
|
||||||
|
{
|
||||||
|
[MenuItem("构建/配置表/生成脚本")]
|
||||||
|
public static void CreateScriptableObject()
|
||||||
|
{
|
||||||
|
EditorUtils.GetOrCreateAsset<ConfigAssets>(ConfigAssets.SavePath);
|
||||||
|
GenConfigScripts();
|
||||||
|
AssetDatabase.Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
[MenuItem("构建/配置表/导表")]
|
||||||
|
public static void BuildExcel()
|
||||||
|
{
|
||||||
|
ExcelToJsonWindow.GenConfig(false);
|
||||||
|
AssetDatabase.Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
[MenuItem("构建/配置表/导多语言")]
|
||||||
|
public static void BuildLanguage()
|
||||||
|
{
|
||||||
|
ExcelToJsonWindow.GenLanguage();
|
||||||
|
AssetDatabase.Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
#region 生成脚本
|
||||||
|
|
||||||
|
private static string GenPath = "Scripts/Configs/Gen";
|
||||||
|
private static string TempPath = "Scripts/Configs/Editor/ConfigWarpTemplate";
|
||||||
|
|
||||||
|
public static void GenConfigScripts()
|
||||||
|
{
|
||||||
|
if (!Directory.Exists($"{Application.dataPath}/{GenPath}"))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var types = Reflection.GetAllNonAbstractDerivedTypes<ConfigBase>();
|
||||||
|
Dictionary<Type, string> tableNameAttributes = new Dictionary<Type, string>();
|
||||||
|
foreach (var type in types)
|
||||||
|
{
|
||||||
|
tableNameAttributes[type] = type.Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
// var canGen = CanGen(tableNameAttributes);
|
||||||
|
//
|
||||||
|
// if (!canGen) return;
|
||||||
|
GenParse(tableNameAttributes);
|
||||||
|
GenWarp(tableNameAttributes);
|
||||||
|
// GenBinder(tableNameAttributes);
|
||||||
|
AssetDatabase.Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool CanGen(Dictionary<Type, string> tableNameAttributes)
|
||||||
|
{
|
||||||
|
// return true;
|
||||||
|
string filePath = Path.Combine(Application.dataPath, $"{GenPath}/Warps");
|
||||||
|
if (!Directory.Exists(filePath)) return true;
|
||||||
|
var files = Directory.GetFiles(filePath);
|
||||||
|
List<string> allFileName = new List<string>();
|
||||||
|
foreach (var file in files)
|
||||||
|
{
|
||||||
|
if (Path.GetExtension(file).ToLower() == ".meta") continue;
|
||||||
|
var fileName = Path.GetFileNameWithoutExtension(file);
|
||||||
|
allFileName.Add(fileName.Replace("Warp", ""));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (allFileName.Count != tableNameAttributes.Count) return true;
|
||||||
|
|
||||||
|
foreach (var type in tableNameAttributes.Keys)
|
||||||
|
{
|
||||||
|
if (!allFileName.Contains(type.Name)) return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static void GenWarp(Dictionary<Type, string> tableNameAttributes)
|
||||||
|
{
|
||||||
|
// 为何使用生成式,不使用static静态泛型 ? 生成式扩展更强且不会破坏原类的集成结构,父类也不用是泛型类
|
||||||
|
//否则比如 BaseConfig<T> 类型来使用。集成结构会受很大限制,反而没有生成式来的灵活
|
||||||
|
|
||||||
|
string filePath = Path.Combine(Application.dataPath, TempPath);
|
||||||
|
if (File.Exists(filePath))
|
||||||
|
{
|
||||||
|
// 读取文本内容
|
||||||
|
string fileContent = File.ReadAllText(filePath);
|
||||||
|
var rootPath = $"{Application.dataPath}/{GenPath}/Warps";
|
||||||
|
if (!Directory.Exists(rootPath))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Directory.Exists(rootPath))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(rootPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var type in tableNameAttributes.Keys)
|
||||||
|
{
|
||||||
|
var content = fileContent.Replace("##NAME##", type.Name);
|
||||||
|
File.WriteAllText($"{rootPath}/{type.Name}Warp.cs", content);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogError("生成代码模板不存在,请检查");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void GenParse(Dictionary<Type, string> tableNameAttributes)
|
||||||
|
{
|
||||||
|
if (!Directory.Exists($"{Application.dataPath}/{GenPath}"))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CodeWriter codeWriter = new CodeWriter();
|
||||||
|
codeWriter.Writeln("/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/");
|
||||||
|
codeWriter.Writeln();
|
||||||
|
codeWriter.Writeln("using System;");
|
||||||
|
codeWriter.Writeln("using System.Collections.Generic;");
|
||||||
|
codeWriter.Writeln("using System.Reflection;");
|
||||||
|
codeWriter.Writeln("using Newtonsoft.Json.Linq;");
|
||||||
|
codeWriter.Writeln("using UnityEngine;");
|
||||||
|
|
||||||
|
codeWriter.Writeln();
|
||||||
|
codeWriter.Writeln("namespace NBF");
|
||||||
|
|
||||||
|
codeWriter.StartBlock();
|
||||||
|
|
||||||
|
codeWriter.Writeln("public partial class ConfigAssets");
|
||||||
|
codeWriter.StartBlock();
|
||||||
|
|
||||||
|
foreach (var type in tableNameAttributes.Keys)
|
||||||
|
{
|
||||||
|
// codeWriter.Writeln($"[HideInInspector] public List<{type.Name}> {type.Name}Arr;");
|
||||||
|
codeWriter.Writeln($"public List<{type.Name}> {type.Name}Arr;");
|
||||||
|
}
|
||||||
|
|
||||||
|
codeWriter.Writeln();
|
||||||
|
|
||||||
|
codeWriter.Writeln("public void Parse(JToken[] arr, Type type)");
|
||||||
|
codeWriter.StartBlock();
|
||||||
|
codeWriter.Writeln("var tableNameAttribute = type.GetCustomAttribute<TableNameAttribute>();");
|
||||||
|
codeWriter.Writeln("if (tableNameAttribute == null) return;");
|
||||||
|
|
||||||
|
foreach (var type in tableNameAttributes.Keys)
|
||||||
|
{
|
||||||
|
codeWriter.Writeln($"if (type == typeof({type.Name}))");
|
||||||
|
codeWriter.StartBlock();
|
||||||
|
codeWriter.Writeln($"{type.Name}Arr = ParseLine<{type.Name}>(arr, tableNameAttribute);");
|
||||||
|
codeWriter.EndBlock();
|
||||||
|
codeWriter.Writeln();
|
||||||
|
}
|
||||||
|
|
||||||
|
codeWriter.EndBlock();
|
||||||
|
|
||||||
|
codeWriter.Writeln();
|
||||||
|
codeWriter.Writeln("public void AssociationContexts()");
|
||||||
|
codeWriter.StartBlock();
|
||||||
|
|
||||||
|
foreach (var type in tableNameAttributes.Keys)
|
||||||
|
{
|
||||||
|
codeWriter.Writeln($"new ConfigContext<{type.Name}>().Association({type.Name}Arr);");
|
||||||
|
}
|
||||||
|
|
||||||
|
codeWriter.EndBlock();
|
||||||
|
|
||||||
|
|
||||||
|
codeWriter.EndBlock();
|
||||||
|
codeWriter.EndBlock();
|
||||||
|
|
||||||
|
codeWriter.Save($"{Application.dataPath}/{GenPath}/ConfigAssets.Gen.cs");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static void WriterCreateParse(CodeWriter codeWriter, Type type)
|
||||||
|
{
|
||||||
|
codeWriter.Writeln($"if (type == typeof({type.Name}))");
|
||||||
|
codeWriter.StartBlock();
|
||||||
|
codeWriter.Writeln($"return CreateParseTableTask<{type.Name}>();");
|
||||||
|
codeWriter.EndBlock();
|
||||||
|
codeWriter.Writeln();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Configs~/Editor/CfgEditorUtil.cs.meta
Normal file
3
Assets/Scripts/Configs~/Editor/CfgEditorUtil.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 5bc0ac74b225496da64195b28ce14cb2
|
||||||
|
timeCreated: 1742998279
|
||||||
105
Assets/Scripts/Configs~/Editor/CodeWriter.cs
Normal file
105
Assets/Scripts/Configs~/Editor/CodeWriter.cs
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
public interface ICodeWriterConfig
|
||||||
|
{
|
||||||
|
string BlockStart { get; set; }
|
||||||
|
string BlockEnd { get; set; }
|
||||||
|
bool BlockFromNewLine { get; set; }
|
||||||
|
bool UsingTabs { get; set; }
|
||||||
|
string EndOfLine { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DefCSharpCodeWriterConfig : ICodeWriterConfig
|
||||||
|
{
|
||||||
|
public string BlockStart { get; set; } = "{";
|
||||||
|
public string BlockEnd { get; set; } = "}";
|
||||||
|
public bool BlockFromNewLine { get; set; }
|
||||||
|
public bool UsingTabs { get; set; } = true;
|
||||||
|
public string EndOfLine { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CodeWriter
|
||||||
|
{
|
||||||
|
private ICodeWriterConfig _config;
|
||||||
|
|
||||||
|
private StringBuilder _stringBuilder = new StringBuilder();
|
||||||
|
|
||||||
|
private int _nowTabCount;
|
||||||
|
|
||||||
|
public CodeWriter()
|
||||||
|
{
|
||||||
|
Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
public CodeWriter(ICodeWriterConfig config)
|
||||||
|
{
|
||||||
|
Init(config);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Write(string content)
|
||||||
|
{
|
||||||
|
_stringBuilder.Append(content);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Writeln()
|
||||||
|
{
|
||||||
|
_stringBuilder.Append(Environment.NewLine);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Writeln(string str)
|
||||||
|
{
|
||||||
|
_stringBuilder.Append(GetLinePrefix());
|
||||||
|
_stringBuilder.Append(str);
|
||||||
|
_stringBuilder.Append(Environment.NewLine);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void StartBlock()
|
||||||
|
{
|
||||||
|
Writeln(_config.BlockStart);
|
||||||
|
_nowTabCount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void EndBlock()
|
||||||
|
{
|
||||||
|
_nowTabCount--;
|
||||||
|
Writeln(_config.BlockEnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Save(string path)
|
||||||
|
{
|
||||||
|
var dirPath = Path.GetDirectoryName(path);
|
||||||
|
if (dirPath != null && !Directory.Exists(dirPath))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(dirPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
var content = _stringBuilder.ToString();
|
||||||
|
File.WriteAllText(path, content);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region 内部方法
|
||||||
|
|
||||||
|
private void Init(ICodeWriterConfig config = null)
|
||||||
|
{
|
||||||
|
_config = config ?? new DefCSharpCodeWriterConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
private string GetLinePrefix()
|
||||||
|
{
|
||||||
|
string ret = string.Empty;
|
||||||
|
if (!_config.UsingTabs) return ret;
|
||||||
|
for (var i = 0; i < _nowTabCount; i++)
|
||||||
|
{
|
||||||
|
ret += "\t";
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/Configs~/Editor/CodeWriter.cs.meta
Normal file
2
Assets/Scripts/Configs~/Editor/CodeWriter.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: cf1ac73cd67e4bdc9de1a53a13f5b841
|
||||||
65
Assets/Scripts/Configs~/Editor/ConfigWarpTemplate
Normal file
65
Assets/Scripts/Configs~/Editor/ConfigWarpTemplate
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
public partial class ##NAME##
|
||||||
|
{
|
||||||
|
private static ConfigContext<##NAME##> _context;
|
||||||
|
|
||||||
|
private static ConfigContext<##NAME##> Context => _context ??= Configs.Table<##NAME##>();
|
||||||
|
|
||||||
|
public static ##NAME## Get(int key)
|
||||||
|
{
|
||||||
|
return Context.Get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ##NAME## Get(Predicate<##NAME##> match)
|
||||||
|
{
|
||||||
|
return Context.Get(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ##NAME## Fist()
|
||||||
|
{
|
||||||
|
return Context.Fist();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ##NAME## Last()
|
||||||
|
{
|
||||||
|
return Context.Last();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ##NAME## Fist(Predicate<##NAME##> match)
|
||||||
|
{
|
||||||
|
return Context.Fist(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ##NAME## Last(Predicate<##NAME##> match)
|
||||||
|
{
|
||||||
|
return Context.Last(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count()
|
||||||
|
{
|
||||||
|
return Context.Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count(Func<##NAME##, bool> predicate)
|
||||||
|
{
|
||||||
|
return Context.Count(predicate);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static List<##NAME##> GetList()
|
||||||
|
{
|
||||||
|
return Context.GetList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<##NAME##> GetList(Predicate<##NAME##> match)
|
||||||
|
{
|
||||||
|
return Context.GetList(match);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
7
Assets/Scripts/Configs~/Editor/ConfigWarpTemplate.meta
Normal file
7
Assets/Scripts/Configs~/Editor/ConfigWarpTemplate.meta
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4b77eee728204f26bc602016c4a20c86
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
3
Assets/Scripts/Configs~/Extemds.meta
Normal file
3
Assets/Scripts/Configs~/Extemds.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b8a50bb33d07439e9c7762e17bced2e0
|
||||||
|
timeCreated: 1744862665
|
||||||
138
Assets/Scripts/Configs~/Extemds/JTokenExtends.cs
Normal file
138
Assets/Scripts/Configs~/Extemds/JTokenExtends.cs
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
public static class JTokenExtends
|
||||||
|
{
|
||||||
|
public static Vector2 ToVector2(this string str, string sp = ",")
|
||||||
|
{
|
||||||
|
Vector2 vector2 = Vector2.zero;
|
||||||
|
var arr = str.Split(sp);
|
||||||
|
if (arr.Length > 0)
|
||||||
|
{
|
||||||
|
float.TryParse(arr[0], out vector2.x);
|
||||||
|
if (arr.Length > 1)
|
||||||
|
{
|
||||||
|
float.TryParse(arr[1], out vector2.y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return vector2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Vector3 ToVector3(this string str, string sp = ",")
|
||||||
|
{
|
||||||
|
Vector3 vector2 = Vector3.zero;
|
||||||
|
var arr = str.Split(sp);
|
||||||
|
if (arr.Length > 0)
|
||||||
|
{
|
||||||
|
float.TryParse(arr[0], out vector2.x);
|
||||||
|
if (arr.Length > 1)
|
||||||
|
{
|
||||||
|
float.TryParse(arr[1], out vector2.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (arr.Length > 2)
|
||||||
|
{
|
||||||
|
float.TryParse(arr[2], out vector2.z);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return vector2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static T[] ToArr<T>(this JToken token, string split = ",") where T : IConvertible
|
||||||
|
{
|
||||||
|
if (token is JArray array)
|
||||||
|
{
|
||||||
|
return array.ToObject<T[]>();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (token != null)
|
||||||
|
{
|
||||||
|
var str = token.ToString();
|
||||||
|
if (string.IsNullOrWhiteSpace(str)) return Array.Empty<T>();
|
||||||
|
|
||||||
|
var arr = str.Split(split);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return arr.Select(a => (T)Convert.ChangeType(a, typeof(T))).ToArray();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Console.WriteLine(e);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Array.Empty<T>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int ToInt(this JToken token)
|
||||||
|
{
|
||||||
|
if (token == null)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return (int)token;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static float ToFloat(this JToken token)
|
||||||
|
{
|
||||||
|
if (token == null)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return (float)token;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string ToStr(this JToken token)
|
||||||
|
{
|
||||||
|
if (token != null)
|
||||||
|
{
|
||||||
|
return token.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<T> ToList<T>(this JToken token, string split = ",") where T : IConvertible
|
||||||
|
{
|
||||||
|
if (token is JArray array)
|
||||||
|
{
|
||||||
|
return array.ToObject<List<T>>();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (token != null)
|
||||||
|
{
|
||||||
|
var str = token.ToString();
|
||||||
|
if (string.IsNullOrWhiteSpace(str)) return new List<T>();
|
||||||
|
var arr = str.Split(split);
|
||||||
|
return arr.Select(
|
||||||
|
a => string.IsNullOrWhiteSpace(a) ? default : (T)Convert.ChangeType(a, typeof(T))).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
return new List<T>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Configs~/Extemds/JTokenExtends.cs.meta
Normal file
3
Assets/Scripts/Configs~/Extemds/JTokenExtends.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3d6ce3cc850f41b8ba83653660b928ce
|
||||||
|
timeCreated: 1744862670
|
||||||
3
Assets/Scripts/Configs~/Gen.meta
Normal file
3
Assets/Scripts/Configs~/Gen.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0eceaba126fb407583191d01e32bb735
|
||||||
|
timeCreated: 1756050728
|
||||||
122
Assets/Scripts/Configs~/Gen/ConfigAssets.Gen.cs
Normal file
122
Assets/Scripts/Configs~/Gen/ConfigAssets.Gen.cs
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Reflection;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
public partial class ConfigAssets
|
||||||
|
{
|
||||||
|
public List<BaitConfig> BaitConfigArr;
|
||||||
|
public List<BobberConfig> BobberConfigArr;
|
||||||
|
public List<FeederConfig> FeederConfigArr;
|
||||||
|
public List<FishAcceptConfig> FishAcceptConfigArr;
|
||||||
|
public List<FishConfig> FishConfigArr;
|
||||||
|
public List<HookConfig> HookConfigArr;
|
||||||
|
public List<LeadersConfig> LeadersConfigArr;
|
||||||
|
public List<LineConfig> LineConfigArr;
|
||||||
|
public List<LureConfig> LureConfigArr;
|
||||||
|
public List<ReelConfig> ReelConfigArr;
|
||||||
|
public List<RingConfig> RingConfigArr;
|
||||||
|
public List<RodConfig> RodConfigArr;
|
||||||
|
public List<UnitConfig> UnitConfigArr;
|
||||||
|
public List<WeightConfig> WeightConfigArr;
|
||||||
|
|
||||||
|
public void Parse(JToken[] arr, Type type)
|
||||||
|
{
|
||||||
|
var tableNameAttribute = type.GetCustomAttribute<TableNameAttribute>();
|
||||||
|
if (tableNameAttribute == null) return;
|
||||||
|
if (type == typeof(BaitConfig))
|
||||||
|
{
|
||||||
|
BaitConfigArr = ParseLine<BaitConfig>(arr, tableNameAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == typeof(BobberConfig))
|
||||||
|
{
|
||||||
|
BobberConfigArr = ParseLine<BobberConfig>(arr, tableNameAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == typeof(FeederConfig))
|
||||||
|
{
|
||||||
|
FeederConfigArr = ParseLine<FeederConfig>(arr, tableNameAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == typeof(FishAcceptConfig))
|
||||||
|
{
|
||||||
|
FishAcceptConfigArr = ParseLine<FishAcceptConfig>(arr, tableNameAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == typeof(FishConfig))
|
||||||
|
{
|
||||||
|
FishConfigArr = ParseLine<FishConfig>(arr, tableNameAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == typeof(HookConfig))
|
||||||
|
{
|
||||||
|
HookConfigArr = ParseLine<HookConfig>(arr, tableNameAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == typeof(LeadersConfig))
|
||||||
|
{
|
||||||
|
LeadersConfigArr = ParseLine<LeadersConfig>(arr, tableNameAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == typeof(LineConfig))
|
||||||
|
{
|
||||||
|
LineConfigArr = ParseLine<LineConfig>(arr, tableNameAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == typeof(LureConfig))
|
||||||
|
{
|
||||||
|
LureConfigArr = ParseLine<LureConfig>(arr, tableNameAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == typeof(ReelConfig))
|
||||||
|
{
|
||||||
|
ReelConfigArr = ParseLine<ReelConfig>(arr, tableNameAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == typeof(RingConfig))
|
||||||
|
{
|
||||||
|
RingConfigArr = ParseLine<RingConfig>(arr, tableNameAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == typeof(RodConfig))
|
||||||
|
{
|
||||||
|
RodConfigArr = ParseLine<RodConfig>(arr, tableNameAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == typeof(UnitConfig))
|
||||||
|
{
|
||||||
|
UnitConfigArr = ParseLine<UnitConfig>(arr, tableNameAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == typeof(WeightConfig))
|
||||||
|
{
|
||||||
|
WeightConfigArr = ParseLine<WeightConfig>(arr, tableNameAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AssociationContexts()
|
||||||
|
{
|
||||||
|
new ConfigContext<BaitConfig>().Association(BaitConfigArr);
|
||||||
|
new ConfigContext<BobberConfig>().Association(BobberConfigArr);
|
||||||
|
new ConfigContext<FeederConfig>().Association(FeederConfigArr);
|
||||||
|
new ConfigContext<FishAcceptConfig>().Association(FishAcceptConfigArr);
|
||||||
|
new ConfigContext<FishConfig>().Association(FishConfigArr);
|
||||||
|
new ConfigContext<HookConfig>().Association(HookConfigArr);
|
||||||
|
new ConfigContext<LeadersConfig>().Association(LeadersConfigArr);
|
||||||
|
new ConfigContext<LineConfig>().Association(LineConfigArr);
|
||||||
|
new ConfigContext<LureConfig>().Association(LureConfigArr);
|
||||||
|
new ConfigContext<ReelConfig>().Association(ReelConfigArr);
|
||||||
|
new ConfigContext<RingConfig>().Association(RingConfigArr);
|
||||||
|
new ConfigContext<RodConfig>().Association(RodConfigArr);
|
||||||
|
new ConfigContext<UnitConfig>().Association(UnitConfigArr);
|
||||||
|
new ConfigContext<WeightConfig>().Association(WeightConfigArr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/Configs~/Gen/ConfigAssets.Gen.cs.meta
Normal file
2
Assets/Scripts/Configs~/Gen/ConfigAssets.Gen.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: bd9bbc8f86e64a928533f493e39813ed
|
||||||
3
Assets/Scripts/Configs~/Gen/Warps.meta
Normal file
3
Assets/Scripts/Configs~/Gen/Warps.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 98e70a75b52b4728aec1e5b7f506695c
|
||||||
|
timeCreated: 1756050753
|
||||||
65
Assets/Scripts/Configs~/Gen/Warps/BaitConfigWarp.cs
Normal file
65
Assets/Scripts/Configs~/Gen/Warps/BaitConfigWarp.cs
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
public partial class BaitConfig
|
||||||
|
{
|
||||||
|
private static ConfigContext<BaitConfig> _context;
|
||||||
|
|
||||||
|
private static ConfigContext<BaitConfig> Context => _context ??= Configs.Table<BaitConfig>();
|
||||||
|
|
||||||
|
public static BaitConfig Get(int key)
|
||||||
|
{
|
||||||
|
return Context.Get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BaitConfig Get(Predicate<BaitConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Get(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BaitConfig Fist()
|
||||||
|
{
|
||||||
|
return Context.Fist();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BaitConfig Last()
|
||||||
|
{
|
||||||
|
return Context.Last();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BaitConfig Fist(Predicate<BaitConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Fist(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BaitConfig Last(Predicate<BaitConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Last(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count()
|
||||||
|
{
|
||||||
|
return Context.Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count(Func<BaitConfig, bool> predicate)
|
||||||
|
{
|
||||||
|
return Context.Count(predicate);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static List<BaitConfig> GetList()
|
||||||
|
{
|
||||||
|
return Context.GetList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<BaitConfig> GetList(Predicate<BaitConfig> match)
|
||||||
|
{
|
||||||
|
return Context.GetList(match);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/Configs~/Gen/Warps/BaitConfigWarp.cs.meta
Normal file
2
Assets/Scripts/Configs~/Gen/Warps/BaitConfigWarp.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 5c6bdb0bae4da2a4da6aacaf58a1abc0
|
||||||
65
Assets/Scripts/Configs~/Gen/Warps/BobberConfigWarp.cs
Normal file
65
Assets/Scripts/Configs~/Gen/Warps/BobberConfigWarp.cs
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
public partial class BobberConfig
|
||||||
|
{
|
||||||
|
private static ConfigContext<BobberConfig> _context;
|
||||||
|
|
||||||
|
private static ConfigContext<BobberConfig> Context => _context ??= Configs.Table<BobberConfig>();
|
||||||
|
|
||||||
|
public static BobberConfig Get(int key)
|
||||||
|
{
|
||||||
|
return Context.Get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BobberConfig Get(Predicate<BobberConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Get(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BobberConfig Fist()
|
||||||
|
{
|
||||||
|
return Context.Fist();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BobberConfig Last()
|
||||||
|
{
|
||||||
|
return Context.Last();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BobberConfig Fist(Predicate<BobberConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Fist(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BobberConfig Last(Predicate<BobberConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Last(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count()
|
||||||
|
{
|
||||||
|
return Context.Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count(Func<BobberConfig, bool> predicate)
|
||||||
|
{
|
||||||
|
return Context.Count(predicate);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static List<BobberConfig> GetList()
|
||||||
|
{
|
||||||
|
return Context.GetList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<BobberConfig> GetList(Predicate<BobberConfig> match)
|
||||||
|
{
|
||||||
|
return Context.GetList(match);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 99b64c24f2bad454086ac41dd6aa7ffc
|
||||||
65
Assets/Scripts/Configs~/Gen/Warps/FeederConfigWarp.cs
Normal file
65
Assets/Scripts/Configs~/Gen/Warps/FeederConfigWarp.cs
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
public partial class FeederConfig
|
||||||
|
{
|
||||||
|
private static ConfigContext<FeederConfig> _context;
|
||||||
|
|
||||||
|
private static ConfigContext<FeederConfig> Context => _context ??= Configs.Table<FeederConfig>();
|
||||||
|
|
||||||
|
public static FeederConfig Get(int key)
|
||||||
|
{
|
||||||
|
return Context.Get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FeederConfig Get(Predicate<FeederConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Get(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FeederConfig Fist()
|
||||||
|
{
|
||||||
|
return Context.Fist();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FeederConfig Last()
|
||||||
|
{
|
||||||
|
return Context.Last();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FeederConfig Fist(Predicate<FeederConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Fist(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FeederConfig Last(Predicate<FeederConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Last(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count()
|
||||||
|
{
|
||||||
|
return Context.Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count(Func<FeederConfig, bool> predicate)
|
||||||
|
{
|
||||||
|
return Context.Count(predicate);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static List<FeederConfig> GetList()
|
||||||
|
{
|
||||||
|
return Context.GetList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<FeederConfig> GetList(Predicate<FeederConfig> match)
|
||||||
|
{
|
||||||
|
return Context.GetList(match);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: dc082eda2a5880148843ce9c21ed4eed
|
||||||
65
Assets/Scripts/Configs~/Gen/Warps/FishAcceptConfigWarp.cs
Normal file
65
Assets/Scripts/Configs~/Gen/Warps/FishAcceptConfigWarp.cs
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
public partial class FishAcceptConfig
|
||||||
|
{
|
||||||
|
private static ConfigContext<FishAcceptConfig> _context;
|
||||||
|
|
||||||
|
private static ConfigContext<FishAcceptConfig> Context => _context ??= Configs.Table<FishAcceptConfig>();
|
||||||
|
|
||||||
|
public static FishAcceptConfig Get(int key)
|
||||||
|
{
|
||||||
|
return Context.Get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FishAcceptConfig Get(Predicate<FishAcceptConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Get(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FishAcceptConfig Fist()
|
||||||
|
{
|
||||||
|
return Context.Fist();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FishAcceptConfig Last()
|
||||||
|
{
|
||||||
|
return Context.Last();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FishAcceptConfig Fist(Predicate<FishAcceptConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Fist(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FishAcceptConfig Last(Predicate<FishAcceptConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Last(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count()
|
||||||
|
{
|
||||||
|
return Context.Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count(Func<FishAcceptConfig, bool> predicate)
|
||||||
|
{
|
||||||
|
return Context.Count(predicate);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static List<FishAcceptConfig> GetList()
|
||||||
|
{
|
||||||
|
return Context.GetList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<FishAcceptConfig> GetList(Predicate<FishAcceptConfig> match)
|
||||||
|
{
|
||||||
|
return Context.GetList(match);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 23d45122e487d8f439bf063a4df7a4b7
|
||||||
65
Assets/Scripts/Configs~/Gen/Warps/FishConfigWarp.cs
Normal file
65
Assets/Scripts/Configs~/Gen/Warps/FishConfigWarp.cs
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
public partial class FishConfig
|
||||||
|
{
|
||||||
|
private static ConfigContext<FishConfig> _context;
|
||||||
|
|
||||||
|
private static ConfigContext<FishConfig> Context => _context ??= Configs.Table<FishConfig>();
|
||||||
|
|
||||||
|
public static FishConfig Get(int key)
|
||||||
|
{
|
||||||
|
return Context.Get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FishConfig Get(Predicate<FishConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Get(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FishConfig Fist()
|
||||||
|
{
|
||||||
|
return Context.Fist();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FishConfig Last()
|
||||||
|
{
|
||||||
|
return Context.Last();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FishConfig Fist(Predicate<FishConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Fist(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FishConfig Last(Predicate<FishConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Last(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count()
|
||||||
|
{
|
||||||
|
return Context.Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count(Func<FishConfig, bool> predicate)
|
||||||
|
{
|
||||||
|
return Context.Count(predicate);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static List<FishConfig> GetList()
|
||||||
|
{
|
||||||
|
return Context.GetList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<FishConfig> GetList(Predicate<FishConfig> match)
|
||||||
|
{
|
||||||
|
return Context.GetList(match);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/Configs~/Gen/Warps/FishConfigWarp.cs.meta
Normal file
2
Assets/Scripts/Configs~/Gen/Warps/FishConfigWarp.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d60d97e94b1432c4e985a5469fd01409
|
||||||
65
Assets/Scripts/Configs~/Gen/Warps/HookConfigWarp.cs
Normal file
65
Assets/Scripts/Configs~/Gen/Warps/HookConfigWarp.cs
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
public partial class HookConfig
|
||||||
|
{
|
||||||
|
private static ConfigContext<HookConfig> _context;
|
||||||
|
|
||||||
|
private static ConfigContext<HookConfig> Context => _context ??= Configs.Table<HookConfig>();
|
||||||
|
|
||||||
|
public static HookConfig Get(int key)
|
||||||
|
{
|
||||||
|
return Context.Get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HookConfig Get(Predicate<HookConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Get(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HookConfig Fist()
|
||||||
|
{
|
||||||
|
return Context.Fist();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HookConfig Last()
|
||||||
|
{
|
||||||
|
return Context.Last();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HookConfig Fist(Predicate<HookConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Fist(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HookConfig Last(Predicate<HookConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Last(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count()
|
||||||
|
{
|
||||||
|
return Context.Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count(Func<HookConfig, bool> predicate)
|
||||||
|
{
|
||||||
|
return Context.Count(predicate);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static List<HookConfig> GetList()
|
||||||
|
{
|
||||||
|
return Context.GetList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<HookConfig> GetList(Predicate<HookConfig> match)
|
||||||
|
{
|
||||||
|
return Context.GetList(match);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/Configs~/Gen/Warps/HookConfigWarp.cs.meta
Normal file
2
Assets/Scripts/Configs~/Gen/Warps/HookConfigWarp.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: fc38b93ab46f1bd4a83f81f1cd3b3e4c
|
||||||
65
Assets/Scripts/Configs~/Gen/Warps/LeadersConfigWarp.cs
Normal file
65
Assets/Scripts/Configs~/Gen/Warps/LeadersConfigWarp.cs
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
public partial class LeadersConfig
|
||||||
|
{
|
||||||
|
private static ConfigContext<LeadersConfig> _context;
|
||||||
|
|
||||||
|
private static ConfigContext<LeadersConfig> Context => _context ??= Configs.Table<LeadersConfig>();
|
||||||
|
|
||||||
|
public static LeadersConfig Get(int key)
|
||||||
|
{
|
||||||
|
return Context.Get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LeadersConfig Get(Predicate<LeadersConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Get(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LeadersConfig Fist()
|
||||||
|
{
|
||||||
|
return Context.Fist();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LeadersConfig Last()
|
||||||
|
{
|
||||||
|
return Context.Last();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LeadersConfig Fist(Predicate<LeadersConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Fist(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LeadersConfig Last(Predicate<LeadersConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Last(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count()
|
||||||
|
{
|
||||||
|
return Context.Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count(Func<LeadersConfig, bool> predicate)
|
||||||
|
{
|
||||||
|
return Context.Count(predicate);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static List<LeadersConfig> GetList()
|
||||||
|
{
|
||||||
|
return Context.GetList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<LeadersConfig> GetList(Predicate<LeadersConfig> match)
|
||||||
|
{
|
||||||
|
return Context.GetList(match);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7911fb1cf4470014eadb4d9db5db5861
|
||||||
65
Assets/Scripts/Configs~/Gen/Warps/LineConfigWarp.cs
Normal file
65
Assets/Scripts/Configs~/Gen/Warps/LineConfigWarp.cs
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
public partial class LineConfig
|
||||||
|
{
|
||||||
|
private static ConfigContext<LineConfig> _context;
|
||||||
|
|
||||||
|
private static ConfigContext<LineConfig> Context => _context ??= Configs.Table<LineConfig>();
|
||||||
|
|
||||||
|
public static LineConfig Get(int key)
|
||||||
|
{
|
||||||
|
return Context.Get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LineConfig Get(Predicate<LineConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Get(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LineConfig Fist()
|
||||||
|
{
|
||||||
|
return Context.Fist();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LineConfig Last()
|
||||||
|
{
|
||||||
|
return Context.Last();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LineConfig Fist(Predicate<LineConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Fist(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LineConfig Last(Predicate<LineConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Last(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count()
|
||||||
|
{
|
||||||
|
return Context.Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count(Func<LineConfig, bool> predicate)
|
||||||
|
{
|
||||||
|
return Context.Count(predicate);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static List<LineConfig> GetList()
|
||||||
|
{
|
||||||
|
return Context.GetList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<LineConfig> GetList(Predicate<LineConfig> match)
|
||||||
|
{
|
||||||
|
return Context.GetList(match);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/Configs~/Gen/Warps/LineConfigWarp.cs.meta
Normal file
2
Assets/Scripts/Configs~/Gen/Warps/LineConfigWarp.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1acb019fe35da324cb5a26e45c54532d
|
||||||
65
Assets/Scripts/Configs~/Gen/Warps/LureConfigWarp.cs
Normal file
65
Assets/Scripts/Configs~/Gen/Warps/LureConfigWarp.cs
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
public partial class LureConfig
|
||||||
|
{
|
||||||
|
private static ConfigContext<LureConfig> _context;
|
||||||
|
|
||||||
|
private static ConfigContext<LureConfig> Context => _context ??= Configs.Table<LureConfig>();
|
||||||
|
|
||||||
|
public static LureConfig Get(int key)
|
||||||
|
{
|
||||||
|
return Context.Get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LureConfig Get(Predicate<LureConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Get(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LureConfig Fist()
|
||||||
|
{
|
||||||
|
return Context.Fist();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LureConfig Last()
|
||||||
|
{
|
||||||
|
return Context.Last();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LureConfig Fist(Predicate<LureConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Fist(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LureConfig Last(Predicate<LureConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Last(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count()
|
||||||
|
{
|
||||||
|
return Context.Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count(Func<LureConfig, bool> predicate)
|
||||||
|
{
|
||||||
|
return Context.Count(predicate);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static List<LureConfig> GetList()
|
||||||
|
{
|
||||||
|
return Context.GetList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<LureConfig> GetList(Predicate<LureConfig> match)
|
||||||
|
{
|
||||||
|
return Context.GetList(match);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/Configs~/Gen/Warps/LureConfigWarp.cs.meta
Normal file
2
Assets/Scripts/Configs~/Gen/Warps/LureConfigWarp.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 74aae733a506d0840a1a7cc2623ed5fd
|
||||||
65
Assets/Scripts/Configs~/Gen/Warps/ReelConfigWarp.cs
Normal file
65
Assets/Scripts/Configs~/Gen/Warps/ReelConfigWarp.cs
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
public partial class ReelConfig
|
||||||
|
{
|
||||||
|
private static ConfigContext<ReelConfig> _context;
|
||||||
|
|
||||||
|
private static ConfigContext<ReelConfig> Context => _context ??= Configs.Table<ReelConfig>();
|
||||||
|
|
||||||
|
public static ReelConfig Get(int key)
|
||||||
|
{
|
||||||
|
return Context.Get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ReelConfig Get(Predicate<ReelConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Get(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ReelConfig Fist()
|
||||||
|
{
|
||||||
|
return Context.Fist();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ReelConfig Last()
|
||||||
|
{
|
||||||
|
return Context.Last();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ReelConfig Fist(Predicate<ReelConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Fist(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ReelConfig Last(Predicate<ReelConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Last(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count()
|
||||||
|
{
|
||||||
|
return Context.Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count(Func<ReelConfig, bool> predicate)
|
||||||
|
{
|
||||||
|
return Context.Count(predicate);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static List<ReelConfig> GetList()
|
||||||
|
{
|
||||||
|
return Context.GetList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<ReelConfig> GetList(Predicate<ReelConfig> match)
|
||||||
|
{
|
||||||
|
return Context.GetList(match);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/Configs~/Gen/Warps/ReelConfigWarp.cs.meta
Normal file
2
Assets/Scripts/Configs~/Gen/Warps/ReelConfigWarp.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6bfa9f163eb97be418e04f1f62c607de
|
||||||
65
Assets/Scripts/Configs~/Gen/Warps/RingConfigWarp.cs
Normal file
65
Assets/Scripts/Configs~/Gen/Warps/RingConfigWarp.cs
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
public partial class RingConfig
|
||||||
|
{
|
||||||
|
private static ConfigContext<RingConfig> _context;
|
||||||
|
|
||||||
|
private static ConfigContext<RingConfig> Context => _context ??= Configs.Table<RingConfig>();
|
||||||
|
|
||||||
|
public static RingConfig Get(int key)
|
||||||
|
{
|
||||||
|
return Context.Get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static RingConfig Get(Predicate<RingConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Get(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static RingConfig Fist()
|
||||||
|
{
|
||||||
|
return Context.Fist();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static RingConfig Last()
|
||||||
|
{
|
||||||
|
return Context.Last();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static RingConfig Fist(Predicate<RingConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Fist(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static RingConfig Last(Predicate<RingConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Last(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count()
|
||||||
|
{
|
||||||
|
return Context.Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count(Func<RingConfig, bool> predicate)
|
||||||
|
{
|
||||||
|
return Context.Count(predicate);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static List<RingConfig> GetList()
|
||||||
|
{
|
||||||
|
return Context.GetList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<RingConfig> GetList(Predicate<RingConfig> match)
|
||||||
|
{
|
||||||
|
return Context.GetList(match);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/Configs~/Gen/Warps/RingConfigWarp.cs.meta
Normal file
2
Assets/Scripts/Configs~/Gen/Warps/RingConfigWarp.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a52a98969f4fae44ba19533cb1ae552e
|
||||||
65
Assets/Scripts/Configs~/Gen/Warps/RodConfigWarp.cs
Normal file
65
Assets/Scripts/Configs~/Gen/Warps/RodConfigWarp.cs
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
public partial class RodConfig
|
||||||
|
{
|
||||||
|
private static ConfigContext<RodConfig> _context;
|
||||||
|
|
||||||
|
private static ConfigContext<RodConfig> Context => _context ??= Configs.Table<RodConfig>();
|
||||||
|
|
||||||
|
public static RodConfig Get(int key)
|
||||||
|
{
|
||||||
|
return Context.Get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static RodConfig Get(Predicate<RodConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Get(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static RodConfig Fist()
|
||||||
|
{
|
||||||
|
return Context.Fist();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static RodConfig Last()
|
||||||
|
{
|
||||||
|
return Context.Last();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static RodConfig Fist(Predicate<RodConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Fist(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static RodConfig Last(Predicate<RodConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Last(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count()
|
||||||
|
{
|
||||||
|
return Context.Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count(Func<RodConfig, bool> predicate)
|
||||||
|
{
|
||||||
|
return Context.Count(predicate);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static List<RodConfig> GetList()
|
||||||
|
{
|
||||||
|
return Context.GetList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<RodConfig> GetList(Predicate<RodConfig> match)
|
||||||
|
{
|
||||||
|
return Context.GetList(match);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/Configs~/Gen/Warps/RodConfigWarp.cs.meta
Normal file
2
Assets/Scripts/Configs~/Gen/Warps/RodConfigWarp.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 81f057dddf36a734ead19cd98e19a2e0
|
||||||
65
Assets/Scripts/Configs~/Gen/Warps/UnitConfigWarp.cs
Normal file
65
Assets/Scripts/Configs~/Gen/Warps/UnitConfigWarp.cs
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
public partial class UnitConfig
|
||||||
|
{
|
||||||
|
private static ConfigContext<UnitConfig> _context;
|
||||||
|
|
||||||
|
private static ConfigContext<UnitConfig> Context => _context ??= Configs.Table<UnitConfig>();
|
||||||
|
|
||||||
|
public static UnitConfig Get(int key)
|
||||||
|
{
|
||||||
|
return Context.Get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static UnitConfig Get(Predicate<UnitConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Get(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static UnitConfig Fist()
|
||||||
|
{
|
||||||
|
return Context.Fist();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static UnitConfig Last()
|
||||||
|
{
|
||||||
|
return Context.Last();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static UnitConfig Fist(Predicate<UnitConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Fist(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static UnitConfig Last(Predicate<UnitConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Last(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count()
|
||||||
|
{
|
||||||
|
return Context.Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count(Func<UnitConfig, bool> predicate)
|
||||||
|
{
|
||||||
|
return Context.Count(predicate);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static List<UnitConfig> GetList()
|
||||||
|
{
|
||||||
|
return Context.GetList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<UnitConfig> GetList(Predicate<UnitConfig> match)
|
||||||
|
{
|
||||||
|
return Context.GetList(match);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/Configs~/Gen/Warps/UnitConfigWarp.cs.meta
Normal file
2
Assets/Scripts/Configs~/Gen/Warps/UnitConfigWarp.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 69acf2fddccdd7b4fae3ad883cbc50ec
|
||||||
65
Assets/Scripts/Configs~/Gen/Warps/WeightConfigWarp.cs
Normal file
65
Assets/Scripts/Configs~/Gen/Warps/WeightConfigWarp.cs
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
public partial class WeightConfig
|
||||||
|
{
|
||||||
|
private static ConfigContext<WeightConfig> _context;
|
||||||
|
|
||||||
|
private static ConfigContext<WeightConfig> Context => _context ??= Configs.Table<WeightConfig>();
|
||||||
|
|
||||||
|
public static WeightConfig Get(int key)
|
||||||
|
{
|
||||||
|
return Context.Get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static WeightConfig Get(Predicate<WeightConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Get(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static WeightConfig Fist()
|
||||||
|
{
|
||||||
|
return Context.Fist();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static WeightConfig Last()
|
||||||
|
{
|
||||||
|
return Context.Last();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static WeightConfig Fist(Predicate<WeightConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Fist(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static WeightConfig Last(Predicate<WeightConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Last(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count()
|
||||||
|
{
|
||||||
|
return Context.Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count(Func<WeightConfig, bool> predicate)
|
||||||
|
{
|
||||||
|
return Context.Count(predicate);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static List<WeightConfig> GetList()
|
||||||
|
{
|
||||||
|
return Context.GetList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<WeightConfig> GetList(Predicate<WeightConfig> match)
|
||||||
|
{
|
||||||
|
return Context.GetList(match);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 43244884876723947bd6574d57b2349c
|
||||||
3
Assets/Scripts/Configs~/Mem.meta
Normal file
3
Assets/Scripts/Configs~/Mem.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9fbbf78150ef486581fecb379fc3b1cd
|
||||||
|
timeCreated: 1742998650
|
||||||
137
Assets/Scripts/Configs~/Mem/BaitConfig.cs
Normal file
137
Assets/Scripts/Configs~/Mem/BaitConfig.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Configs~/Mem/BaitConfig.cs.meta
Normal file
3
Assets/Scripts/Configs~/Mem/BaitConfig.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 29ac65179e8d469d96caa04ce15021d6
|
||||||
|
timeCreated: 1742999023
|
||||||
32
Assets/Scripts/Configs~/Mem/BobberConfig.cs
Normal file
32
Assets/Scripts/Configs~/Mem/BobberConfig.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Configs~/Mem/BobberConfig.cs.meta
Normal file
3
Assets/Scripts/Configs~/Mem/BobberConfig.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6297ba097dac45eb8f14f55dc5ad7d7b
|
||||||
|
timeCreated: 1742999241
|
||||||
68
Assets/Scripts/Configs~/Mem/CameraCfg.cs
Normal file
68
Assets/Scripts/Configs~/Mem/CameraCfg.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Configs~/Mem/CameraCfg.cs.meta
Normal file
3
Assets/Scripts/Configs~/Mem/CameraCfg.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 5f43c20e40ae42239e4381c12ad7cc00
|
||||||
|
timeCreated: 1756823027
|
||||||
53
Assets/Scripts/Configs~/Mem/ConfigBase.cs
Normal file
53
Assets/Scripts/Configs~/Mem/ConfigBase.cs
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Configs~/Mem/ConfigBase.cs.meta
Normal file
3
Assets/Scripts/Configs~/Mem/ConfigBase.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: bfb754c68ea2417685d3e29804c996fa
|
||||||
|
timeCreated: 1742998658
|
||||||
25
Assets/Scripts/Configs~/Mem/FeederConfig.cs
Normal file
25
Assets/Scripts/Configs~/Mem/FeederConfig.cs
Normal 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;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Configs~/Mem/FeederConfig.cs.meta
Normal file
3
Assets/Scripts/Configs~/Mem/FeederConfig.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4a3acf5935cc49be8a1e655250ea28e9
|
||||||
|
timeCreated: 1742999291
|
||||||
12
Assets/Scripts/Configs~/Mem/FishAcceptConfig.cs
Normal file
12
Assets/Scripts/Configs~/Mem/FishAcceptConfig.cs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
[TableName("gameFishAccepts")]
|
||||||
|
public partial class FishAcceptConfig : ConfigBase
|
||||||
|
{
|
||||||
|
public int bait;
|
||||||
|
|
||||||
|
public float min;
|
||||||
|
|
||||||
|
public float max;
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Configs~/Mem/FishAcceptConfig.cs.meta
Normal file
3
Assets/Scripts/Configs~/Mem/FishAcceptConfig.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 315e92a457a44e67a23cc79710bebdb6
|
||||||
|
timeCreated: 1744862496
|
||||||
134
Assets/Scripts/Configs~/Mem/FishConfig.cs
Normal file
134
Assets/Scripts/Configs~/Mem/FishConfig.cs
Normal 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]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Configs~/Mem/FishConfig.cs.meta
Normal file
3
Assets/Scripts/Configs~/Mem/FishConfig.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 036e4898008747fda0a473707565667b
|
||||||
|
timeCreated: 1742999445
|
||||||
167
Assets/Scripts/Configs~/Mem/HookConfig.cs
Normal file
167
Assets/Scripts/Configs~/Mem/HookConfig.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Configs~/Mem/HookConfig.cs.meta
Normal file
3
Assets/Scripts/Configs~/Mem/HookConfig.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 163f314510a24a43b7f86e22854cde3b
|
||||||
|
timeCreated: 1742999185
|
||||||
19
Assets/Scripts/Configs~/Mem/LeadersConfig.cs
Normal file
19
Assets/Scripts/Configs~/Mem/LeadersConfig.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Configs~/Mem/LeadersConfig.cs.meta
Normal file
3
Assets/Scripts/Configs~/Mem/LeadersConfig.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4a5ae0258ce84be1b6b2c2cb6a9921f9
|
||||||
|
timeCreated: 1742998962
|
||||||
28
Assets/Scripts/Configs~/Mem/LineConfig.cs
Normal file
28
Assets/Scripts/Configs~/Mem/LineConfig.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Configs~/Mem/LineConfig.cs.meta
Normal file
3
Assets/Scripts/Configs~/Mem/LineConfig.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8f09d37212e24ee2bb9f0b99ca69df42
|
||||||
|
timeCreated: 1742998906
|
||||||
123
Assets/Scripts/Configs~/Mem/LureConfig.cs
Normal file
123
Assets/Scripts/Configs~/Mem/LureConfig.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Configs~/Mem/LureConfig.cs.meta
Normal file
3
Assets/Scripts/Configs~/Mem/LureConfig.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 184995816e1944d2afc02384ef109693
|
||||||
|
timeCreated: 1744898827
|
||||||
30
Assets/Scripts/Configs~/Mem/ReelConfig.cs
Normal file
30
Assets/Scripts/Configs~/Mem/ReelConfig.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Configs~/Mem/ReelConfig.cs.meta
Normal file
3
Assets/Scripts/Configs~/Mem/ReelConfig.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 13045659d27f4ee89aab30efb1740215
|
||||||
|
timeCreated: 1742998847
|
||||||
7
Assets/Scripts/Configs~/Mem/RingConfig.cs
Normal file
7
Assets/Scripts/Configs~/Mem/RingConfig.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
[TableName("gameRings")]
|
||||||
|
public partial class RingConfig : ConfigGearBase
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Configs~/Mem/RingConfig.cs.meta
Normal file
3
Assets/Scripts/Configs~/Mem/RingConfig.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 15f2ba6ac6404e9390d9cc2604f2016c
|
||||||
|
timeCreated: 1744861381
|
||||||
41
Assets/Scripts/Configs~/Mem/RodConfig.cs
Normal file
41
Assets/Scripts/Configs~/Mem/RodConfig.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Configs~/Mem/RodConfig.cs.meta
Normal file
3
Assets/Scripts/Configs~/Mem/RodConfig.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 01b7a315690b4a2d8f82aec56a3a3971
|
||||||
|
timeCreated: 1742998702
|
||||||
31
Assets/Scripts/Configs~/Mem/UnitConfig.cs
Normal file
31
Assets/Scripts/Configs~/Mem/UnitConfig.cs
Normal 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,
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Configs~/Mem/UnitConfig.cs.meta
Normal file
3
Assets/Scripts/Configs~/Mem/UnitConfig.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 956ed7b067744c369fcff9a8baef77ee
|
||||||
|
timeCreated: 1756049614
|
||||||
26
Assets/Scripts/Configs~/Mem/WeightConfig.cs
Normal file
26
Assets/Scripts/Configs~/Mem/WeightConfig.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Configs~/Mem/WeightConfig.cs.meta
Normal file
3
Assets/Scripts/Configs~/Mem/WeightConfig.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6bfe88a3b2474031aa65c995baebf6f6
|
||||||
|
timeCreated: 1742999355
|
||||||
@@ -24,7 +24,7 @@ namespace NBF.Fishing2
|
|||||||
ret.Country = self.BaseInfo.Country;
|
ret.Country = self.BaseInfo.Country;
|
||||||
ret.Head = self.BaseInfo.Head;
|
ret.Head = self.BaseInfo.Head;
|
||||||
ret.Level = self.BaseInfo.Level;
|
ret.Level = self.BaseInfo.Level;
|
||||||
ret.Vip = self.BaseInfo.Vip;
|
// ret.Vip = self.BaseInfo.Vip;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ namespace NBF.Fishing2
|
|||||||
Head = Info.BaseInfo.Head,
|
Head = Info.BaseInfo.Head,
|
||||||
Country = Info.BaseInfo.Country,
|
Country = Info.BaseInfo.Country,
|
||||||
Level = Info.BaseInfo.Level,
|
Level = Info.BaseInfo.Level,
|
||||||
Vip = Info.BaseInfo.Vip
|
// Vip = Info.BaseInfo.Vip
|
||||||
};
|
};
|
||||||
|
|
||||||
return mapUnit;
|
return mapUnit;
|
||||||
|
|||||||
@@ -5,93 +5,15 @@ using System.Linq;
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
#if FANTASY_NET
|
|
||||||
using Fantasy.ConfigTable;
|
|
||||||
using Fantasy.Serialize;
|
|
||||||
#else
|
|
||||||
using NBC;
|
using NBC;
|
||||||
using NBC.Serialize;
|
using NBC.Serialize;
|
||||||
#endif
|
|
||||||
// ReSharper disable CollectionNeverUpdated.Global
|
|
||||||
// ReSharper disable UnusedAutoPropertyAccessor.Global
|
|
||||||
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
|
|
||||||
#pragma warning disable CS0169
|
|
||||||
#pragma warning disable CS8618
|
|
||||||
#pragma warning disable CS8625
|
|
||||||
#pragma warning disable CS8603
|
|
||||||
|
|
||||||
namespace NBF
|
namespace NBF
|
||||||
{
|
{
|
||||||
[ProtoContract]
|
[ProtoContract]
|
||||||
public sealed partial class BaitConfigData : ASerialize, IConfigTable, IProto
|
public sealed partial class BaitConfig : ASerialize, IProto, IConfigTable
|
||||||
{
|
{
|
||||||
[ProtoMember(1)]
|
|
||||||
public List<BaitConfig> List { get; set; } = new List<BaitConfig>();
|
|
||||||
#if FANTASY_NET
|
|
||||||
[ProtoIgnore]
|
|
||||||
private readonly ConcurrentDictionary<uint, BaitConfig> _configs = new ConcurrentDictionary<uint, BaitConfig>();
|
|
||||||
#else
|
|
||||||
[ProtoIgnore]
|
|
||||||
private readonly Dictionary<uint, BaitConfig> _configs = new Dictionary<uint, BaitConfig>();
|
|
||||||
#endif
|
|
||||||
private static BaitConfigData _instance = null;
|
|
||||||
|
|
||||||
public static BaitConfigData Instance
|
|
||||||
{
|
|
||||||
get { return _instance ??= ConfigTableHelper.Load<BaitConfigData>(); }
|
|
||||||
private set => _instance = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BaitConfig Get(uint id, bool check = true)
|
|
||||||
{
|
|
||||||
if (_configs.ContainsKey(id))
|
|
||||||
{
|
|
||||||
return _configs[id];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (check)
|
|
||||||
{
|
|
||||||
throw new Exception($"BaitConfig not find {id} Id");
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
public bool TryGet(uint id, out BaitConfig config)
|
|
||||||
{
|
|
||||||
config = null;
|
|
||||||
|
|
||||||
if (!_configs.ContainsKey(id))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
config = _configs[id];
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
public override void AfterDeserialization()
|
|
||||||
{
|
|
||||||
foreach (var config in List)
|
|
||||||
{
|
|
||||||
#if FANTASY_NET
|
|
||||||
_configs.TryAdd(config.Id, config);
|
|
||||||
#else
|
|
||||||
_configs.Add(config.Id, config);
|
|
||||||
#endif
|
|
||||||
config.AfterDeserialization();
|
|
||||||
}
|
|
||||||
|
|
||||||
EndInit();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Dispose()
|
|
||||||
{
|
|
||||||
Instance = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[ProtoContract]
|
|
||||||
public sealed partial class BaitConfig : ASerialize, IProto
|
|
||||||
{
|
|
||||||
[ProtoMember(1)]
|
[ProtoMember(1)]
|
||||||
public uint Id { get; set; } // Id
|
public uint Id { get; set; } // Id
|
||||||
[ProtoMember(2)]
|
[ProtoMember(2)]
|
||||||
@@ -106,5 +28,66 @@ namespace NBF
|
|||||||
public uint[] Arr { get; set; } = Array.Empty<uint>(); // 重量(克)
|
public uint[] Arr { get; set; } = Array.Empty<uint>(); // 重量(克)
|
||||||
[ProtoMember(7)]
|
[ProtoMember(7)]
|
||||||
public string[] ArrStr { get; set; } = Array.Empty<string>(); // 重量(克)
|
public string[] ArrStr { get; set; } = Array.Empty<string>(); // 重量(克)
|
||||||
}
|
[ProtoIgnore]
|
||||||
}
|
public uint Key => Id;
|
||||||
|
|
||||||
|
#region Static
|
||||||
|
|
||||||
|
private static ConfigContext<BaitConfig> Context => ConfigTableHelper.Table<BaitConfig>();
|
||||||
|
|
||||||
|
public static BaitConfig Get(uint key)
|
||||||
|
{
|
||||||
|
return Context.Get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BaitConfig Get(Predicate<BaitConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Get(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BaitConfig Fist()
|
||||||
|
{
|
||||||
|
return Context.Fist();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BaitConfig Last()
|
||||||
|
{
|
||||||
|
return Context.Last();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BaitConfig Fist(Predicate<BaitConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Fist(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BaitConfig Last(Predicate<BaitConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Last(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count()
|
||||||
|
{
|
||||||
|
return Context.Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count(Func<BaitConfig, bool> predicate)
|
||||||
|
{
|
||||||
|
return Context.Count(predicate);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<BaitConfig> GetList()
|
||||||
|
{
|
||||||
|
return Context.GetList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<BaitConfig> GetList(Predicate<BaitConfig> match)
|
||||||
|
{
|
||||||
|
return Context.GetList(match);
|
||||||
|
}
|
||||||
|
public static void ParseJson(Newtonsoft.Json.Linq.JArray arr)
|
||||||
|
{
|
||||||
|
ConfigTableHelper.ParseLine<BaitConfig>(arr);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
85
Assets/Scripts/Generate/Config/BasicConfig.cs
Normal file
85
Assets/Scripts/Generate/Config/BasicConfig.cs
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
using System;
|
||||||
|
using ProtoBuf;
|
||||||
|
using Fantasy;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using NBC;
|
||||||
|
using NBC.Serialize;
|
||||||
|
|
||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
[ProtoContract]
|
||||||
|
public sealed partial class BasicConfig : ASerialize, IProto, IConfigTable
|
||||||
|
{
|
||||||
|
|
||||||
|
[ProtoMember(1)]
|
||||||
|
public uint Id { get; set; } // Id
|
||||||
|
[ProtoMember(2)]
|
||||||
|
public string Name { get; set; } // 参数名
|
||||||
|
[ProtoMember(3)]
|
||||||
|
public string[] Val { get; set; } = Array.Empty<string>(); // 参数值
|
||||||
|
[ProtoIgnore]
|
||||||
|
public uint Key => Id;
|
||||||
|
|
||||||
|
#region Static
|
||||||
|
|
||||||
|
private static ConfigContext<BasicConfig> Context => ConfigTableHelper.Table<BasicConfig>();
|
||||||
|
|
||||||
|
public static BasicConfig Get(uint key)
|
||||||
|
{
|
||||||
|
return Context.Get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BasicConfig Get(Predicate<BasicConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Get(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BasicConfig Fist()
|
||||||
|
{
|
||||||
|
return Context.Fist();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BasicConfig Last()
|
||||||
|
{
|
||||||
|
return Context.Last();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BasicConfig Fist(Predicate<BasicConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Fist(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BasicConfig Last(Predicate<BasicConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Last(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count()
|
||||||
|
{
|
||||||
|
return Context.Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count(Func<BasicConfig, bool> predicate)
|
||||||
|
{
|
||||||
|
return Context.Count(predicate);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<BasicConfig> GetList()
|
||||||
|
{
|
||||||
|
return Context.GetList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<BasicConfig> GetList(Predicate<BasicConfig> match)
|
||||||
|
{
|
||||||
|
return Context.GetList(match);
|
||||||
|
}
|
||||||
|
public static void ParseJson(Newtonsoft.Json.Linq.JArray arr)
|
||||||
|
{
|
||||||
|
ConfigTableHelper.ParseLine<BasicConfig>(arr);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/Generate/Config/BasicConfig.cs.meta
Normal file
2
Assets/Scripts/Generate/Config/BasicConfig.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 5c900c2cd8da41740a01b749b9c8d844
|
||||||
@@ -5,93 +5,15 @@ using System.Linq;
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
#if FANTASY_NET
|
|
||||||
using Fantasy.ConfigTable;
|
|
||||||
using Fantasy.Serialize;
|
|
||||||
#else
|
|
||||||
using NBC;
|
using NBC;
|
||||||
using NBC.Serialize;
|
using NBC.Serialize;
|
||||||
#endif
|
|
||||||
// ReSharper disable CollectionNeverUpdated.Global
|
|
||||||
// ReSharper disable UnusedAutoPropertyAccessor.Global
|
|
||||||
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
|
|
||||||
#pragma warning disable CS0169
|
|
||||||
#pragma warning disable CS8618
|
|
||||||
#pragma warning disable CS8625
|
|
||||||
#pragma warning disable CS8603
|
|
||||||
|
|
||||||
namespace NBF
|
namespace NBF
|
||||||
{
|
{
|
||||||
[ProtoContract]
|
[ProtoContract]
|
||||||
public sealed partial class BobberConfigData : ASerialize, IConfigTable, IProto
|
public sealed partial class BobberConfig : ASerialize, IProto, IConfigTable
|
||||||
{
|
{
|
||||||
[ProtoMember(1)]
|
|
||||||
public List<BobberConfig> List { get; set; } = new List<BobberConfig>();
|
|
||||||
#if FANTASY_NET
|
|
||||||
[ProtoIgnore]
|
|
||||||
private readonly ConcurrentDictionary<uint, BobberConfig> _configs = new ConcurrentDictionary<uint, BobberConfig>();
|
|
||||||
#else
|
|
||||||
[ProtoIgnore]
|
|
||||||
private readonly Dictionary<uint, BobberConfig> _configs = new Dictionary<uint, BobberConfig>();
|
|
||||||
#endif
|
|
||||||
private static BobberConfigData _instance = null;
|
|
||||||
|
|
||||||
public static BobberConfigData Instance
|
|
||||||
{
|
|
||||||
get { return _instance ??= ConfigTableHelper.Load<BobberConfigData>(); }
|
|
||||||
private set => _instance = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BobberConfig Get(uint id, bool check = true)
|
|
||||||
{
|
|
||||||
if (_configs.ContainsKey(id))
|
|
||||||
{
|
|
||||||
return _configs[id];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (check)
|
|
||||||
{
|
|
||||||
throw new Exception($"BobberConfig not find {id} Id");
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
public bool TryGet(uint id, out BobberConfig config)
|
|
||||||
{
|
|
||||||
config = null;
|
|
||||||
|
|
||||||
if (!_configs.ContainsKey(id))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
config = _configs[id];
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
public override void AfterDeserialization()
|
|
||||||
{
|
|
||||||
foreach (var config in List)
|
|
||||||
{
|
|
||||||
#if FANTASY_NET
|
|
||||||
_configs.TryAdd(config.Id, config);
|
|
||||||
#else
|
|
||||||
_configs.Add(config.Id, config);
|
|
||||||
#endif
|
|
||||||
config.AfterDeserialization();
|
|
||||||
}
|
|
||||||
|
|
||||||
EndInit();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Dispose()
|
|
||||||
{
|
|
||||||
Instance = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[ProtoContract]
|
|
||||||
public sealed partial class BobberConfig : ASerialize, IProto
|
|
||||||
{
|
|
||||||
[ProtoMember(1)]
|
[ProtoMember(1)]
|
||||||
public uint Id { get; set; } // Id
|
public uint Id { get; set; } // Id
|
||||||
[ProtoMember(2)]
|
[ProtoMember(2)]
|
||||||
@@ -104,5 +26,66 @@ namespace NBF
|
|||||||
public uint Displacement { get; set; } // 位移
|
public uint Displacement { get; set; } // 位移
|
||||||
[ProtoMember(6)]
|
[ProtoMember(6)]
|
||||||
public uint NightLight { get; set; } // 是否夜光
|
public uint NightLight { get; set; } // 是否夜光
|
||||||
}
|
[ProtoIgnore]
|
||||||
}
|
public uint Key => Id;
|
||||||
|
|
||||||
|
#region Static
|
||||||
|
|
||||||
|
private static ConfigContext<BobberConfig> Context => ConfigTableHelper.Table<BobberConfig>();
|
||||||
|
|
||||||
|
public static BobberConfig Get(uint key)
|
||||||
|
{
|
||||||
|
return Context.Get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BobberConfig Get(Predicate<BobberConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Get(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BobberConfig Fist()
|
||||||
|
{
|
||||||
|
return Context.Fist();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BobberConfig Last()
|
||||||
|
{
|
||||||
|
return Context.Last();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BobberConfig Fist(Predicate<BobberConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Fist(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BobberConfig Last(Predicate<BobberConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Last(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count()
|
||||||
|
{
|
||||||
|
return Context.Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count(Func<BobberConfig, bool> predicate)
|
||||||
|
{
|
||||||
|
return Context.Count(predicate);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<BobberConfig> GetList()
|
||||||
|
{
|
||||||
|
return Context.GetList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<BobberConfig> GetList(Predicate<BobberConfig> match)
|
||||||
|
{
|
||||||
|
return Context.GetList(match);
|
||||||
|
}
|
||||||
|
public static void ParseJson(Newtonsoft.Json.Linq.JArray arr)
|
||||||
|
{
|
||||||
|
ConfigTableHelper.ParseLine<BobberConfig>(arr);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,93 +5,15 @@ using System.Linq;
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
#if FANTASY_NET
|
|
||||||
using Fantasy.ConfigTable;
|
|
||||||
using Fantasy.Serialize;
|
|
||||||
#else
|
|
||||||
using NBC;
|
using NBC;
|
||||||
using NBC.Serialize;
|
using NBC.Serialize;
|
||||||
#endif
|
|
||||||
// ReSharper disable CollectionNeverUpdated.Global
|
|
||||||
// ReSharper disable UnusedAutoPropertyAccessor.Global
|
|
||||||
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
|
|
||||||
#pragma warning disable CS0169
|
|
||||||
#pragma warning disable CS8618
|
|
||||||
#pragma warning disable CS8625
|
|
||||||
#pragma warning disable CS8603
|
|
||||||
|
|
||||||
namespace NBF
|
namespace NBF
|
||||||
{
|
{
|
||||||
[ProtoContract]
|
[ProtoContract]
|
||||||
public sealed partial class FeederConfigData : ASerialize, IConfigTable, IProto
|
public sealed partial class FeederConfig : ASerialize, IProto, IConfigTable
|
||||||
{
|
{
|
||||||
[ProtoMember(1)]
|
|
||||||
public List<FeederConfig> List { get; set; } = new List<FeederConfig>();
|
|
||||||
#if FANTASY_NET
|
|
||||||
[ProtoIgnore]
|
|
||||||
private readonly ConcurrentDictionary<uint, FeederConfig> _configs = new ConcurrentDictionary<uint, FeederConfig>();
|
|
||||||
#else
|
|
||||||
[ProtoIgnore]
|
|
||||||
private readonly Dictionary<uint, FeederConfig> _configs = new Dictionary<uint, FeederConfig>();
|
|
||||||
#endif
|
|
||||||
private static FeederConfigData _instance = null;
|
|
||||||
|
|
||||||
public static FeederConfigData Instance
|
|
||||||
{
|
|
||||||
get { return _instance ??= ConfigTableHelper.Load<FeederConfigData>(); }
|
|
||||||
private set => _instance = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public FeederConfig Get(uint id, bool check = true)
|
|
||||||
{
|
|
||||||
if (_configs.ContainsKey(id))
|
|
||||||
{
|
|
||||||
return _configs[id];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (check)
|
|
||||||
{
|
|
||||||
throw new Exception($"FeederConfig not find {id} Id");
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
public bool TryGet(uint id, out FeederConfig config)
|
|
||||||
{
|
|
||||||
config = null;
|
|
||||||
|
|
||||||
if (!_configs.ContainsKey(id))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
config = _configs[id];
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
public override void AfterDeserialization()
|
|
||||||
{
|
|
||||||
foreach (var config in List)
|
|
||||||
{
|
|
||||||
#if FANTASY_NET
|
|
||||||
_configs.TryAdd(config.Id, config);
|
|
||||||
#else
|
|
||||||
_configs.Add(config.Id, config);
|
|
||||||
#endif
|
|
||||||
config.AfterDeserialization();
|
|
||||||
}
|
|
||||||
|
|
||||||
EndInit();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Dispose()
|
|
||||||
{
|
|
||||||
Instance = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[ProtoContract]
|
|
||||||
public sealed partial class FeederConfig : ASerialize, IProto
|
|
||||||
{
|
|
||||||
[ProtoMember(1)]
|
[ProtoMember(1)]
|
||||||
public uint Id { get; set; } // Id
|
public uint Id { get; set; } // Id
|
||||||
[ProtoMember(2)]
|
[ProtoMember(2)]
|
||||||
@@ -102,5 +24,66 @@ namespace NBF
|
|||||||
public uint Capacity { get; set; } // 能力
|
public uint Capacity { get; set; } // 能力
|
||||||
[ProtoMember(5)]
|
[ProtoMember(5)]
|
||||||
public uint Weight { get; set; } // 重量(克)
|
public uint Weight { get; set; } // 重量(克)
|
||||||
}
|
[ProtoIgnore]
|
||||||
}
|
public uint Key => Id;
|
||||||
|
|
||||||
|
#region Static
|
||||||
|
|
||||||
|
private static ConfigContext<FeederConfig> Context => ConfigTableHelper.Table<FeederConfig>();
|
||||||
|
|
||||||
|
public static FeederConfig Get(uint key)
|
||||||
|
{
|
||||||
|
return Context.Get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FeederConfig Get(Predicate<FeederConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Get(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FeederConfig Fist()
|
||||||
|
{
|
||||||
|
return Context.Fist();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FeederConfig Last()
|
||||||
|
{
|
||||||
|
return Context.Last();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FeederConfig Fist(Predicate<FeederConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Fist(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FeederConfig Last(Predicate<FeederConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Last(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count()
|
||||||
|
{
|
||||||
|
return Context.Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count(Func<FeederConfig, bool> predicate)
|
||||||
|
{
|
||||||
|
return Context.Count(predicate);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<FeederConfig> GetList()
|
||||||
|
{
|
||||||
|
return Context.GetList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<FeederConfig> GetList(Predicate<FeederConfig> match)
|
||||||
|
{
|
||||||
|
return Context.GetList(match);
|
||||||
|
}
|
||||||
|
public static void ParseJson(Newtonsoft.Json.Linq.JArray arr)
|
||||||
|
{
|
||||||
|
ConfigTableHelper.ParseLine<FeederConfig>(arr);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,93 +5,15 @@ using System.Linq;
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
#if FANTASY_NET
|
|
||||||
using Fantasy.ConfigTable;
|
|
||||||
using Fantasy.Serialize;
|
|
||||||
#else
|
|
||||||
using NBC;
|
using NBC;
|
||||||
using NBC.Serialize;
|
using NBC.Serialize;
|
||||||
#endif
|
|
||||||
// ReSharper disable CollectionNeverUpdated.Global
|
|
||||||
// ReSharper disable UnusedAutoPropertyAccessor.Global
|
|
||||||
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
|
|
||||||
#pragma warning disable CS0169
|
|
||||||
#pragma warning disable CS8618
|
|
||||||
#pragma warning disable CS8625
|
|
||||||
#pragma warning disable CS8603
|
|
||||||
|
|
||||||
namespace NBF
|
namespace NBF
|
||||||
{
|
{
|
||||||
[ProtoContract]
|
[ProtoContract]
|
||||||
public sealed partial class FishConfigData : ASerialize, IConfigTable, IProto
|
public sealed partial class FishConfig : ASerialize, IProto, IConfigTable
|
||||||
{
|
{
|
||||||
[ProtoMember(1)]
|
|
||||||
public List<FishConfig> List { get; set; } = new List<FishConfig>();
|
|
||||||
#if FANTASY_NET
|
|
||||||
[ProtoIgnore]
|
|
||||||
private readonly ConcurrentDictionary<uint, FishConfig> _configs = new ConcurrentDictionary<uint, FishConfig>();
|
|
||||||
#else
|
|
||||||
[ProtoIgnore]
|
|
||||||
private readonly Dictionary<uint, FishConfig> _configs = new Dictionary<uint, FishConfig>();
|
|
||||||
#endif
|
|
||||||
private static FishConfigData _instance = null;
|
|
||||||
|
|
||||||
public static FishConfigData Instance
|
|
||||||
{
|
|
||||||
get { return _instance ??= ConfigTableHelper.Load<FishConfigData>(); }
|
|
||||||
private set => _instance = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public FishConfig Get(uint id, bool check = true)
|
|
||||||
{
|
|
||||||
if (_configs.ContainsKey(id))
|
|
||||||
{
|
|
||||||
return _configs[id];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (check)
|
|
||||||
{
|
|
||||||
throw new Exception($"FishConfig not find {id} Id");
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
public bool TryGet(uint id, out FishConfig config)
|
|
||||||
{
|
|
||||||
config = null;
|
|
||||||
|
|
||||||
if (!_configs.ContainsKey(id))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
config = _configs[id];
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
public override void AfterDeserialization()
|
|
||||||
{
|
|
||||||
foreach (var config in List)
|
|
||||||
{
|
|
||||||
#if FANTASY_NET
|
|
||||||
_configs.TryAdd(config.Id, config);
|
|
||||||
#else
|
|
||||||
_configs.Add(config.Id, config);
|
|
||||||
#endif
|
|
||||||
config.AfterDeserialization();
|
|
||||||
}
|
|
||||||
|
|
||||||
EndInit();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Dispose()
|
|
||||||
{
|
|
||||||
Instance = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[ProtoContract]
|
|
||||||
public sealed partial class FishConfig : ASerialize, IProto
|
|
||||||
{
|
|
||||||
[ProtoMember(1)]
|
[ProtoMember(1)]
|
||||||
public uint Id { get; set; } // Id
|
public uint Id { get; set; } // Id
|
||||||
[ProtoMember(2)]
|
[ProtoMember(2)]
|
||||||
@@ -106,5 +28,66 @@ namespace NBF
|
|||||||
public uint MaxWeight { get; set; } // 最大重量(克)
|
public uint MaxWeight { get; set; } // 最大重量(克)
|
||||||
[ProtoMember(7)]
|
[ProtoMember(7)]
|
||||||
public uint Accept { get; set; } // 接受饵
|
public uint Accept { get; set; } // 接受饵
|
||||||
}
|
[ProtoIgnore]
|
||||||
}
|
public uint Key => Id;
|
||||||
|
|
||||||
|
#region Static
|
||||||
|
|
||||||
|
private static ConfigContext<FishConfig> Context => ConfigTableHelper.Table<FishConfig>();
|
||||||
|
|
||||||
|
public static FishConfig Get(uint key)
|
||||||
|
{
|
||||||
|
return Context.Get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FishConfig Get(Predicate<FishConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Get(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FishConfig Fist()
|
||||||
|
{
|
||||||
|
return Context.Fist();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FishConfig Last()
|
||||||
|
{
|
||||||
|
return Context.Last();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FishConfig Fist(Predicate<FishConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Fist(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FishConfig Last(Predicate<FishConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Last(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count()
|
||||||
|
{
|
||||||
|
return Context.Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count(Func<FishConfig, bool> predicate)
|
||||||
|
{
|
||||||
|
return Context.Count(predicate);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<FishConfig> GetList()
|
||||||
|
{
|
||||||
|
return Context.GetList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<FishConfig> GetList(Predicate<FishConfig> match)
|
||||||
|
{
|
||||||
|
return Context.GetList(match);
|
||||||
|
}
|
||||||
|
public static void ParseJson(Newtonsoft.Json.Linq.JArray arr)
|
||||||
|
{
|
||||||
|
ConfigTableHelper.ParseLine<FishConfig>(arr);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,93 +5,15 @@ using System.Linq;
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
#if FANTASY_NET
|
|
||||||
using Fantasy.ConfigTable;
|
|
||||||
using Fantasy.Serialize;
|
|
||||||
#else
|
|
||||||
using NBC;
|
using NBC;
|
||||||
using NBC.Serialize;
|
using NBC.Serialize;
|
||||||
#endif
|
|
||||||
// ReSharper disable CollectionNeverUpdated.Global
|
|
||||||
// ReSharper disable UnusedAutoPropertyAccessor.Global
|
|
||||||
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
|
|
||||||
#pragma warning disable CS0169
|
|
||||||
#pragma warning disable CS8618
|
|
||||||
#pragma warning disable CS8625
|
|
||||||
#pragma warning disable CS8603
|
|
||||||
|
|
||||||
namespace NBF
|
namespace NBF
|
||||||
{
|
{
|
||||||
[ProtoContract]
|
[ProtoContract]
|
||||||
public sealed partial class HookConfigData : ASerialize, IConfigTable, IProto
|
public sealed partial class HookConfig : ASerialize, IProto, IConfigTable
|
||||||
{
|
{
|
||||||
[ProtoMember(1)]
|
|
||||||
public List<HookConfig> List { get; set; } = new List<HookConfig>();
|
|
||||||
#if FANTASY_NET
|
|
||||||
[ProtoIgnore]
|
|
||||||
private readonly ConcurrentDictionary<uint, HookConfig> _configs = new ConcurrentDictionary<uint, HookConfig>();
|
|
||||||
#else
|
|
||||||
[ProtoIgnore]
|
|
||||||
private readonly Dictionary<uint, HookConfig> _configs = new Dictionary<uint, HookConfig>();
|
|
||||||
#endif
|
|
||||||
private static HookConfigData _instance = null;
|
|
||||||
|
|
||||||
public static HookConfigData Instance
|
|
||||||
{
|
|
||||||
get { return _instance ??= ConfigTableHelper.Load<HookConfigData>(); }
|
|
||||||
private set => _instance = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public HookConfig Get(uint id, bool check = true)
|
|
||||||
{
|
|
||||||
if (_configs.ContainsKey(id))
|
|
||||||
{
|
|
||||||
return _configs[id];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (check)
|
|
||||||
{
|
|
||||||
throw new Exception($"HookConfig not find {id} Id");
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
public bool TryGet(uint id, out HookConfig config)
|
|
||||||
{
|
|
||||||
config = null;
|
|
||||||
|
|
||||||
if (!_configs.ContainsKey(id))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
config = _configs[id];
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
public override void AfterDeserialization()
|
|
||||||
{
|
|
||||||
foreach (var config in List)
|
|
||||||
{
|
|
||||||
#if FANTASY_NET
|
|
||||||
_configs.TryAdd(config.Id, config);
|
|
||||||
#else
|
|
||||||
_configs.Add(config.Id, config);
|
|
||||||
#endif
|
|
||||||
config.AfterDeserialization();
|
|
||||||
}
|
|
||||||
|
|
||||||
EndInit();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Dispose()
|
|
||||||
{
|
|
||||||
Instance = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[ProtoContract]
|
|
||||||
public sealed partial class HookConfig : ASerialize, IProto
|
|
||||||
{
|
|
||||||
[ProtoMember(1)]
|
[ProtoMember(1)]
|
||||||
public uint Id { get; set; } // Id
|
public uint Id { get; set; } // Id
|
||||||
[ProtoMember(2)]
|
[ProtoMember(2)]
|
||||||
@@ -104,5 +26,66 @@ namespace NBF
|
|||||||
public uint Length { get; set; } // 长度(毫米)
|
public uint Length { get; set; } // 长度(毫米)
|
||||||
[ProtoMember(6)]
|
[ProtoMember(6)]
|
||||||
public uint Weight { get; set; } // 重量(克)
|
public uint Weight { get; set; } // 重量(克)
|
||||||
}
|
[ProtoIgnore]
|
||||||
}
|
public uint Key => Id;
|
||||||
|
|
||||||
|
#region Static
|
||||||
|
|
||||||
|
private static ConfigContext<HookConfig> Context => ConfigTableHelper.Table<HookConfig>();
|
||||||
|
|
||||||
|
public static HookConfig Get(uint key)
|
||||||
|
{
|
||||||
|
return Context.Get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HookConfig Get(Predicate<HookConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Get(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HookConfig Fist()
|
||||||
|
{
|
||||||
|
return Context.Fist();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HookConfig Last()
|
||||||
|
{
|
||||||
|
return Context.Last();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HookConfig Fist(Predicate<HookConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Fist(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HookConfig Last(Predicate<HookConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Last(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count()
|
||||||
|
{
|
||||||
|
return Context.Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count(Func<HookConfig, bool> predicate)
|
||||||
|
{
|
||||||
|
return Context.Count(predicate);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<HookConfig> GetList()
|
||||||
|
{
|
||||||
|
return Context.GetList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<HookConfig> GetList(Predicate<HookConfig> match)
|
||||||
|
{
|
||||||
|
return Context.GetList(match);
|
||||||
|
}
|
||||||
|
public static void ParseJson(Newtonsoft.Json.Linq.JArray arr)
|
||||||
|
{
|
||||||
|
ConfigTableHelper.ParseLine<HookConfig>(arr);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
85
Assets/Scripts/Generate/Config/InitConfig.cs
Normal file
85
Assets/Scripts/Generate/Config/InitConfig.cs
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
using System;
|
||||||
|
using ProtoBuf;
|
||||||
|
using Fantasy;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using NBC;
|
||||||
|
using NBC.Serialize;
|
||||||
|
|
||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
[ProtoContract]
|
||||||
|
public sealed partial class InitConfig : ASerialize, IProto, IConfigTable
|
||||||
|
{
|
||||||
|
|
||||||
|
[ProtoMember(1)]
|
||||||
|
public uint Id { get; set; } // Id
|
||||||
|
[ProtoMember(2)]
|
||||||
|
public uint ItemId { get; set; } // 物品Id
|
||||||
|
[ProtoMember(3)]
|
||||||
|
public int Amount { get; set; } // 数量
|
||||||
|
[ProtoIgnore]
|
||||||
|
public uint Key => Id;
|
||||||
|
|
||||||
|
#region Static
|
||||||
|
|
||||||
|
private static ConfigContext<InitConfig> Context => ConfigTableHelper.Table<InitConfig>();
|
||||||
|
|
||||||
|
public static InitConfig Get(uint key)
|
||||||
|
{
|
||||||
|
return Context.Get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static InitConfig Get(Predicate<InitConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Get(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static InitConfig Fist()
|
||||||
|
{
|
||||||
|
return Context.Fist();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static InitConfig Last()
|
||||||
|
{
|
||||||
|
return Context.Last();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static InitConfig Fist(Predicate<InitConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Fist(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static InitConfig Last(Predicate<InitConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Last(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count()
|
||||||
|
{
|
||||||
|
return Context.Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count(Func<InitConfig, bool> predicate)
|
||||||
|
{
|
||||||
|
return Context.Count(predicate);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<InitConfig> GetList()
|
||||||
|
{
|
||||||
|
return Context.GetList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<InitConfig> GetList(Predicate<InitConfig> match)
|
||||||
|
{
|
||||||
|
return Context.GetList(match);
|
||||||
|
}
|
||||||
|
public static void ParseJson(Newtonsoft.Json.Linq.JArray arr)
|
||||||
|
{
|
||||||
|
ConfigTableHelper.ParseLine<InitConfig>(arr);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/Generate/Config/InitConfig.cs.meta
Normal file
2
Assets/Scripts/Generate/Config/InitConfig.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4b10beb37dfb5064593be4f13c7a4d29
|
||||||
89
Assets/Scripts/Generate/Config/ItemConfig.cs
Normal file
89
Assets/Scripts/Generate/Config/ItemConfig.cs
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
using System;
|
||||||
|
using ProtoBuf;
|
||||||
|
using Fantasy;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using NBC;
|
||||||
|
using NBC.Serialize;
|
||||||
|
|
||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
[ProtoContract]
|
||||||
|
public sealed partial class ItemConfig : ASerialize, IProto, IConfigTable
|
||||||
|
{
|
||||||
|
|
||||||
|
[ProtoMember(1)]
|
||||||
|
public uint Id { get; set; } // Id
|
||||||
|
[ProtoMember(2)]
|
||||||
|
public string Model { get; set; } // 模型
|
||||||
|
[ProtoMember(3)]
|
||||||
|
public uint Type { get; set; } // 类型
|
||||||
|
[ProtoMember(4)]
|
||||||
|
public uint Max { get; set; } // 最大堆叠数量
|
||||||
|
[ProtoMember(5)]
|
||||||
|
public uint AutoUse { get; set; } // 获得自动使用
|
||||||
|
[ProtoIgnore]
|
||||||
|
public uint Key => Id;
|
||||||
|
|
||||||
|
#region Static
|
||||||
|
|
||||||
|
private static ConfigContext<ItemConfig> Context => ConfigTableHelper.Table<ItemConfig>();
|
||||||
|
|
||||||
|
public static ItemConfig Get(uint key)
|
||||||
|
{
|
||||||
|
return Context.Get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ItemConfig Get(Predicate<ItemConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Get(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ItemConfig Fist()
|
||||||
|
{
|
||||||
|
return Context.Fist();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ItemConfig Last()
|
||||||
|
{
|
||||||
|
return Context.Last();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ItemConfig Fist(Predicate<ItemConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Fist(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ItemConfig Last(Predicate<ItemConfig> match)
|
||||||
|
{
|
||||||
|
return Context.Last(match);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count()
|
||||||
|
{
|
||||||
|
return Context.Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Count(Func<ItemConfig, bool> predicate)
|
||||||
|
{
|
||||||
|
return Context.Count(predicate);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<ItemConfig> GetList()
|
||||||
|
{
|
||||||
|
return Context.GetList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<ItemConfig> GetList(Predicate<ItemConfig> match)
|
||||||
|
{
|
||||||
|
return Context.GetList(match);
|
||||||
|
}
|
||||||
|
public static void ParseJson(Newtonsoft.Json.Linq.JArray arr)
|
||||||
|
{
|
||||||
|
ConfigTableHelper.ParseLine<ItemConfig>(arr);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/Generate/Config/ItemConfig.cs.meta
Normal file
2
Assets/Scripts/Generate/Config/ItemConfig.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ab3487f65cb0c3b458c2ac0a75932642
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user