diff --git a/Assets/Resources/config/ConfigAssets.asset b/Assets/Resources/config/ConfigAssets.asset deleted file mode 100644 index 14bd62c5f..000000000 --- a/Assets/Resources/config/ConfigAssets.asset +++ /dev/null @@ -1,342 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 3d8691ef03f74aedb6cfd67e53cf664f, type: 3} - m_Name: ConfigAssets - m_EditorClassIdentifier: - BaitConfigArr: - - id: 500001 - modelPath: baits/worm_01/worm_01 - group: 0 - type: 0 - acceptFish: - weightFishAccept: {x: 0, y: 3} - weight: 2.5 - lenght: 0 - amount: 1 - Level: 1 - - id: 500002 - modelPath: baits/fly/fly - group: 0 - type: 0 - acceptFish: - weightFishAccept: {x: 0, y: 3} - weight: 2.5 - lenght: 0 - amount: 1 - Level: 1 - - id: 500003 - modelPath: baits/black_leech/black_leech - group: 0 - type: 0 - acceptFish: - weightFishAccept: {x: 0, y: 3} - weight: 2.5 - lenght: 0 - amount: 1 - Level: 1 - - id: 500004 - modelPath: baits/bread/bread - group: 0 - type: 0 - acceptFish: - weightFishAccept: {x: 0, y: 3} - weight: 2.5 - lenght: 0 - amount: 1 - Level: 1 - BobberConfigArr: - - id: 300001 - modelPath: bobbers/expressfishing/bob_25003/bob_25003 - group: 0 - type: 2 - weight: 0.5 - displacement: 3 - isNightLight: 0 - Level: 1 - amount: 1 - - id: 300002 - modelPath: bobbers/expressfishing/bob_25162_25163/bob_25162 - group: 0 - type: 0 - weight: 0.8 - displacement: 3 - isNightLight: 0 - Level: 1 - amount: 1 - - id: 300003 - modelPath: bobbers/expressfishing/bob_25166_25167/bob_25166 - group: 0 - type: 0 - weight: 0.8 - displacement: 3 - isNightLight: 0 - Level: 1 - amount: 1 - - id: 300004 - modelPath: bobbers/expressfishing/bob_25001/bob_25001 - group: 0 - type: 0 - weight: 0.8 - displacement: 3 - isNightLight: 0 - Level: 1 - amount: 1 - FeederConfigArr: - - id: 900001 - modelPath: Feeders/Feeder 1/FeedTrash 1 - group: 0 - type: 0 - weight: 5 - capacity: 100 - Level: 1 - amount: 1 - FishAcceptConfigArr: - - id: 2100001 - bait: 500189 - min: 0.3 - max: 26 - - id: 2100001 - bait: 500135 - min: 0.3 - max: 25 - FishConfigArr: - - id: 2200001 - speciesName: 10 - isEnabled: 1 - type: 0 - maxWeight: 34 - speciesCoins: 4 - rankingPoint: 1 - modelPath: - - Burbot_B - imagePath: [] - modelTrophyPath: [] - weightLenghtValues: [] - weightLengthCurve: - serializedVersion: 2 - m_Curve: [] - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - acceptFishBaits: [] - acceptFishLures: [] - - id: 2200002 - speciesName: 11 - isEnabled: 1 - type: 0 - maxWeight: 40 - speciesCoins: 4 - rankingPoint: 1 - modelPath: - - CarpCommon_B - imagePath: [] - modelTrophyPath: [] - weightLenghtValues: [] - weightLengthCurve: - serializedVersion: 2 - m_Curve: [] - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - acceptFishBaits: [] - acceptFishLures: [] - - id: 2200003 - speciesName: 14 - isEnabled: 1 - type: 0 - maxWeight: 45 - speciesCoins: 4 - rankingPoint: 1 - modelPath: - - CarpGrass_B - imagePath: [] - modelTrophyPath: [] - weightLenghtValues: [] - weightLengthCurve: - serializedVersion: 2 - m_Curve: [] - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - acceptFishBaits: [] - acceptFishLures: [] - - id: 2200004 - speciesName: 16 - isEnabled: 1 - type: 0 - maxWeight: 3 - speciesCoins: 4 - rankingPoint: 1 - modelPath: - - CarpCrucian_B - imagePath: [] - modelTrophyPath: [] - weightLenghtValues: [] - weightLengthCurve: - serializedVersion: 2 - m_Curve: [] - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - acceptFishBaits: [] - acceptFishLures: [] - HookConfigArr: - - id: 700001 - modelPath: hooks/alliance/c_hook_20789_20794/c_hook_20789 - group: 0 - color: Nickel - type: 1 - zadzior: 1 - size: 1 - amount: 1 - Level: 1 - - id: 700102 - modelPath: hooks/berserk_hooks/triple_20569_20577/triple_20569 - group: 0 - color: Nickel - type: 1 - zadzior: 1 - size: 1 - amount: 1 - Level: 1 - LeadersConfigArr: [] - LineConfigArr: - - id: 400001 - modelPath: Lines/UFE Mono/UFE monoClear - group: 0 - type: 0 - length: 75 - strength: 1.51 - size: 0.12 - Level: 1 - - id: 400002 - modelPath: Lines/UFE Mono/UFE monoClear - group: 0 - type: 0 - length: 75 - strength: 2.51 - size: 0.16 - Level: 1 - LureConfigArr: - - id: 600001 - modelPath: lures/express_fishing/crankbaits_1/775/crankbaits_775 - group: 0 - type: 0 - acceptFish: - weightFishAccept: {x: 0, y: 3} - weight: 5.3 - lenght: 80 - amount: 0 - Level: 1 - hook: c6ae0a00 - - id: 600002 - modelPath: lures/express_fishing/poppers_1/poppers_590/poppers_590 - group: 0 - type: 0 - acceptFish: - weightFishAccept: {x: 0, y: 3} - weight: 5.3 - lenght: 80 - amount: 0 - Level: 1 - hook: c6ae0a00 - - id: 600003 - modelPath: lures/express_fishing/softplastic/ef_supergrab_6/softplastic_g_1622 - group: 0 - type: 0 - acceptFish: - weightFishAccept: {x: 0, y: 3} - weight: 5.3 - lenght: 80 - amount: 0 - Level: 1 - hook: - - id: 600004 - modelPath: lures/express_fishing/softplastic/ef_superminnow_6/softplastic_m_1634 - group: 0 - type: 0 - acceptFish: - weightFishAccept: {x: 0, y: 3} - weight: 5.3 - lenght: 80 - amount: 0 - Level: 1 - hook: - ReelConfigArr: - - id: 200001 - modelPath: reels/syberia/spin_5002/spin_5002 - group: 0 - type: 0 - strength: 3 - gearRatio: {x: 6.2, y: 1} - size: 2000 - Level: 1 - - id: 200002 - modelPath: reels/syberia/spin_5036/spin_5036 - group: 0 - type: 0 - strength: 4.5 - gearRatio: {x: 6.2, y: 1} - size: 2000 - Level: 1 - RingConfigArr: - - id: 1100001 - modelPath: rod_rings/rumoi/rumoi_oxiline_spin - group: 0 - - id: 1100002 - modelPath: rod_rings/smt/smt_pure_ceramic_bolo - group: 0 - RodConfigArr: - - id: 100001 - modelPath: rods/syberia/tele_10037/tele_10037_t13 - group: 0 - type: 1 - length: 3,7 - weight: 250 - strength: 40.82 - maxRange: 67 - ring: 0 - - id: 100002 - modelPath: rods/syberia/bolo_10021/bolo_10021_LB400 - group: 0 - type: 0 - length: 2,5 - weight: 120 - strength: 1.59 - maxRange: 30 - ring: 1100002 - - id: 100003 - modelPath: rods/syberia/spin_10034/spin_10034_S60H - group: 0 - type: 0 - length: 2,5 - weight: 120 - strength: 1.59 - maxRange: 30 - ring: 1100001 - UnitConfigArr: - - id: 310001 - Type: 1 - - id: 310002 - Type: 2 - - id: 310003 - Type: 3 - - id: 310004 - Type: 4 - WeightConfigArr: - - id: 800001 - modelPath: Weights/Weight2_5g - group: 0 - type: 0 - weight: 3 - Level: 1 - amount: 1 diff --git a/Assets/Resources/config/ConfigAssets.asset.meta b/Assets/Resources/config/ConfigAssets.asset.meta deleted file mode 100644 index c20ddeaa1..000000000 --- a/Assets/Resources/config/ConfigAssets.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 0921d6ed0762c1b4b9dbc2829bd80546 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Generate/Test/configs.json b/Assets/Resources/config/configs.json similarity index 100% rename from Assets/Scripts/Generate/Test/configs.json rename to Assets/Resources/config/configs.json index 0865fd5c2..e2205386d 100644 --- a/Assets/Scripts/Generate/Test/configs.json +++ b/Assets/Resources/config/configs.json @@ -1,260 +1,4 @@ { - "Unit2Config": [ - { - "Id": 1, - "Name": "Unit01", - "Model": "Unit01" - } - ], - "WeightConfig": [ - { - "Id": 800001, - "Model": "Weights/Weight2_5g", - "Type": 0, - "Weight": 3 - } - ], - "UnitConfig": [ - { - "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" - } - ], - "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 - } - ], - "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 - } - ], - "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 - } - ], - "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 - } - ], - "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 - } - ], - "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 - } - ], - "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 - } - ], - "FeederConfig": [ - { - "Id": 900001, - "Model": "Feeders/Feeder 1/FeedTrash 1", - "Type": 0, - "Capacity": 100, - "Weight": 5 - } - ], "BaitConfig": [ { "Id": 500001, @@ -319,5 +63,261 @@ "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" + } ] } \ No newline at end of file diff --git a/Assets/Scripts/Generate/Test/configs.json.meta b/Assets/Resources/config/configs.json.meta similarity index 75% rename from Assets/Scripts/Generate/Test/configs.json.meta rename to Assets/Resources/config/configs.json.meta index 6c2030bad..d71de4bac 100644 --- a/Assets/Scripts/Generate/Test/configs.json.meta +++ b/Assets/Resources/config/configs.json.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c8b5cb8d32d7bc9438c04720cd8e7bf4 +guid: 0bfd3b5c53a04e544a8ad023bc4942da TextScriptImporter: externalObjects: {} userData: diff --git a/Assets/Scripts/Configs.meta b/Assets/Scripts/Configs.meta deleted file mode 100644 index ad00bf98b..000000000 --- a/Assets/Scripts/Configs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 26c9eac372b5d1c469ec95dc690490be -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Configs/Cache.meta b/Assets/Scripts/Configs/Cache.meta deleted file mode 100644 index 13ca635d5..000000000 --- a/Assets/Scripts/Configs/Cache.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: d89005a134404b88b748787a74946d20 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Configs/Cache/ConfigContext.cs b/Assets/Scripts/Configs/Cache/ConfigContext.cs deleted file mode 100644 index 4c1a3168d..000000000 --- a/Assets/Scripts/Configs/Cache/ConfigContext.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace NBF -{ - public interface IConfigContext - { - // 定义非泛型接口 - } - - public class ConfigContext : IConfigContext where T : ConfigBase - { - private static List _cacheList = new List(); - - #region Cache - - public void Association(List list) - { - if (list != null) - { - _cacheList = list; - } - } - - #endregion - - public int Count() - { - return _cacheList.Count; - } - - public int Count(Func 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 match) - { - return Get(match); - } - - public T Last(Predicate match) - { - return _cacheList.FindLast(match); - } - - public T Get(Predicate match) - { - return _cacheList.Find(match); - } - - public T GetRandom() - { - Random random = new Random(); - // 随机从列表中取一个对象 - return _cacheList[random.Next(_cacheList.Count)]; - } - - public List GetList() - { - return _cacheList; - } - - public List GetList(Predicate match) - { - return _cacheList.FindAll(match); - } - - private T First(int key) - { - return _cacheList.Find(t => t.id == key); - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Cache/ConfigContext.cs.meta b/Assets/Scripts/Configs/Cache/ConfigContext.cs.meta deleted file mode 100644 index d6f758d4c..000000000 --- a/Assets/Scripts/Configs/Cache/ConfigContext.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 82dbb868b2724a85aa866e0bf9e88e91 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Cache/Configs.cs b/Assets/Scripts/Configs/Cache/Configs.cs deleted file mode 100644 index c4610a020..000000000 --- a/Assets/Scripts/Configs/Cache/Configs.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace NBF -{ - public static class Configs - { - private static readonly Dictionary _dictionary = new Dictionary(); - - static Configs() - { - } - - public static ConfigContext Table() where T : ConfigBase - { - var type = typeof(T); - if (_dictionary.TryGetValue(type, out var context)) - { - return context as ConfigContext; - } - - var jsonContext = new ConfigContext(); - _dictionary[type] = jsonContext; - return jsonContext; - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Cache/Configs.cs.meta b/Assets/Scripts/Configs/Cache/Configs.cs.meta deleted file mode 100644 index 161d50cb5..000000000 --- a/Assets/Scripts/Configs/Cache/Configs.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 1881c9eee25240ddbaecbf99546a8750 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Cache/TableNameAttribute.cs b/Assets/Scripts/Configs/Cache/TableNameAttribute.cs deleted file mode 100644 index 9a9676b9a..000000000 --- a/Assets/Scripts/Configs/Cache/TableNameAttribute.cs +++ /dev/null @@ -1,17 +0,0 @@ -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; - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Cache/TableNameAttribute.cs.meta b/Assets/Scripts/Configs/Cache/TableNameAttribute.cs.meta deleted file mode 100644 index 05932f62f..000000000 --- a/Assets/Scripts/Configs/Cache/TableNameAttribute.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 737030131eba4fd6ba6067b47fcae5d3 -timeCreated: 1744862554 \ No newline at end of file diff --git a/Assets/Scripts/Configs/ConfigAssets.Parse.cs b/Assets/Scripts/Configs/ConfigAssets.Parse.cs deleted file mode 100644 index 39efaff89..000000000 --- a/Assets/Scripts/Configs/ConfigAssets.Parse.cs +++ /dev/null @@ -1,68 +0,0 @@ -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 ParseLine(JToken[] arr, TableNameAttribute tableNameAttribute) where T : ConfigBase - { - List list = new List(); - var type = typeof(T); - foreach (var jToken in arr) - { - T instance = null; - try - { - if (CustomType.IsAssignableFrom(type)) //自定义解析 - { - instance = Activator.CreateInstance(); - } - else - { - instance = jToken.ToObject(); - } - } - 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; - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/ConfigAssets.Parse.cs.meta b/Assets/Scripts/Configs/ConfigAssets.Parse.cs.meta deleted file mode 100644 index 221b4caad..000000000 --- a/Assets/Scripts/Configs/ConfigAssets.Parse.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 09494bd809bd47b29be0723c8671afb8 -timeCreated: 1744898106 \ No newline at end of file diff --git a/Assets/Scripts/Configs/ConfigAssets.cs b/Assets/Scripts/Configs/ConfigAssets.cs deleted file mode 100644 index e78d4afef..000000000 --- a/Assets/Scripts/Configs/ConfigAssets.cs +++ /dev/null @@ -1,30 +0,0 @@ -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("config/ConfigAssets"); - if (asset != null) - { - asset.AssociationContexts(); - _inst = asset; - } - - // var assetProvider = NBC.Asset.Assets.LoadAsset(SavePath); - // if (assetProvider != null && assetProvider.Asset is ConfigAssets asset) - // { - // asset.AssociationContexts(); - // _inst = asset; - // } - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/ConfigAssets.cs.meta b/Assets/Scripts/Configs/ConfigAssets.cs.meta deleted file mode 100644 index a3398331b..000000000 --- a/Assets/Scripts/Configs/ConfigAssets.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 3d8691ef03f74aedb6cfd67e53cf664f -timeCreated: 1742999693 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Editor.meta b/Assets/Scripts/Configs/Editor.meta deleted file mode 100644 index 7d23eff71..000000000 --- a/Assets/Scripts/Configs/Editor.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 2178333fb882410eb05c0f66a95c8880 -timeCreated: 1742998269 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Editor/CfgEditorUtil.cs b/Assets/Scripts/Configs/Editor/CfgEditorUtil.cs deleted file mode 100644 index e7f116f82..000000000 --- a/Assets/Scripts/Configs/Editor/CfgEditorUtil.cs +++ /dev/null @@ -1,197 +0,0 @@ -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.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(); - Dictionary tableNameAttributes = new Dictionary(); - 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 tableNameAttributes) - { - // return true; - string filePath = Path.Combine(Application.dataPath, $"{GenPath}/Warps"); - if (!Directory.Exists(filePath)) return true; - var files = Directory.GetFiles(filePath); - List allFileName = new List(); - 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 tableNameAttributes) - { - // 为何使用生成式,不使用static静态泛型 ? 生成式扩展更强且不会破坏原类的集成结构,父类也不用是泛型类 - //否则比如 BaseConfig 类型来使用。集成结构会受很大限制,反而没有生成式来的灵活 - - 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 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();"); - 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 - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Editor/CfgEditorUtil.cs.meta b/Assets/Scripts/Configs/Editor/CfgEditorUtil.cs.meta deleted file mode 100644 index 7c99811e6..000000000 --- a/Assets/Scripts/Configs/Editor/CfgEditorUtil.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 5bc0ac74b225496da64195b28ce14cb2 -timeCreated: 1742998279 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Editor/CodeWriter.cs b/Assets/Scripts/Configs/Editor/CodeWriter.cs deleted file mode 100644 index c7b2365de..000000000 --- a/Assets/Scripts/Configs/Editor/CodeWriter.cs +++ /dev/null @@ -1,105 +0,0 @@ -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 - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Editor/CodeWriter.cs.meta b/Assets/Scripts/Configs/Editor/CodeWriter.cs.meta deleted file mode 100644 index d0d64bd8b..000000000 --- a/Assets/Scripts/Configs/Editor/CodeWriter.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: cf1ac73cd67e4bdc9de1a53a13f5b841 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Editor/ConfigWarpTemplate b/Assets/Scripts/Configs/Editor/ConfigWarpTemplate deleted file mode 100644 index 51681f4f0..000000000 --- a/Assets/Scripts/Configs/Editor/ConfigWarpTemplate +++ /dev/null @@ -1,65 +0,0 @@ -/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/ -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); - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Editor/ConfigWarpTemplate.meta b/Assets/Scripts/Configs/Editor/ConfigWarpTemplate.meta deleted file mode 100644 index fc3837842..000000000 --- a/Assets/Scripts/Configs/Editor/ConfigWarpTemplate.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 4b77eee728204f26bc602016c4a20c86 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Configs/Extemds.meta b/Assets/Scripts/Configs/Extemds.meta deleted file mode 100644 index d674680a6..000000000 --- a/Assets/Scripts/Configs/Extemds.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: b8a50bb33d07439e9c7762e17bced2e0 -timeCreated: 1744862665 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Extemds/JTokenExtends.cs b/Assets/Scripts/Configs/Extemds/JTokenExtends.cs deleted file mode 100644 index e0b24a635..000000000 --- a/Assets/Scripts/Configs/Extemds/JTokenExtends.cs +++ /dev/null @@ -1,138 +0,0 @@ -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(this JToken token, string split = ",") where T : IConvertible - { - if (token is JArray array) - { - return array.ToObject(); - } - - if (token != null) - { - var str = token.ToString(); - if (string.IsNullOrWhiteSpace(str)) return Array.Empty(); - - 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(); - } - - 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 ToList(this JToken token, string split = ",") where T : IConvertible - { - if (token is JArray array) - { - return array.ToObject>(); - } - - if (token != null) - { - var str = token.ToString(); - if (string.IsNullOrWhiteSpace(str)) return new List(); - var arr = str.Split(split); - return arr.Select( - a => string.IsNullOrWhiteSpace(a) ? default : (T)Convert.ChangeType(a, typeof(T))).ToList(); - } - - return new List(); - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Extemds/JTokenExtends.cs.meta b/Assets/Scripts/Configs/Extemds/JTokenExtends.cs.meta deleted file mode 100644 index 89797cceb..000000000 --- a/Assets/Scripts/Configs/Extemds/JTokenExtends.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 3d6ce3cc850f41b8ba83653660b928ce -timeCreated: 1744862670 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen.meta b/Assets/Scripts/Configs/Gen.meta deleted file mode 100644 index 0dc52f34e..000000000 --- a/Assets/Scripts/Configs/Gen.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 0eceaba126fb407583191d01e32bb735 -timeCreated: 1756050728 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/ConfigAssets.Gen.cs b/Assets/Scripts/Configs/Gen/ConfigAssets.Gen.cs deleted file mode 100644 index 63afd189c..000000000 --- a/Assets/Scripts/Configs/Gen/ConfigAssets.Gen.cs +++ /dev/null @@ -1,122 +0,0 @@ -/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/ - -using System; -using System.Collections.Generic; -using System.Reflection; -using Newtonsoft.Json.Linq; -using UnityEngine; - -namespace NBF -{ - public partial class ConfigAssets - { - public List BaitConfigArr; - public List BobberConfigArr; - public List FeederConfigArr; - public List FishAcceptConfigArr; - public List FishConfigArr; - public List HookConfigArr; - public List LeadersConfigArr; - public List LineConfigArr; - public List LureConfigArr; - public List ReelConfigArr; - public List RingConfigArr; - public List RodConfigArr; - public List UnitConfigArr; - public List WeightConfigArr; - - public void Parse(JToken[] arr, Type type) - { - var tableNameAttribute = type.GetCustomAttribute(); - if (tableNameAttribute == null) return; - if (type == typeof(BaitConfig)) - { - BaitConfigArr = ParseLine(arr, tableNameAttribute); - } - - if (type == typeof(BobberConfig)) - { - BobberConfigArr = ParseLine(arr, tableNameAttribute); - } - - if (type == typeof(FeederConfig)) - { - FeederConfigArr = ParseLine(arr, tableNameAttribute); - } - - if (type == typeof(FishAcceptConfig)) - { - FishAcceptConfigArr = ParseLine(arr, tableNameAttribute); - } - - if (type == typeof(FishConfig)) - { - FishConfigArr = ParseLine(arr, tableNameAttribute); - } - - if (type == typeof(HookConfig)) - { - HookConfigArr = ParseLine(arr, tableNameAttribute); - } - - if (type == typeof(LeadersConfig)) - { - LeadersConfigArr = ParseLine(arr, tableNameAttribute); - } - - if (type == typeof(LineConfig)) - { - LineConfigArr = ParseLine(arr, tableNameAttribute); - } - - if (type == typeof(LureConfig)) - { - LureConfigArr = ParseLine(arr, tableNameAttribute); - } - - if (type == typeof(ReelConfig)) - { - ReelConfigArr = ParseLine(arr, tableNameAttribute); - } - - if (type == typeof(RingConfig)) - { - RingConfigArr = ParseLine(arr, tableNameAttribute); - } - - if (type == typeof(RodConfig)) - { - RodConfigArr = ParseLine(arr, tableNameAttribute); - } - - if (type == typeof(UnitConfig)) - { - UnitConfigArr = ParseLine(arr, tableNameAttribute); - } - - if (type == typeof(WeightConfig)) - { - WeightConfigArr = ParseLine(arr, tableNameAttribute); - } - - } - - public void AssociationContexts() - { - new ConfigContext().Association(BaitConfigArr); - new ConfigContext().Association(BobberConfigArr); - new ConfigContext().Association(FeederConfigArr); - new ConfigContext().Association(FishAcceptConfigArr); - new ConfigContext().Association(FishConfigArr); - new ConfigContext().Association(HookConfigArr); - new ConfigContext().Association(LeadersConfigArr); - new ConfigContext().Association(LineConfigArr); - new ConfigContext().Association(LureConfigArr); - new ConfigContext().Association(ReelConfigArr); - new ConfigContext().Association(RingConfigArr); - new ConfigContext().Association(RodConfigArr); - new ConfigContext().Association(UnitConfigArr); - new ConfigContext().Association(WeightConfigArr); - } - } -} diff --git a/Assets/Scripts/Configs/Gen/ConfigAssets.Gen.cs.meta b/Assets/Scripts/Configs/Gen/ConfigAssets.Gen.cs.meta deleted file mode 100644 index ed730e0fd..000000000 --- a/Assets/Scripts/Configs/Gen/ConfigAssets.Gen.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: bd9bbc8f86e64a928533f493e39813ed \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/Warps.meta b/Assets/Scripts/Configs/Gen/Warps.meta deleted file mode 100644 index 15944082b..000000000 --- a/Assets/Scripts/Configs/Gen/Warps.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 98e70a75b52b4728aec1e5b7f506695c -timeCreated: 1756050753 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/Warps/BaitConfigWarp.cs b/Assets/Scripts/Configs/Gen/Warps/BaitConfigWarp.cs deleted file mode 100644 index 78fbf6fbf..000000000 --- a/Assets/Scripts/Configs/Gen/Warps/BaitConfigWarp.cs +++ /dev/null @@ -1,65 +0,0 @@ -/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/ -using System; -using System.Collections.Generic; - -namespace NBF -{ - [Serializable] - public partial class BaitConfig - { - private static ConfigContext _context; - - private static ConfigContext Context => _context ??= Configs.Table(); - - public static BaitConfig Get(int key) - { - return Context.Get(key); - } - - public static BaitConfig Get(Predicate match) - { - return Context.Get(match); - } - - public static BaitConfig Fist() - { - return Context.Fist(); - } - - public static BaitConfig Last() - { - return Context.Last(); - } - - public static BaitConfig Fist(Predicate match) - { - return Context.Fist(match); - } - - public static BaitConfig Last(Predicate match) - { - return Context.Last(match); - } - - public static int Count() - { - return Context.Count(); - } - - public static int Count(Func predicate) - { - return Context.Count(predicate); - } - - - public static List GetList() - { - return Context.GetList(); - } - - public static List GetList(Predicate match) - { - return Context.GetList(match); - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/Warps/BaitConfigWarp.cs.meta b/Assets/Scripts/Configs/Gen/Warps/BaitConfigWarp.cs.meta deleted file mode 100644 index 62c32df08..000000000 --- a/Assets/Scripts/Configs/Gen/Warps/BaitConfigWarp.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 5c6bdb0bae4da2a4da6aacaf58a1abc0 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/Warps/BobberConfigWarp.cs b/Assets/Scripts/Configs/Gen/Warps/BobberConfigWarp.cs deleted file mode 100644 index b6d3fac39..000000000 --- a/Assets/Scripts/Configs/Gen/Warps/BobberConfigWarp.cs +++ /dev/null @@ -1,65 +0,0 @@ -/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/ -using System; -using System.Collections.Generic; - -namespace NBF -{ - [Serializable] - public partial class BobberConfig - { - private static ConfigContext _context; - - private static ConfigContext Context => _context ??= Configs.Table(); - - public static BobberConfig Get(int key) - { - return Context.Get(key); - } - - public static BobberConfig Get(Predicate match) - { - return Context.Get(match); - } - - public static BobberConfig Fist() - { - return Context.Fist(); - } - - public static BobberConfig Last() - { - return Context.Last(); - } - - public static BobberConfig Fist(Predicate match) - { - return Context.Fist(match); - } - - public static BobberConfig Last(Predicate match) - { - return Context.Last(match); - } - - public static int Count() - { - return Context.Count(); - } - - public static int Count(Func predicate) - { - return Context.Count(predicate); - } - - - public static List GetList() - { - return Context.GetList(); - } - - public static List GetList(Predicate match) - { - return Context.GetList(match); - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/Warps/BobberConfigWarp.cs.meta b/Assets/Scripts/Configs/Gen/Warps/BobberConfigWarp.cs.meta deleted file mode 100644 index 53cac01ed..000000000 --- a/Assets/Scripts/Configs/Gen/Warps/BobberConfigWarp.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 99b64c24f2bad454086ac41dd6aa7ffc \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/Warps/FeederConfigWarp.cs b/Assets/Scripts/Configs/Gen/Warps/FeederConfigWarp.cs deleted file mode 100644 index bb2f54b52..000000000 --- a/Assets/Scripts/Configs/Gen/Warps/FeederConfigWarp.cs +++ /dev/null @@ -1,65 +0,0 @@ -/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/ -using System; -using System.Collections.Generic; - -namespace NBF -{ - [Serializable] - public partial class FeederConfig - { - private static ConfigContext _context; - - private static ConfigContext Context => _context ??= Configs.Table(); - - public static FeederConfig Get(int key) - { - return Context.Get(key); - } - - public static FeederConfig Get(Predicate match) - { - return Context.Get(match); - } - - public static FeederConfig Fist() - { - return Context.Fist(); - } - - public static FeederConfig Last() - { - return Context.Last(); - } - - public static FeederConfig Fist(Predicate match) - { - return Context.Fist(match); - } - - public static FeederConfig Last(Predicate match) - { - return Context.Last(match); - } - - public static int Count() - { - return Context.Count(); - } - - public static int Count(Func predicate) - { - return Context.Count(predicate); - } - - - public static List GetList() - { - return Context.GetList(); - } - - public static List GetList(Predicate match) - { - return Context.GetList(match); - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/Warps/FeederConfigWarp.cs.meta b/Assets/Scripts/Configs/Gen/Warps/FeederConfigWarp.cs.meta deleted file mode 100644 index 8bd74b4f9..000000000 --- a/Assets/Scripts/Configs/Gen/Warps/FeederConfigWarp.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: dc082eda2a5880148843ce9c21ed4eed \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/Warps/FishAcceptConfigWarp.cs b/Assets/Scripts/Configs/Gen/Warps/FishAcceptConfigWarp.cs deleted file mode 100644 index b8081592e..000000000 --- a/Assets/Scripts/Configs/Gen/Warps/FishAcceptConfigWarp.cs +++ /dev/null @@ -1,65 +0,0 @@ -/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/ -using System; -using System.Collections.Generic; - -namespace NBF -{ - [Serializable] - public partial class FishAcceptConfig - { - private static ConfigContext _context; - - private static ConfigContext Context => _context ??= Configs.Table(); - - public static FishAcceptConfig Get(int key) - { - return Context.Get(key); - } - - public static FishAcceptConfig Get(Predicate match) - { - return Context.Get(match); - } - - public static FishAcceptConfig Fist() - { - return Context.Fist(); - } - - public static FishAcceptConfig Last() - { - return Context.Last(); - } - - public static FishAcceptConfig Fist(Predicate match) - { - return Context.Fist(match); - } - - public static FishAcceptConfig Last(Predicate match) - { - return Context.Last(match); - } - - public static int Count() - { - return Context.Count(); - } - - public static int Count(Func predicate) - { - return Context.Count(predicate); - } - - - public static List GetList() - { - return Context.GetList(); - } - - public static List GetList(Predicate match) - { - return Context.GetList(match); - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/Warps/FishAcceptConfigWarp.cs.meta b/Assets/Scripts/Configs/Gen/Warps/FishAcceptConfigWarp.cs.meta deleted file mode 100644 index e06497024..000000000 --- a/Assets/Scripts/Configs/Gen/Warps/FishAcceptConfigWarp.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 23d45122e487d8f439bf063a4df7a4b7 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/Warps/FishConfigWarp.cs b/Assets/Scripts/Configs/Gen/Warps/FishConfigWarp.cs deleted file mode 100644 index 6ea97f0fc..000000000 --- a/Assets/Scripts/Configs/Gen/Warps/FishConfigWarp.cs +++ /dev/null @@ -1,65 +0,0 @@ -/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/ -using System; -using System.Collections.Generic; - -namespace NBF -{ - [Serializable] - public partial class FishConfig - { - private static ConfigContext _context; - - private static ConfigContext Context => _context ??= Configs.Table(); - - public static FishConfig Get(int key) - { - return Context.Get(key); - } - - public static FishConfig Get(Predicate match) - { - return Context.Get(match); - } - - public static FishConfig Fist() - { - return Context.Fist(); - } - - public static FishConfig Last() - { - return Context.Last(); - } - - public static FishConfig Fist(Predicate match) - { - return Context.Fist(match); - } - - public static FishConfig Last(Predicate match) - { - return Context.Last(match); - } - - public static int Count() - { - return Context.Count(); - } - - public static int Count(Func predicate) - { - return Context.Count(predicate); - } - - - public static List GetList() - { - return Context.GetList(); - } - - public static List GetList(Predicate match) - { - return Context.GetList(match); - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/Warps/FishConfigWarp.cs.meta b/Assets/Scripts/Configs/Gen/Warps/FishConfigWarp.cs.meta deleted file mode 100644 index 81486f4f3..000000000 --- a/Assets/Scripts/Configs/Gen/Warps/FishConfigWarp.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: d60d97e94b1432c4e985a5469fd01409 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/Warps/HookConfigWarp.cs b/Assets/Scripts/Configs/Gen/Warps/HookConfigWarp.cs deleted file mode 100644 index c03d22af3..000000000 --- a/Assets/Scripts/Configs/Gen/Warps/HookConfigWarp.cs +++ /dev/null @@ -1,65 +0,0 @@ -/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/ -using System; -using System.Collections.Generic; - -namespace NBF -{ - [Serializable] - public partial class HookConfig - { - private static ConfigContext _context; - - private static ConfigContext Context => _context ??= Configs.Table(); - - public static HookConfig Get(int key) - { - return Context.Get(key); - } - - public static HookConfig Get(Predicate match) - { - return Context.Get(match); - } - - public static HookConfig Fist() - { - return Context.Fist(); - } - - public static HookConfig Last() - { - return Context.Last(); - } - - public static HookConfig Fist(Predicate match) - { - return Context.Fist(match); - } - - public static HookConfig Last(Predicate match) - { - return Context.Last(match); - } - - public static int Count() - { - return Context.Count(); - } - - public static int Count(Func predicate) - { - return Context.Count(predicate); - } - - - public static List GetList() - { - return Context.GetList(); - } - - public static List GetList(Predicate match) - { - return Context.GetList(match); - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/Warps/HookConfigWarp.cs.meta b/Assets/Scripts/Configs/Gen/Warps/HookConfigWarp.cs.meta deleted file mode 100644 index a48eb7900..000000000 --- a/Assets/Scripts/Configs/Gen/Warps/HookConfigWarp.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: fc38b93ab46f1bd4a83f81f1cd3b3e4c \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/Warps/LeadersConfigWarp.cs b/Assets/Scripts/Configs/Gen/Warps/LeadersConfigWarp.cs deleted file mode 100644 index ad4c8a8af..000000000 --- a/Assets/Scripts/Configs/Gen/Warps/LeadersConfigWarp.cs +++ /dev/null @@ -1,65 +0,0 @@ -/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/ -using System; -using System.Collections.Generic; - -namespace NBF -{ - [Serializable] - public partial class LeadersConfig - { - private static ConfigContext _context; - - private static ConfigContext Context => _context ??= Configs.Table(); - - public static LeadersConfig Get(int key) - { - return Context.Get(key); - } - - public static LeadersConfig Get(Predicate match) - { - return Context.Get(match); - } - - public static LeadersConfig Fist() - { - return Context.Fist(); - } - - public static LeadersConfig Last() - { - return Context.Last(); - } - - public static LeadersConfig Fist(Predicate match) - { - return Context.Fist(match); - } - - public static LeadersConfig Last(Predicate match) - { - return Context.Last(match); - } - - public static int Count() - { - return Context.Count(); - } - - public static int Count(Func predicate) - { - return Context.Count(predicate); - } - - - public static List GetList() - { - return Context.GetList(); - } - - public static List GetList(Predicate match) - { - return Context.GetList(match); - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/Warps/LeadersConfigWarp.cs.meta b/Assets/Scripts/Configs/Gen/Warps/LeadersConfigWarp.cs.meta deleted file mode 100644 index f11b68d93..000000000 --- a/Assets/Scripts/Configs/Gen/Warps/LeadersConfigWarp.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 7911fb1cf4470014eadb4d9db5db5861 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/Warps/LineConfigWarp.cs b/Assets/Scripts/Configs/Gen/Warps/LineConfigWarp.cs deleted file mode 100644 index 7ae22d3ab..000000000 --- a/Assets/Scripts/Configs/Gen/Warps/LineConfigWarp.cs +++ /dev/null @@ -1,65 +0,0 @@ -/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/ -using System; -using System.Collections.Generic; - -namespace NBF -{ - [Serializable] - public partial class LineConfig - { - private static ConfigContext _context; - - private static ConfigContext Context => _context ??= Configs.Table(); - - public static LineConfig Get(int key) - { - return Context.Get(key); - } - - public static LineConfig Get(Predicate match) - { - return Context.Get(match); - } - - public static LineConfig Fist() - { - return Context.Fist(); - } - - public static LineConfig Last() - { - return Context.Last(); - } - - public static LineConfig Fist(Predicate match) - { - return Context.Fist(match); - } - - public static LineConfig Last(Predicate match) - { - return Context.Last(match); - } - - public static int Count() - { - return Context.Count(); - } - - public static int Count(Func predicate) - { - return Context.Count(predicate); - } - - - public static List GetList() - { - return Context.GetList(); - } - - public static List GetList(Predicate match) - { - return Context.GetList(match); - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/Warps/LineConfigWarp.cs.meta b/Assets/Scripts/Configs/Gen/Warps/LineConfigWarp.cs.meta deleted file mode 100644 index 48a663dea..000000000 --- a/Assets/Scripts/Configs/Gen/Warps/LineConfigWarp.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 1acb019fe35da324cb5a26e45c54532d \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/Warps/LureConfigWarp.cs b/Assets/Scripts/Configs/Gen/Warps/LureConfigWarp.cs deleted file mode 100644 index e26f0145e..000000000 --- a/Assets/Scripts/Configs/Gen/Warps/LureConfigWarp.cs +++ /dev/null @@ -1,65 +0,0 @@ -/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/ -using System; -using System.Collections.Generic; - -namespace NBF -{ - [Serializable] - public partial class LureConfig - { - private static ConfigContext _context; - - private static ConfigContext Context => _context ??= Configs.Table(); - - public static LureConfig Get(int key) - { - return Context.Get(key); - } - - public static LureConfig Get(Predicate match) - { - return Context.Get(match); - } - - public static LureConfig Fist() - { - return Context.Fist(); - } - - public static LureConfig Last() - { - return Context.Last(); - } - - public static LureConfig Fist(Predicate match) - { - return Context.Fist(match); - } - - public static LureConfig Last(Predicate match) - { - return Context.Last(match); - } - - public static int Count() - { - return Context.Count(); - } - - public static int Count(Func predicate) - { - return Context.Count(predicate); - } - - - public static List GetList() - { - return Context.GetList(); - } - - public static List GetList(Predicate match) - { - return Context.GetList(match); - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/Warps/LureConfigWarp.cs.meta b/Assets/Scripts/Configs/Gen/Warps/LureConfigWarp.cs.meta deleted file mode 100644 index 33df3e2ef..000000000 --- a/Assets/Scripts/Configs/Gen/Warps/LureConfigWarp.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 74aae733a506d0840a1a7cc2623ed5fd \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/Warps/ReelConfigWarp.cs b/Assets/Scripts/Configs/Gen/Warps/ReelConfigWarp.cs deleted file mode 100644 index e7cb60301..000000000 --- a/Assets/Scripts/Configs/Gen/Warps/ReelConfigWarp.cs +++ /dev/null @@ -1,65 +0,0 @@ -/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/ -using System; -using System.Collections.Generic; - -namespace NBF -{ - [Serializable] - public partial class ReelConfig - { - private static ConfigContext _context; - - private static ConfigContext Context => _context ??= Configs.Table(); - - public static ReelConfig Get(int key) - { - return Context.Get(key); - } - - public static ReelConfig Get(Predicate match) - { - return Context.Get(match); - } - - public static ReelConfig Fist() - { - return Context.Fist(); - } - - public static ReelConfig Last() - { - return Context.Last(); - } - - public static ReelConfig Fist(Predicate match) - { - return Context.Fist(match); - } - - public static ReelConfig Last(Predicate match) - { - return Context.Last(match); - } - - public static int Count() - { - return Context.Count(); - } - - public static int Count(Func predicate) - { - return Context.Count(predicate); - } - - - public static List GetList() - { - return Context.GetList(); - } - - public static List GetList(Predicate match) - { - return Context.GetList(match); - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/Warps/ReelConfigWarp.cs.meta b/Assets/Scripts/Configs/Gen/Warps/ReelConfigWarp.cs.meta deleted file mode 100644 index 30120eb5a..000000000 --- a/Assets/Scripts/Configs/Gen/Warps/ReelConfigWarp.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 6bfa9f163eb97be418e04f1f62c607de \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/Warps/RingConfigWarp.cs b/Assets/Scripts/Configs/Gen/Warps/RingConfigWarp.cs deleted file mode 100644 index 209da8dfb..000000000 --- a/Assets/Scripts/Configs/Gen/Warps/RingConfigWarp.cs +++ /dev/null @@ -1,65 +0,0 @@ -/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/ -using System; -using System.Collections.Generic; - -namespace NBF -{ - [Serializable] - public partial class RingConfig - { - private static ConfigContext _context; - - private static ConfigContext Context => _context ??= Configs.Table(); - - public static RingConfig Get(int key) - { - return Context.Get(key); - } - - public static RingConfig Get(Predicate match) - { - return Context.Get(match); - } - - public static RingConfig Fist() - { - return Context.Fist(); - } - - public static RingConfig Last() - { - return Context.Last(); - } - - public static RingConfig Fist(Predicate match) - { - return Context.Fist(match); - } - - public static RingConfig Last(Predicate match) - { - return Context.Last(match); - } - - public static int Count() - { - return Context.Count(); - } - - public static int Count(Func predicate) - { - return Context.Count(predicate); - } - - - public static List GetList() - { - return Context.GetList(); - } - - public static List GetList(Predicate match) - { - return Context.GetList(match); - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/Warps/RingConfigWarp.cs.meta b/Assets/Scripts/Configs/Gen/Warps/RingConfigWarp.cs.meta deleted file mode 100644 index 8a778e233..000000000 --- a/Assets/Scripts/Configs/Gen/Warps/RingConfigWarp.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: a52a98969f4fae44ba19533cb1ae552e \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/Warps/RodConfigWarp.cs b/Assets/Scripts/Configs/Gen/Warps/RodConfigWarp.cs deleted file mode 100644 index 280781968..000000000 --- a/Assets/Scripts/Configs/Gen/Warps/RodConfigWarp.cs +++ /dev/null @@ -1,65 +0,0 @@ -/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/ -using System; -using System.Collections.Generic; - -namespace NBF -{ - [Serializable] - public partial class RodConfig - { - private static ConfigContext _context; - - private static ConfigContext Context => _context ??= Configs.Table(); - - public static RodConfig Get(int key) - { - return Context.Get(key); - } - - public static RodConfig Get(Predicate match) - { - return Context.Get(match); - } - - public static RodConfig Fist() - { - return Context.Fist(); - } - - public static RodConfig Last() - { - return Context.Last(); - } - - public static RodConfig Fist(Predicate match) - { - return Context.Fist(match); - } - - public static RodConfig Last(Predicate match) - { - return Context.Last(match); - } - - public static int Count() - { - return Context.Count(); - } - - public static int Count(Func predicate) - { - return Context.Count(predicate); - } - - - public static List GetList() - { - return Context.GetList(); - } - - public static List GetList(Predicate match) - { - return Context.GetList(match); - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/Warps/RodConfigWarp.cs.meta b/Assets/Scripts/Configs/Gen/Warps/RodConfigWarp.cs.meta deleted file mode 100644 index 33ef28386..000000000 --- a/Assets/Scripts/Configs/Gen/Warps/RodConfigWarp.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 81f057dddf36a734ead19cd98e19a2e0 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/Warps/UnitConfigWarp.cs b/Assets/Scripts/Configs/Gen/Warps/UnitConfigWarp.cs deleted file mode 100644 index 0398f08b0..000000000 --- a/Assets/Scripts/Configs/Gen/Warps/UnitConfigWarp.cs +++ /dev/null @@ -1,65 +0,0 @@ -/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/ -using System; -using System.Collections.Generic; - -namespace NBF -{ - [Serializable] - public partial class UnitConfig - { - private static ConfigContext _context; - - private static ConfigContext Context => _context ??= Configs.Table(); - - public static UnitConfig Get(int key) - { - return Context.Get(key); - } - - public static UnitConfig Get(Predicate match) - { - return Context.Get(match); - } - - public static UnitConfig Fist() - { - return Context.Fist(); - } - - public static UnitConfig Last() - { - return Context.Last(); - } - - public static UnitConfig Fist(Predicate match) - { - return Context.Fist(match); - } - - public static UnitConfig Last(Predicate match) - { - return Context.Last(match); - } - - public static int Count() - { - return Context.Count(); - } - - public static int Count(Func predicate) - { - return Context.Count(predicate); - } - - - public static List GetList() - { - return Context.GetList(); - } - - public static List GetList(Predicate match) - { - return Context.GetList(match); - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/Warps/UnitConfigWarp.cs.meta b/Assets/Scripts/Configs/Gen/Warps/UnitConfigWarp.cs.meta deleted file mode 100644 index a260fdbd8..000000000 --- a/Assets/Scripts/Configs/Gen/Warps/UnitConfigWarp.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 69acf2fddccdd7b4fae3ad883cbc50ec \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/Warps/WeightConfigWarp.cs b/Assets/Scripts/Configs/Gen/Warps/WeightConfigWarp.cs deleted file mode 100644 index 7018eed48..000000000 --- a/Assets/Scripts/Configs/Gen/Warps/WeightConfigWarp.cs +++ /dev/null @@ -1,65 +0,0 @@ -/**本脚本为自动生成,每次生成会覆盖!请勿手动修改**/ -using System; -using System.Collections.Generic; - -namespace NBF -{ - [Serializable] - public partial class WeightConfig - { - private static ConfigContext _context; - - private static ConfigContext Context => _context ??= Configs.Table(); - - public static WeightConfig Get(int key) - { - return Context.Get(key); - } - - public static WeightConfig Get(Predicate match) - { - return Context.Get(match); - } - - public static WeightConfig Fist() - { - return Context.Fist(); - } - - public static WeightConfig Last() - { - return Context.Last(); - } - - public static WeightConfig Fist(Predicate match) - { - return Context.Fist(match); - } - - public static WeightConfig Last(Predicate match) - { - return Context.Last(match); - } - - public static int Count() - { - return Context.Count(); - } - - public static int Count(Func predicate) - { - return Context.Count(predicate); - } - - - public static List GetList() - { - return Context.GetList(); - } - - public static List GetList(Predicate match) - { - return Context.GetList(match); - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Gen/Warps/WeightConfigWarp.cs.meta b/Assets/Scripts/Configs/Gen/Warps/WeightConfigWarp.cs.meta deleted file mode 100644 index a14f49de5..000000000 --- a/Assets/Scripts/Configs/Gen/Warps/WeightConfigWarp.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 43244884876723947bd6574d57b2349c \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem.meta b/Assets/Scripts/Configs/Mem.meta deleted file mode 100644 index 23fea0283..000000000 --- a/Assets/Scripts/Configs/Mem.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 9fbbf78150ef486581fecb379fc3b1cd -timeCreated: 1742998650 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/BaitConfig.cs b/Assets/Scripts/Configs/Mem/BaitConfig.cs deleted file mode 100644 index 36e636948..000000000 --- a/Assets/Scripts/Configs/Mem/BaitConfig.cs +++ /dev/null @@ -1,137 +0,0 @@ -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; - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/BaitConfig.cs.meta b/Assets/Scripts/Configs/Mem/BaitConfig.cs.meta deleted file mode 100644 index 320c10ff7..000000000 --- a/Assets/Scripts/Configs/Mem/BaitConfig.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 29ac65179e8d469d96caa04ce15021d6 -timeCreated: 1742999023 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/BobberConfig.cs b/Assets/Scripts/Configs/Mem/BobberConfig.cs deleted file mode 100644 index 0457d38b6..000000000 --- a/Assets/Scripts/Configs/Mem/BobberConfig.cs +++ /dev/null @@ -1,32 +0,0 @@ -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; - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/BobberConfig.cs.meta b/Assets/Scripts/Configs/Mem/BobberConfig.cs.meta deleted file mode 100644 index af742927d..000000000 --- a/Assets/Scripts/Configs/Mem/BobberConfig.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 6297ba097dac45eb8f14f55dc5ad7d7b -timeCreated: 1742999241 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/CameraCfg.cs b/Assets/Scripts/Configs/Mem/CameraCfg.cs deleted file mode 100644 index f09a3ae5b..000000000 --- a/Assets/Scripts/Configs/Mem/CameraCfg.cs +++ /dev/null @@ -1,68 +0,0 @@ -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; - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/CameraCfg.cs.meta b/Assets/Scripts/Configs/Mem/CameraCfg.cs.meta deleted file mode 100644 index 317f73ee2..000000000 --- a/Assets/Scripts/Configs/Mem/CameraCfg.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 5f43c20e40ae42239e4381c12ad7cc00 -timeCreated: 1756823027 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/ConfigBase.cs b/Assets/Scripts/Configs/Mem/ConfigBase.cs deleted file mode 100644 index 88acd92e0..000000000 --- a/Assets/Scripts/Configs/Mem/ConfigBase.cs +++ /dev/null @@ -1,51 +0,0 @@ -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 int id; - } - - public abstract class ConfigGearBase : ConfigBase - { - public string modelPath = "Models/Rods/"; - - protected virtual string ModelRoot => "gfx/"; - - /// - /// 所属的组 - /// - 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); - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/ConfigBase.cs.meta b/Assets/Scripts/Configs/Mem/ConfigBase.cs.meta deleted file mode 100644 index c41648f0c..000000000 --- a/Assets/Scripts/Configs/Mem/ConfigBase.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: bfb754c68ea2417685d3e29804c996fa -timeCreated: 1742998658 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/FeederConfig.cs b/Assets/Scripts/Configs/Mem/FeederConfig.cs deleted file mode 100644 index ca386fad3..000000000 --- a/Assets/Scripts/Configs/Mem/FeederConfig.cs +++ /dev/null @@ -1,25 +0,0 @@ -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; - - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/FeederConfig.cs.meta b/Assets/Scripts/Configs/Mem/FeederConfig.cs.meta deleted file mode 100644 index fb7067d21..000000000 --- a/Assets/Scripts/Configs/Mem/FeederConfig.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 4a3acf5935cc49be8a1e655250ea28e9 -timeCreated: 1742999291 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/FishAcceptConfig.cs b/Assets/Scripts/Configs/Mem/FishAcceptConfig.cs deleted file mode 100644 index 9b26f1d60..000000000 --- a/Assets/Scripts/Configs/Mem/FishAcceptConfig.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace NBF -{ - [TableName("gameFishAccepts")] - public partial class FishAcceptConfig : ConfigBase - { - public int bait; - - public float min; - - public float max; - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/FishAcceptConfig.cs.meta b/Assets/Scripts/Configs/Mem/FishAcceptConfig.cs.meta deleted file mode 100644 index f6ec8cb3e..000000000 --- a/Assets/Scripts/Configs/Mem/FishAcceptConfig.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 315e92a457a44e67a23cc79710bebdb6 -timeCreated: 1744862496 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/FishConfig.cs b/Assets/Scripts/Configs/Mem/FishConfig.cs deleted file mode 100644 index 56470fffc..000000000 --- a/Assets/Scripts/Configs/Mem/FishConfig.cs +++ /dev/null @@ -1,134 +0,0 @@ -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 acceptFishBaits; - - public List acceptFishLures; - - public Sprite GetIconImage(int index) - { - return Resources.Load("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]); - } - - - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/FishConfig.cs.meta b/Assets/Scripts/Configs/Mem/FishConfig.cs.meta deleted file mode 100644 index 74a9d502f..000000000 --- a/Assets/Scripts/Configs/Mem/FishConfig.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 036e4898008747fda0a473707565667b -timeCreated: 1742999445 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/HookConfig.cs b/Assets/Scripts/Configs/Mem/HookConfig.cs deleted file mode 100644 index 1c340ab28..000000000 --- a/Assets/Scripts/Configs/Mem/HookConfig.cs +++ /dev/null @@ -1,167 +0,0 @@ -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; - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/HookConfig.cs.meta b/Assets/Scripts/Configs/Mem/HookConfig.cs.meta deleted file mode 100644 index b67ac5c11..000000000 --- a/Assets/Scripts/Configs/Mem/HookConfig.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 163f314510a24a43b7f86e22854cde3b -timeCreated: 1742999185 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/LeadersConfig.cs b/Assets/Scripts/Configs/Mem/LeadersConfig.cs deleted file mode 100644 index 6123c5244..000000000 --- a/Assets/Scripts/Configs/Mem/LeadersConfig.cs +++ /dev/null @@ -1,19 +0,0 @@ -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; - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/LeadersConfig.cs.meta b/Assets/Scripts/Configs/Mem/LeadersConfig.cs.meta deleted file mode 100644 index 196a20750..000000000 --- a/Assets/Scripts/Configs/Mem/LeadersConfig.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 4a5ae0258ce84be1b6b2c2cb6a9921f9 -timeCreated: 1742998962 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/LineConfig.cs b/Assets/Scripts/Configs/Mem/LineConfig.cs deleted file mode 100644 index 747a5b153..000000000 --- a/Assets/Scripts/Configs/Mem/LineConfig.cs +++ /dev/null @@ -1,28 +0,0 @@ -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; - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/LineConfig.cs.meta b/Assets/Scripts/Configs/Mem/LineConfig.cs.meta deleted file mode 100644 index dbda52553..000000000 --- a/Assets/Scripts/Configs/Mem/LineConfig.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 8f09d37212e24ee2bb9f0b99ca69df42 -timeCreated: 1742998906 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/LureConfig.cs b/Assets/Scripts/Configs/Mem/LureConfig.cs deleted file mode 100644 index 9a2b891da..000000000 --- a/Assets/Scripts/Configs/Mem/LureConfig.cs +++ /dev/null @@ -1,123 +0,0 @@ -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; - - /// - /// 配的鱼钩 - /// - 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; - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/LureConfig.cs.meta b/Assets/Scripts/Configs/Mem/LureConfig.cs.meta deleted file mode 100644 index 2ce12e541..000000000 --- a/Assets/Scripts/Configs/Mem/LureConfig.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 184995816e1944d2afc02384ef109693 -timeCreated: 1744898827 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/ReelConfig.cs b/Assets/Scripts/Configs/Mem/ReelConfig.cs deleted file mode 100644 index dab4e3b4e..000000000 --- a/Assets/Scripts/Configs/Mem/ReelConfig.cs +++ /dev/null @@ -1,30 +0,0 @@ -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; - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/ReelConfig.cs.meta b/Assets/Scripts/Configs/Mem/ReelConfig.cs.meta deleted file mode 100644 index 4f2cc54bc..000000000 --- a/Assets/Scripts/Configs/Mem/ReelConfig.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 13045659d27f4ee89aab30efb1740215 -timeCreated: 1742998847 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/RingConfig.cs b/Assets/Scripts/Configs/Mem/RingConfig.cs deleted file mode 100644 index f29cdfdb0..000000000 --- a/Assets/Scripts/Configs/Mem/RingConfig.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace NBF -{ - [TableName("gameRings")] - public partial class RingConfig : ConfigGearBase - { - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/RingConfig.cs.meta b/Assets/Scripts/Configs/Mem/RingConfig.cs.meta deleted file mode 100644 index 6d96a2839..000000000 --- a/Assets/Scripts/Configs/Mem/RingConfig.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 15f2ba6ac6404e9390d9cc2604f2016c -timeCreated: 1744861381 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/RodConfig.cs b/Assets/Scripts/Configs/Mem/RodConfig.cs deleted file mode 100644 index 15e8976cb..000000000 --- a/Assets/Scripts/Configs/Mem/RodConfig.cs +++ /dev/null @@ -1,41 +0,0 @@ -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; - - /// - /// 使用的圈id - /// - public int ring; - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/RodConfig.cs.meta b/Assets/Scripts/Configs/Mem/RodConfig.cs.meta deleted file mode 100644 index 7a1790a48..000000000 --- a/Assets/Scripts/Configs/Mem/RodConfig.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 01b7a315690b4a2d8f82aec56a3a3971 -timeCreated: 1742998702 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/UnitConfig.cs b/Assets/Scripts/Configs/Mem/UnitConfig.cs deleted file mode 100644 index 7a39846f7..000000000 --- a/Assets/Scripts/Configs/Mem/UnitConfig.cs +++ /dev/null @@ -1,31 +0,0 @@ -namespace NBF -{ - [TableName("gameUnit")] - public partial class UnitConfig : ConfigBase - { - public UnitType Type; - } - - public enum UnitType : byte - { - /// - /// 玩家 - /// - Player = 1, - - /// - /// 鱼 - /// - Fish = 2, - - /// - /// 船 - /// - Boat = 3, - - /// - /// 车 - /// - Car = 4, - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/UnitConfig.cs.meta b/Assets/Scripts/Configs/Mem/UnitConfig.cs.meta deleted file mode 100644 index daa9722a3..000000000 --- a/Assets/Scripts/Configs/Mem/UnitConfig.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 956ed7b067744c369fcff9a8baef77ee -timeCreated: 1756049614 \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/WeightConfig.cs b/Assets/Scripts/Configs/Mem/WeightConfig.cs deleted file mode 100644 index 8d769f975..000000000 --- a/Assets/Scripts/Configs/Mem/WeightConfig.cs +++ /dev/null @@ -1,26 +0,0 @@ -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; - } -} \ No newline at end of file diff --git a/Assets/Scripts/Configs/Mem/WeightConfig.cs.meta b/Assets/Scripts/Configs/Mem/WeightConfig.cs.meta deleted file mode 100644 index 113ec42c7..000000000 --- a/Assets/Scripts/Configs/Mem/WeightConfig.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 6bfe88a3b2474031aa65c995baebf6f6 -timeCreated: 1742999355 \ No newline at end of file diff --git a/Assets/Scripts/Generate/Test.meta b/Assets/Scripts/Generate/Config.meta similarity index 77% rename from Assets/Scripts/Generate/Test.meta rename to Assets/Scripts/Generate/Config.meta index 756c07270..ceec2258d 100644 --- a/Assets/Scripts/Generate/Test.meta +++ b/Assets/Scripts/Generate/Config.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 797250a29ac28db458a11e40145a9e6c +guid: 13431063251342f40a7e27cd403bf79b folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Scripts/Generate/Test/BaitConfig.cs b/Assets/Scripts/Generate/Config/BaitConfig.cs similarity index 99% rename from Assets/Scripts/Generate/Test/BaitConfig.cs rename to Assets/Scripts/Generate/Config/BaitConfig.cs index e5c681acb..612b61cc7 100644 --- a/Assets/Scripts/Generate/Test/BaitConfig.cs +++ b/Assets/Scripts/Generate/Config/BaitConfig.cs @@ -20,7 +20,7 @@ using NBC.Serialize; #pragma warning disable CS8625 #pragma warning disable CS8603 -namespace Fantasy +namespace NBF { [ProtoContract] public sealed partial class BaitConfigData : ASerialize, IConfigTable, IProto diff --git a/Assets/Scripts/Generate/Config/BaitConfig.cs.meta b/Assets/Scripts/Generate/Config/BaitConfig.cs.meta new file mode 100644 index 000000000..a3c7f4976 --- /dev/null +++ b/Assets/Scripts/Generate/Config/BaitConfig.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 606b570b0b5860049a7c04db0184bf73 \ No newline at end of file diff --git a/Assets/Scripts/Generate/Test/BobberConfig.cs b/Assets/Scripts/Generate/Config/BobberConfig.cs similarity index 99% rename from Assets/Scripts/Generate/Test/BobberConfig.cs rename to Assets/Scripts/Generate/Config/BobberConfig.cs index 4db4bb1a8..b26f33a49 100644 --- a/Assets/Scripts/Generate/Test/BobberConfig.cs +++ b/Assets/Scripts/Generate/Config/BobberConfig.cs @@ -20,7 +20,7 @@ using NBC.Serialize; #pragma warning disable CS8625 #pragma warning disable CS8603 -namespace Fantasy +namespace NBF { [ProtoContract] public sealed partial class BobberConfigData : ASerialize, IConfigTable, IProto diff --git a/Assets/Scripts/Generate/Config/BobberConfig.cs.meta b/Assets/Scripts/Generate/Config/BobberConfig.cs.meta new file mode 100644 index 000000000..62b9b8fa2 --- /dev/null +++ b/Assets/Scripts/Generate/Config/BobberConfig.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: ed66bec4f9191494db6d22d54034c86d \ No newline at end of file diff --git a/Assets/Scripts/Generate/Test/FeederConfig.cs b/Assets/Scripts/Generate/Config/FeederConfig.cs similarity index 99% rename from Assets/Scripts/Generate/Test/FeederConfig.cs rename to Assets/Scripts/Generate/Config/FeederConfig.cs index 897498881..dfc491e21 100644 --- a/Assets/Scripts/Generate/Test/FeederConfig.cs +++ b/Assets/Scripts/Generate/Config/FeederConfig.cs @@ -20,7 +20,7 @@ using NBC.Serialize; #pragma warning disable CS8625 #pragma warning disable CS8603 -namespace Fantasy +namespace NBF { [ProtoContract] public sealed partial class FeederConfigData : ASerialize, IConfigTable, IProto diff --git a/Assets/Scripts/Generate/Config/FeederConfig.cs.meta b/Assets/Scripts/Generate/Config/FeederConfig.cs.meta new file mode 100644 index 000000000..5497f14f3 --- /dev/null +++ b/Assets/Scripts/Generate/Config/FeederConfig.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 3f5cf9ae363b3bc46adb0ff67f428f25 \ No newline at end of file diff --git a/Assets/Scripts/Generate/Test/FishConfig.cs b/Assets/Scripts/Generate/Config/FishConfig.cs similarity index 99% rename from Assets/Scripts/Generate/Test/FishConfig.cs rename to Assets/Scripts/Generate/Config/FishConfig.cs index a213df6d1..a221dfd04 100644 --- a/Assets/Scripts/Generate/Test/FishConfig.cs +++ b/Assets/Scripts/Generate/Config/FishConfig.cs @@ -20,7 +20,7 @@ using NBC.Serialize; #pragma warning disable CS8625 #pragma warning disable CS8603 -namespace Fantasy +namespace NBF { [ProtoContract] public sealed partial class FishConfigData : ASerialize, IConfigTable, IProto diff --git a/Assets/Scripts/Generate/Config/FishConfig.cs.meta b/Assets/Scripts/Generate/Config/FishConfig.cs.meta new file mode 100644 index 000000000..778cf69d5 --- /dev/null +++ b/Assets/Scripts/Generate/Config/FishConfig.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: eba786f9f11680b4e949810278d7212f \ No newline at end of file diff --git a/Assets/Scripts/Generate/Test/HookConfig.cs b/Assets/Scripts/Generate/Config/HookConfig.cs similarity index 99% rename from Assets/Scripts/Generate/Test/HookConfig.cs rename to Assets/Scripts/Generate/Config/HookConfig.cs index 7e27914be..e523a7021 100644 --- a/Assets/Scripts/Generate/Test/HookConfig.cs +++ b/Assets/Scripts/Generate/Config/HookConfig.cs @@ -20,7 +20,7 @@ using NBC.Serialize; #pragma warning disable CS8625 #pragma warning disable CS8603 -namespace Fantasy +namespace NBF { [ProtoContract] public sealed partial class HookConfigData : ASerialize, IConfigTable, IProto diff --git a/Assets/Scripts/Generate/Config/HookConfig.cs.meta b/Assets/Scripts/Generate/Config/HookConfig.cs.meta new file mode 100644 index 000000000..e78be69d2 --- /dev/null +++ b/Assets/Scripts/Generate/Config/HookConfig.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 641a11a91af45d74ea51fae44648611d \ No newline at end of file diff --git a/Assets/Scripts/Generate/Test/LineConfig.cs b/Assets/Scripts/Generate/Config/LineConfig.cs similarity index 99% rename from Assets/Scripts/Generate/Test/LineConfig.cs rename to Assets/Scripts/Generate/Config/LineConfig.cs index 600506467..5a13c7ea7 100644 --- a/Assets/Scripts/Generate/Test/LineConfig.cs +++ b/Assets/Scripts/Generate/Config/LineConfig.cs @@ -20,7 +20,7 @@ using NBC.Serialize; #pragma warning disable CS8625 #pragma warning disable CS8603 -namespace Fantasy +namespace NBF { [ProtoContract] public sealed partial class LineConfigData : ASerialize, IConfigTable, IProto diff --git a/Assets/Scripts/Generate/Config/LineConfig.cs.meta b/Assets/Scripts/Generate/Config/LineConfig.cs.meta new file mode 100644 index 000000000..ddb9e5fca --- /dev/null +++ b/Assets/Scripts/Generate/Config/LineConfig.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 2418acc87651b9548a804668c2e28306 \ No newline at end of file diff --git a/Assets/Scripts/Generate/Test/LureConfig.cs b/Assets/Scripts/Generate/Config/LureConfig.cs similarity index 99% rename from Assets/Scripts/Generate/Test/LureConfig.cs rename to Assets/Scripts/Generate/Config/LureConfig.cs index 72fa04639..e9feda92f 100644 --- a/Assets/Scripts/Generate/Test/LureConfig.cs +++ b/Assets/Scripts/Generate/Config/LureConfig.cs @@ -20,7 +20,7 @@ using NBC.Serialize; #pragma warning disable CS8625 #pragma warning disable CS8603 -namespace Fantasy +namespace NBF { [ProtoContract] public sealed partial class LureConfigData : ASerialize, IConfigTable, IProto diff --git a/Assets/Scripts/Generate/Config/LureConfig.cs.meta b/Assets/Scripts/Generate/Config/LureConfig.cs.meta new file mode 100644 index 000000000..87b496cfb --- /dev/null +++ b/Assets/Scripts/Generate/Config/LureConfig.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: ef6c35038bac3ae49aced8e616a8424b \ No newline at end of file diff --git a/Assets/Scripts/Generate/Test/ReelConfig.cs b/Assets/Scripts/Generate/Config/ReelConfig.cs similarity index 99% rename from Assets/Scripts/Generate/Test/ReelConfig.cs rename to Assets/Scripts/Generate/Config/ReelConfig.cs index 80b15118b..fa3a2a793 100644 --- a/Assets/Scripts/Generate/Test/ReelConfig.cs +++ b/Assets/Scripts/Generate/Config/ReelConfig.cs @@ -20,7 +20,7 @@ using NBC.Serialize; #pragma warning disable CS8625 #pragma warning disable CS8603 -namespace Fantasy +namespace NBF { [ProtoContract] public sealed partial class ReelConfigData : ASerialize, IConfigTable, IProto diff --git a/Assets/Scripts/Generate/Config/ReelConfig.cs.meta b/Assets/Scripts/Generate/Config/ReelConfig.cs.meta new file mode 100644 index 000000000..91c72ee49 --- /dev/null +++ b/Assets/Scripts/Generate/Config/ReelConfig.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: d4057494001ca644d806866b82e454b5 \ No newline at end of file diff --git a/Assets/Scripts/Generate/Test/RingConfig.cs b/Assets/Scripts/Generate/Config/RingConfig.cs similarity index 99% rename from Assets/Scripts/Generate/Test/RingConfig.cs rename to Assets/Scripts/Generate/Config/RingConfig.cs index 373d6c844..1dd9dbc84 100644 --- a/Assets/Scripts/Generate/Test/RingConfig.cs +++ b/Assets/Scripts/Generate/Config/RingConfig.cs @@ -20,7 +20,7 @@ using NBC.Serialize; #pragma warning disable CS8625 #pragma warning disable CS8603 -namespace Fantasy +namespace NBF { [ProtoContract] public sealed partial class RingConfigData : ASerialize, IConfigTable, IProto diff --git a/Assets/Scripts/Generate/Config/RingConfig.cs.meta b/Assets/Scripts/Generate/Config/RingConfig.cs.meta new file mode 100644 index 000000000..ffe9f2b46 --- /dev/null +++ b/Assets/Scripts/Generate/Config/RingConfig.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: d5ab2b592498a8e4ebdd9d25d1cd28eb \ No newline at end of file diff --git a/Assets/Scripts/Generate/Test/RodConfig.cs b/Assets/Scripts/Generate/Config/RodConfig.cs similarity index 99% rename from Assets/Scripts/Generate/Test/RodConfig.cs rename to Assets/Scripts/Generate/Config/RodConfig.cs index 2d49a275b..acadcef48 100644 --- a/Assets/Scripts/Generate/Test/RodConfig.cs +++ b/Assets/Scripts/Generate/Config/RodConfig.cs @@ -20,7 +20,7 @@ using NBC.Serialize; #pragma warning disable CS8625 #pragma warning disable CS8603 -namespace Fantasy +namespace NBF { [ProtoContract] public sealed partial class RodConfigData : ASerialize, IConfigTable, IProto diff --git a/Assets/Scripts/Generate/Config/RodConfig.cs.meta b/Assets/Scripts/Generate/Config/RodConfig.cs.meta new file mode 100644 index 000000000..d54d3a5f2 --- /dev/null +++ b/Assets/Scripts/Generate/Config/RodConfig.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 176c5f1cc129a584386c5e3d31fdbe83 \ No newline at end of file diff --git a/Assets/Scripts/Generate/Test/Unit2Config.cs b/Assets/Scripts/Generate/Config/Unit2Config.cs similarity index 99% rename from Assets/Scripts/Generate/Test/Unit2Config.cs rename to Assets/Scripts/Generate/Config/Unit2Config.cs index 8f2671705..5e39bc1a7 100644 --- a/Assets/Scripts/Generate/Test/Unit2Config.cs +++ b/Assets/Scripts/Generate/Config/Unit2Config.cs @@ -20,7 +20,7 @@ using NBC.Serialize; #pragma warning disable CS8625 #pragma warning disable CS8603 -namespace Fantasy +namespace NBF { [ProtoContract] public sealed partial class Unit2ConfigData : ASerialize, IConfigTable, IProto diff --git a/Assets/Scripts/Generate/Config/Unit2Config.cs.meta b/Assets/Scripts/Generate/Config/Unit2Config.cs.meta new file mode 100644 index 000000000..9e471ae4c --- /dev/null +++ b/Assets/Scripts/Generate/Config/Unit2Config.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f21c201a46908db49ba01e47739e1d6c \ No newline at end of file diff --git a/Assets/Scripts/Generate/Test/UnitConfig.cs b/Assets/Scripts/Generate/Config/UnitConfig.cs similarity index 99% rename from Assets/Scripts/Generate/Test/UnitConfig.cs rename to Assets/Scripts/Generate/Config/UnitConfig.cs index b051d8fe9..ce42a9f12 100644 --- a/Assets/Scripts/Generate/Test/UnitConfig.cs +++ b/Assets/Scripts/Generate/Config/UnitConfig.cs @@ -20,7 +20,7 @@ using NBC.Serialize; #pragma warning disable CS8625 #pragma warning disable CS8603 -namespace Fantasy +namespace NBF { [ProtoContract] public sealed partial class UnitConfigData : ASerialize, IConfigTable, IProto diff --git a/Assets/Scripts/Generate/Config/UnitConfig.cs.meta b/Assets/Scripts/Generate/Config/UnitConfig.cs.meta new file mode 100644 index 000000000..e883ae588 --- /dev/null +++ b/Assets/Scripts/Generate/Config/UnitConfig.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: d73eec65a1c15e04b87183f785900ae7 \ No newline at end of file diff --git a/Assets/Scripts/Generate/Test/WeightConfig.cs b/Assets/Scripts/Generate/Config/WeightConfig.cs similarity index 99% rename from Assets/Scripts/Generate/Test/WeightConfig.cs rename to Assets/Scripts/Generate/Config/WeightConfig.cs index ea8a29cdc..993973951 100644 --- a/Assets/Scripts/Generate/Test/WeightConfig.cs +++ b/Assets/Scripts/Generate/Config/WeightConfig.cs @@ -20,7 +20,7 @@ using NBC.Serialize; #pragma warning disable CS8625 #pragma warning disable CS8603 -namespace Fantasy +namespace NBF { [ProtoContract] public sealed partial class WeightConfigData : ASerialize, IConfigTable, IProto diff --git a/Assets/Scripts/Generate/Config/WeightConfig.cs.meta b/Assets/Scripts/Generate/Config/WeightConfig.cs.meta new file mode 100644 index 000000000..4bb1e8f53 --- /dev/null +++ b/Assets/Scripts/Generate/Config/WeightConfig.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 6d0aa663b8919bf41a0bf3a7ce42170d \ No newline at end of file diff --git a/Assets/Scripts/Generate/Test/BaitConfig.cs.meta b/Assets/Scripts/Generate/Test/BaitConfig.cs.meta deleted file mode 100644 index 30315b183..000000000 --- a/Assets/Scripts/Generate/Test/BaitConfig.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 6362bd09bd57c6647b87ac7abcde3a6c \ No newline at end of file diff --git a/Assets/Scripts/Generate/Test/BobberConfig.cs.meta b/Assets/Scripts/Generate/Test/BobberConfig.cs.meta deleted file mode 100644 index f6d7b246f..000000000 --- a/Assets/Scripts/Generate/Test/BobberConfig.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 4c4ce5c38c2619a4f95a1bd26089cca7 \ No newline at end of file diff --git a/Assets/Scripts/Generate/Test/FeederConfig.cs.meta b/Assets/Scripts/Generate/Test/FeederConfig.cs.meta deleted file mode 100644 index 90b228a26..000000000 --- a/Assets/Scripts/Generate/Test/FeederConfig.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: da3d806c80cc74148a23c2af19ecbe4d \ No newline at end of file diff --git a/Assets/Scripts/Generate/Test/FishConfig.cs.meta b/Assets/Scripts/Generate/Test/FishConfig.cs.meta deleted file mode 100644 index fc444043a..000000000 --- a/Assets/Scripts/Generate/Test/FishConfig.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 38a9a1b4cfa8ab24c8bb141ae7cba986 \ No newline at end of file diff --git a/Assets/Scripts/Generate/Test/HookConfig.cs.meta b/Assets/Scripts/Generate/Test/HookConfig.cs.meta deleted file mode 100644 index 69396363d..000000000 --- a/Assets/Scripts/Generate/Test/HookConfig.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 5a6178b7c5ee4ca45b28631c50966e28 \ No newline at end of file diff --git a/Assets/Scripts/Generate/Test/LineConfig.cs.meta b/Assets/Scripts/Generate/Test/LineConfig.cs.meta deleted file mode 100644 index 020df054b..000000000 --- a/Assets/Scripts/Generate/Test/LineConfig.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: dd32cd6701963b84988ab6c9168f0568 \ No newline at end of file diff --git a/Assets/Scripts/Generate/Test/LureConfig.cs.meta b/Assets/Scripts/Generate/Test/LureConfig.cs.meta deleted file mode 100644 index e4cbc6b53..000000000 --- a/Assets/Scripts/Generate/Test/LureConfig.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: a3789e74296554d43b1ea6274f978384 \ No newline at end of file diff --git a/Assets/Scripts/Generate/Test/ReelConfig.cs.meta b/Assets/Scripts/Generate/Test/ReelConfig.cs.meta deleted file mode 100644 index 6748cdd63..000000000 --- a/Assets/Scripts/Generate/Test/ReelConfig.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 937f0fc7328e76f4a8f3137d0cf2bf3c \ No newline at end of file diff --git a/Assets/Scripts/Generate/Test/RingConfig.cs.meta b/Assets/Scripts/Generate/Test/RingConfig.cs.meta deleted file mode 100644 index b1ae506c2..000000000 --- a/Assets/Scripts/Generate/Test/RingConfig.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 011d34ec27d1f7740b439af74c883be5 \ No newline at end of file diff --git a/Assets/Scripts/Generate/Test/RodConfig.cs.meta b/Assets/Scripts/Generate/Test/RodConfig.cs.meta deleted file mode 100644 index 2c6f5ca12..000000000 --- a/Assets/Scripts/Generate/Test/RodConfig.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 50e00e7722e5f804b9151354058842cc \ No newline at end of file diff --git a/Assets/Scripts/Generate/Test/Unit2Config.cs.meta b/Assets/Scripts/Generate/Test/Unit2Config.cs.meta deleted file mode 100644 index e2e3be243..000000000 --- a/Assets/Scripts/Generate/Test/Unit2Config.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 0750f0970e8c3aa49bd98757da8cbe39 \ No newline at end of file diff --git a/Assets/Scripts/Generate/Test/UnitConfig.cs.meta b/Assets/Scripts/Generate/Test/UnitConfig.cs.meta deleted file mode 100644 index 7bf08ead5..000000000 --- a/Assets/Scripts/Generate/Test/UnitConfig.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: c4fcd00be96ef734682179e668d43ff5 \ No newline at end of file diff --git a/Assets/Scripts/Generate/Test/WeightConfig.cs.meta b/Assets/Scripts/Generate/Test/WeightConfig.cs.meta deleted file mode 100644 index 7702578f4..000000000 --- a/Assets/Scripts/Generate/Test/WeightConfig.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 190543eb94e16a24ba18b202c8f66cd3 \ No newline at end of file diff --git a/Assets/Scripts/Init.cs b/Assets/Scripts/Init.cs index 80bec7549..4ec236387 100644 --- a/Assets/Scripts/Init.cs +++ b/Assets/Scripts/Init.cs @@ -111,6 +111,8 @@ namespace NBF private void LoadData() { + var jsonAsset = Resources.Load("config/configs"); + ConfigTableHelper.Initialize(jsonAsset.text); // ConfigAssets.Init(); } diff --git a/Assets/Scripts/NBC/Runtime/Core/Config/ConfigTableHelper.cs b/Assets/Scripts/NBC/Runtime/Core/Config/ConfigTableHelper.cs index 79b499aa3..447872f07 100644 --- a/Assets/Scripts/NBC/Runtime/Core/Config/ConfigTableHelper.cs +++ b/Assets/Scripts/NBC/Runtime/Core/Config/ConfigTableHelper.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.IO; using NBC.Serialize; +using Newtonsoft.Json.Linq; namespace NBC { @@ -10,24 +11,47 @@ namespace NBC /// public static class ConfigTableHelper { - private static string _configTableBinaryDirectory; + // private static string _configTableBinaryDirectory; + // private static string _jsonData; + private static readonly object Lock = new object(); + // 配置表数据缓存字典 - private static readonly Dictionary ConfigDic = new (); + private static readonly Dictionary ConfigDic = new(); + + private static readonly Dictionary Tokens = new(); + /// /// 初始化ConfigTableHelper /// - /// - public static void Initialize(string configTableBinaryDirectory) + public static void Initialize(string json) { - _configTableBinaryDirectory = configTableBinaryDirectory; + // _jsonData = json; + var jsonObj = JObject.Parse(json); + foreach (var item in jsonObj) + { + try + { + var name = item.Key; + var value = item.Value; + if (value is JArray jArray) + { + Tokens[name] = jArray; + } + } + catch (Exception e) + { + Log.Error($"读表异常,请检查,name={item.Key} ex={e}"); + } + } } + /// /// 加载配置表数据 /// /// 配置表类型 /// 配置表数据 - public static T Load() where T : ASerialize + public static T Load() where T : ASerialize, new() { lock (Lock) { @@ -39,13 +63,19 @@ namespace NBC { return (T)aProto; } - - var configFile = GetConfigPath(dataConfig); - var bytes = File.ReadAllBytes(configFile); - // Log.Debug($"dataConfig:{dataConfig} {bytes.Length}"); - var data = SerializerManager.GetSerializer(FantasySerializerType.ProtoBuf).Deserialize(bytes); - ConfigDic[dataConfig] = data; - return data; + + var configName = typeof(T).Name; + if (!Tokens.TryGetValue(configName, out var jArray)) + { + // jArray.ToObject>() + // return new T(); + } + + // var configFile = GetConfigPath(dataConfig); + // var bytes = File.ReadAllBytes(configFile); + // var data = SerializerManager.GetSerializer(FantasySerializerType.ProtoBuf).Deserialize(bytes); + // ConfigDic[dataConfig] = data; + return new T(); } catch (Exception ex) { @@ -53,38 +83,5 @@ namespace NBC } } } - - /// - /// 获取配置表文件路径 - /// - /// 配置表名称 - /// 配置表文件路径 - private static string GetConfigPath(string name) - { - var configFile = Path.Combine(_configTableBinaryDirectory, $"{name}.bytes"); - - if (File.Exists(configFile)) - { - return configFile; - } - - throw new FileNotFoundException($"{name}.byte not found: {configFile}"); - } - - /// - /// 重新加载配置表数据 - /// - public static void ReLoadConfigTable() - { - lock (Lock) - { - foreach (var (_, aProto) in ConfigDic) - { - ((IDisposable) aProto).Dispose(); - } - - ConfigDic.Clear(); - } - } } -} +} \ No newline at end of file diff --git a/Config/BaitConfig.xlsx b/Config/BaitConfig.xlsx new file mode 100644 index 000000000..1f100b90a Binary files /dev/null and b/Config/BaitConfig.xlsx differ diff --git a/Config/BobberConfig.xlsx b/Config/BobberConfig.xlsx new file mode 100644 index 000000000..7d1cc15e9 Binary files /dev/null and b/Config/BobberConfig.xlsx differ diff --git a/Config/FeederConfig.xlsx b/Config/FeederConfig.xlsx new file mode 100644 index 000000000..c253564fc Binary files /dev/null and b/Config/FeederConfig.xlsx differ diff --git a/Config/FishConfig.xlsx b/Config/FishConfig.xlsx new file mode 100644 index 000000000..ae840be99 Binary files /dev/null and b/Config/FishConfig.xlsx differ diff --git a/Config/HookConfig.xlsx b/Config/HookConfig.xlsx new file mode 100644 index 000000000..546c1759e Binary files /dev/null and b/Config/HookConfig.xlsx differ diff --git a/Config/LineConfig.xlsx b/Config/LineConfig.xlsx new file mode 100644 index 000000000..b8dcd5cf1 Binary files /dev/null and b/Config/LineConfig.xlsx differ diff --git a/Config/LureConfig.xlsx b/Config/LureConfig.xlsx new file mode 100644 index 000000000..97925e910 Binary files /dev/null and b/Config/LureConfig.xlsx differ diff --git a/Config/ReelConfig.xlsx b/Config/ReelConfig.xlsx new file mode 100644 index 000000000..b52d8da87 Binary files /dev/null and b/Config/ReelConfig.xlsx differ diff --git a/Config/RingConfig.xlsx b/Config/RingConfig.xlsx new file mode 100644 index 000000000..e457fc523 Binary files /dev/null and b/Config/RingConfig.xlsx differ diff --git a/Config/RodConfig.xlsx b/Config/RodConfig.xlsx new file mode 100644 index 000000000..f62055ccb Binary files /dev/null and b/Config/RodConfig.xlsx differ diff --git a/Config/UnitConfig.xlsx b/Config/UnitConfig.xlsx new file mode 100644 index 000000000..4cb4ee5a4 Binary files /dev/null and b/Config/UnitConfig.xlsx differ diff --git a/Config/WeightConfig.xlsx b/Config/WeightConfig.xlsx new file mode 100644 index 000000000..13782d911 Binary files /dev/null and b/Config/WeightConfig.xlsx differ diff --git a/Config/fish-鱼.xlsx b/Config/fish-鱼.xlsx deleted file mode 100644 index 2345078b3..000000000 Binary files a/Config/fish-鱼.xlsx and /dev/null differ diff --git a/Config/fishing gear-渔具.xlsx b/Config/fishing gear-渔具.xlsx deleted file mode 100644 index f9ed12d9a..000000000 Binary files a/Config/fishing gear-渔具.xlsx and /dev/null differ diff --git a/Config/unit - 单位.xlsx b/Config/unit - 单位.xlsx deleted file mode 100644 index d3337655e..000000000 Binary files a/Config/unit - 单位.xlsx and /dev/null differ