diff --git a/Assets/AssetCaches.asset b/Assets/AssetCaches.asset
index b7c80edaa..eb41d4c31 100644
--- a/Assets/AssetCaches.asset
+++ b/Assets/AssetCaches.asset
@@ -12,5 +12,532 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 9fa072029bab4df48fef4d84ac836775, type: 3}
m_Name: AssetCaches
m_EditorClassIdentifier:
- Assets: []
+ Assets:
+ - Path: Assets/Resources/gfx/rods/syberia/bolo_10021/bolo_10021_LB400.prefab
+ Address: Rod/bolo_10021_LB400
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rods/syberia/carp_10046/carp_10046_360H.prefab
+ Address: Rod/carp_10046_360H
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rods/syberia/carp_10046/carp_10046_360XH.prefab
+ Address: Rod/carp_10046_360XH
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rods/syberia/cast_10018/cast_10018_CST60MH.prefab
+ Address: Rod/cast_10018_CST60MH
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rods/syberia/cast_10018/cast_10018_CST78H.prefab
+ Address: Rod/cast_10018_CST78H
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rods/syberia/cast_10018/cast_10018_CST86XH.prefab
+ Address: Rod/cast_10018_CST86XH
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rods/syberia/feeder_10048/feeder_10048_FD390.prefab
+ Address: Rod/feeder_10048_FD390
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rods/syberia/feeder_10048/feeder_10048_FD420.prefab
+ Address: Rod/feeder_10048_FD420
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rods/syberia/jerk_10043/jerk_10043_JR60XH.prefab
+ Address: Rod/jerk_10043_JR60XH
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rods/syberia/jerk_10043/jerk_10043_JR68XH.prefab
+ Address: Rod/jerk_10043_JR68XH
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rods/syberia/mark_10168/mark_10168_3LB.prefab
+ Address: Rod/mark_10168_3LB
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rods/syberia/mark_10168/mark_10168_4LB.prefab
+ Address: Rod/mark_10168_4LB
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rods/syberia/match_10025/match_10025_M130H.prefab
+ Address: Rod/match_10025_M130H
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rods/syberia/match_10025/match_10025_M140H.prefab
+ Address: Rod/match_10025_M140H
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rods/syberia/match_10025/match_10025_M150MH.prefab
+ Address: Rod/match_10025_M150MH
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rods/syberia/picker_10052/picker_10052_P300-MH.prefab
+ Address: Rod/picker_10052_P300-MH
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rods/syberia/spin_10034/spin_10034_S60H.prefab
+ Address: Rod/spin_10034_S60H
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rods/syberia/spin_10034/spin_10034_S60H2.prefab
+ Address: Rod/spin_10034_S60H2
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rods/syberia/spod_10133/spod_10133_3LB.prefab
+ Address: Rod/spod_10133_3LB
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rods/syberia/spod_10133/spod_10133_4_5LB.prefab
+ Address: Rod/spod_10133_4_5LB
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rods/syberia/tele_10037/tele_10037_t13.prefab
+ Address: Rod/tele_10037_t13
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rod_pods/rod_pod/rod_pod.prefab
+ Address: Rod/rod_pod
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rod_pods/rod_pod_03/rod_pod_03al.prefab
+ Address: Rod/rod_pod_03al
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rod_pods/rod_pod_03/rod_pod_03b.prefab
+ Address: Rod/rod_pod_03b
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rod_pods/rod_pod_03/rod_pod_03bm.prefab
+ Address: Rod/rod_pod_03bm
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rod_pods/rod_pod_03/rod_pod_03c.prefab
+ Address: Rod/rod_pod_03c
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rod_pods/rod_pod_03/rod_pod_03dg.prefab
+ Address: Rod/rod_pod_03dg
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rod_pods/rod_pod_03/rod_pod_03g.prefab
+ Address: Rod/rod_pod_03g
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rod_pods/rod_pod_03/rod_pod_03r.prefab
+ Address: Rod/rod_pod_03r
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rod_rings/rumoi/rumoi_oxiline_spin.prefab
+ Address: Rod/rumoi_oxiline_spin
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Path: Assets/Resources/gfx/rod_rings/smt/smt_pure_ceramic_bolo.prefab
+ Address: Rod/smt_pure_ceramic_bolo
+ Type: GameObject
+ Bundle: main/rod.bundle
+ Tags:
+ Group:
+ Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
Bundles: []
diff --git a/Assets/CollectorSetting.asset b/Assets/CollectorSetting.asset
index f3d7fc20a..c5241643e 100644
--- a/Assets/CollectorSetting.asset
+++ b/Assets/CollectorSetting.asset
@@ -12,4 +12,100 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: fb797276877142dfb00042b5dc5064ba, type: 3}
m_Name: CollectorSetting
m_EditorClassIdentifier:
- Packages: []
+ Packages:
+ - Name: Main
+ Enable: 1
+ Default: 1
+ BundleOptions: 256
+ Groups:
+ - Name: UI
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors: []
+ FilterEnum: 0
+ Filter: '*'
+ - Name: Rod
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors:
+ - {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
+ - {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
+ - {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
+ FilterEnum: 0
+ Filter: '*'
+ - Name: Bait
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors: []
+ FilterEnum: 0
+ Filter: '*'
+ - Name: Bobber
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors: []
+ FilterEnum: 0
+ Filter: '*'
+ - Name: Hook
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors: []
+ FilterEnum: 0
+ Filter: '*'
+ - Name: Line
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors: []
+ FilterEnum: 0
+ Filter: '*'
+ - Name: Lure
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors: []
+ FilterEnum: 0
+ Filter: '*'
+ - Name: Reel
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors: []
+ FilterEnum: 0
+ Filter: '*'
+ - Name: Weight
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors: []
+ FilterEnum: 0
+ Filter: '*'
+ - Name: Item
+ Enable: 1
+ BundleMode: 0
+ AddressMode: 2
+ Tags:
+ Collectors: []
+ FilterEnum: 0
+ Filter: '*'
+ - Name: Map
+ Enable: 1
+ BundleMode: 3
+ AddressMode: 2
+ Tags:
+ Collectors: []
+ FilterEnum: 2
+ Filter: t:Scene
diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/TypeRegistryUserConfig.asset b/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/TypeRegistryUserConfig.asset
new file mode 100644
index 000000000..da68e0e55
--- /dev/null
+++ b/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/TypeRegistryUserConfig.asset
@@ -0,0 +1,24 @@
+%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: 2050440665, guid: a4865f1ab4504ed8a368670db22f409c, type: 3}
+ m_Name: TypeRegistryUserConfig
+ m_EditorClassIdentifier: Sirenix.OdinInspector.Editor.dll::Sirenix.Config.TypeRegistryUserConfig
+ shownTypes:
+ serializedCollection: []
+ hiddenTypes:
+ serializedCollection: []
+ addedIllegalTypes:
+ serializedCollection: []
+ typeSettings:
+ serializedDictionary: []
+ typePriorities:
+ serializedDictionary: []
diff --git a/Assets/Scripts/NBC~.meta b/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/TypeRegistryUserConfig.asset.meta
similarity index 52%
rename from Assets/Scripts/NBC~.meta
rename to Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/TypeRegistryUserConfig.asset.meta
index 3cdb70f64..94647ea9a 100644
--- a/Assets/Scripts/NBC~.meta
+++ b/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/TypeRegistryUserConfig.asset.meta
@@ -1,8 +1,8 @@
fileFormatVersion: 2
-guid: d2f9d2e7e9670e04eb4febfdd9139d6e
-folderAsset: yes
-DefaultImporter:
+guid: 227f4c14ecdde7041ae3ae3e713e6fc8
+NativeFormatImporter:
externalObjects: {}
+ mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
diff --git a/Assets/Scenes/StartUp.unity b/Assets/Scenes/StartUp.unity
index e6459fd20..8151874b9 100644
--- a/Assets/Scenes/StartUp.unity
+++ b/Assets/Scenes/StartUp.unity
@@ -352,7 +352,7 @@ Canvas:
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_VertexColorAlwaysGammaSpace: 0
- m_AdditionalShaderChannelsFlag: 0
+ m_AdditionalShaderChannelsFlag: 25
m_UpdateRectTransformForStandalone: 0
m_SortingLayerID: 0
m_SortingOrder: 1
@@ -370,6 +370,7 @@ RectTransform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1879421340}
+ - {fileID: 1833561914}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
@@ -865,6 +866,142 @@ Transform:
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!1 &1833561913
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 1833561914}
+ - component: {fileID: 1833561916}
+ - component: {fileID: 1833561915}
+ m_Layer: 5
+ m_Name: Text (TMP)
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!224 &1833561914
+RectTransform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 1833561913}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
+ m_Children: []
+ m_Father: {fileID: 386239072}
+ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+ m_AnchorMin: {x: 0.5, y: 0.5}
+ m_AnchorMax: {x: 0.5, y: 0.5}
+ m_AnchoredPosition: {x: 0, y: 0}
+ m_SizeDelta: {x: 200, y: 50}
+ m_Pivot: {x: 0.5, y: 0.5}
+--- !u!114 &1833561915
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 1833561913}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
+ m_Name:
+ m_EditorClassIdentifier: Unity.TextMeshPro::TMPro.TextMeshProUGUI
+ m_Material: {fileID: 0}
+ m_Color: {r: 1, g: 1, b: 1, a: 1}
+ m_RaycastTarget: 1
+ m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
+ m_Maskable: 1
+ m_OnCullStateChanged:
+ m_PersistentCalls:
+ m_Calls: []
+ m_text: New Text
+ m_isRightToLeft: 0
+ m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
+ m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
+ m_fontSharedMaterials: []
+ m_fontMaterial: {fileID: 0}
+ m_fontMaterials: []
+ m_fontColor32:
+ serializedVersion: 2
+ rgba: 4294967295
+ m_fontColor: {r: 1, g: 1, b: 1, a: 1}
+ m_enableVertexGradient: 0
+ m_colorMode: 3
+ m_fontColorGradient:
+ topLeft: {r: 1, g: 1, b: 1, a: 1}
+ topRight: {r: 1, g: 1, b: 1, a: 1}
+ bottomLeft: {r: 1, g: 1, b: 1, a: 1}
+ bottomRight: {r: 1, g: 1, b: 1, a: 1}
+ m_fontColorGradientPreset: {fileID: 0}
+ m_spriteAsset: {fileID: 0}
+ m_tintAllSprites: 0
+ m_StyleSheet: {fileID: 0}
+ m_TextStyleHashCode: -1183493901
+ m_overrideHtmlColors: 0
+ m_faceColor:
+ serializedVersion: 2
+ rgba: 4294967295
+ m_fontSize: 36
+ m_fontSizeBase: 36
+ m_fontWeight: 400
+ m_enableAutoSizing: 0
+ m_fontSizeMin: 18
+ m_fontSizeMax: 72
+ m_fontStyle: 0
+ m_HorizontalAlignment: 1
+ m_VerticalAlignment: 256
+ m_textAlignment: 65535
+ m_characterSpacing: 0
+ m_wordSpacing: 0
+ m_lineSpacing: 0
+ m_lineSpacingMax: 0
+ m_paragraphSpacing: 0
+ m_charWidthMaxAdj: 0
+ m_TextWrappingMode: 1
+ m_wordWrappingRatios: 0.4
+ m_overflowMode: 0
+ m_linkedTextComponent: {fileID: 0}
+ parentLinkedComponent: {fileID: 0}
+ m_enableKerning: 0
+ m_ActiveFontFeatures: 6e72656b
+ m_enableExtraPadding: 0
+ checkPaddingRequired: 0
+ m_isRichText: 1
+ m_EmojiFallbackSupport: 1
+ m_parseCtrlCharacters: 1
+ m_isOrthographic: 1
+ m_isCullingEnabled: 0
+ m_horizontalMapping: 0
+ m_verticalMapping: 0
+ m_uvLineOffset: 0
+ m_geometrySortingOrder: 0
+ m_IsTextObjectScaleStatic: 0
+ m_VertexBufferAutoSizeReduction: 0
+ m_useMaxVisibleDescender: 1
+ m_pageToDisplay: 1
+ m_margin: {x: 0, y: 0, z: 0, w: 0}
+ m_isUsingLegacyAnimationComponent: 0
+ m_isVolumetricText: 0
+ m_hasFontAssetChanged: 0
+ m_baseMaterial: {fileID: 0}
+ m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
+--- !u!222 &1833561916
+CanvasRenderer:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 1833561913}
+ m_CullTransparentMesh: 1
--- !u!1 &1879421339
GameObject:
m_ObjectHideFlags: 0
diff --git a/Assets/Scripts/NBC.Fantasy/Runtime/Asset/Runtime/Asset/Providers/ProviderBase.cs b/Assets/Scripts/NBC.Fantasy/Runtime/Asset/Runtime/Asset/Providers/ProviderBase.cs
index aa5fb56c4..10b478917 100644
--- a/Assets/Scripts/NBC.Fantasy/Runtime/Asset/Runtime/Asset/Providers/ProviderBase.cs
+++ b/Assets/Scripts/NBC.Fantasy/Runtime/Asset/Runtime/Asset/Providers/ProviderBase.cs
@@ -1,6 +1,7 @@
using System;
using System.Diagnostics;
using System.Globalization;
+using Fantasy.Async;
namespace NBC
{
diff --git a/Assets/Scripts/NBC.Fantasy/Runtime/Asset/Runtime/Assets.cs b/Assets/Scripts/NBC.Fantasy/Runtime/Asset/Runtime/Assets.cs
index 4a7f2cb39..fc1f8fb26 100644
--- a/Assets/Scripts/NBC.Fantasy/Runtime/Asset/Runtime/Assets.cs
+++ b/Assets/Scripts/NBC.Fantasy/Runtime/Asset/Runtime/Assets.cs
@@ -48,7 +48,7 @@ namespace NBC
{
return assetProvider.Asset as T;
}
-
+
return null;
}
diff --git a/Assets/Scripts/NBC~/Editor.meta b/Assets/Scripts/NBC~/Editor.meta
deleted file mode 100644
index 9ca6c08e9..000000000
--- a/Assets/Scripts/NBC~/Editor.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: 6deb0dcf8adbd4f8f92d5482999b05bf
-folderAsset: yes
-DefaultImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Editor/Runtime.meta b/Assets/Scripts/NBC~/Editor/Runtime.meta
deleted file mode 100644
index de0343225..000000000
--- a/Assets/Scripts/NBC~/Editor/Runtime.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: e8ba5b17cffbb4ffea892f674fc8629f
-folderAsset: yes
-DefaultImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Editor/Runtime/CheckUnityVersion.cs b/Assets/Scripts/NBC~/Editor/Runtime/CheckUnityVersion.cs
deleted file mode 100644
index 8495457f5..000000000
--- a/Assets/Scripts/NBC~/Editor/Runtime/CheckUnityVersion.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using System;
-using UnityEditor;
-
-namespace NBC
-{
- internal static class CheckUnityVersion
- {
- [InitializeOnLoadMethod]
- private static void OnInitializeOnLoad()
- {
-#if !UNITY_2021_3_OR_NEWER
- Debug.LogError("Fantasy支持的最低版本为Unity2021.3.14f1c1");
-#endif
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Editor/Runtime/CheckUnityVersion.cs.meta b/Assets/Scripts/NBC~/Editor/Runtime/CheckUnityVersion.cs.meta
deleted file mode 100644
index 1f13ace47..000000000
--- a/Assets/Scripts/NBC~/Editor/Runtime/CheckUnityVersion.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 455f338921e74471841971fd6b79db01
-timeCreated: 1725943424
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Editor/Runtime/FantasyStartup.cs b/Assets/Scripts/NBC~/Editor/Runtime/FantasyStartup.cs
deleted file mode 100644
index e2680a1ed..000000000
--- a/Assets/Scripts/NBC~/Editor/Runtime/FantasyStartup.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-using System.IO;
-using UnityEditor;
-using UnityEngine;
-
-namespace NBC
-{
- [InitializeOnLoad]
- public static class FantasyStartup
- {
- private const string ScriptAssemblies = "Library/ScriptAssemblies/";
-
- static FantasyStartup()
- {
- if (!FantasySettingsScriptableObject.Instance.autoCopyAssembly)
- {
- return;
- }
-
- var hotUpdatePath = FantasySettingsScriptableObject.Instance.hotUpdatePath;
-
- if (string.IsNullOrEmpty(hotUpdatePath))
- {
- Debug.LogError("请先在菜单Fantasy-Fantasy Settings里设置HotUpdatePath目录位置");
- return;
- }
-
- if (!Directory.Exists(hotUpdatePath))
- {
- Directory.CreateDirectory(hotUpdatePath);
- }
-
- // ReSharper disable once StringLastIndexOfIsCultureSpecific.1
- if (hotUpdatePath.LastIndexOf("/") != hotUpdatePath.Length - 1)
- {
- FantasySettingsScriptableObject.Instance.hotUpdatePath += "/";
- hotUpdatePath = FantasySettingsScriptableObject.Instance.hotUpdatePath;
- }
-
- foreach (var instanceHotUpdateAssemblyDefinition in FantasySettingsScriptableObject.Instance.hotUpdateAssemblyDefinitions)
- {
- var dll = instanceHotUpdateAssemblyDefinition.name;
- File.Copy($"{ScriptAssemblies}{dll}.dll", $"{hotUpdatePath}/{dll}.dll.bytes", true);
- File.Copy($"{ScriptAssemblies}{dll}.pdb", $"{hotUpdatePath}/{dll}.pdb.bytes", true);
- }
-
- AssetDatabase.Refresh();
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Editor/Runtime/FantasyStartup.cs.meta b/Assets/Scripts/NBC~/Editor/Runtime/FantasyStartup.cs.meta
deleted file mode 100644
index abcd77d59..000000000
--- a/Assets/Scripts/NBC~/Editor/Runtime/FantasyStartup.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 42156ba2865a4aa4a3e1e57b3ac9b984
-timeCreated: 1688276977
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Editor/Runtime/LinkXmlGenerator.cs b/Assets/Scripts/NBC~/Editor/Runtime/LinkXmlGenerator.cs
deleted file mode 100644
index 8843740ef..000000000
--- a/Assets/Scripts/NBC~/Editor/Runtime/LinkXmlGenerator.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-using System.IO;
-using UnityEditor;
-using UnityEngine;
-
-namespace NBC
-{
- public class LinkXmlGenerator
- {
- private const string LinkPath = "Assets/link.xml";
- // 在Unity编辑器中运行该方法来生成link.xml文件
- [UnityEditor.MenuItem("Fantasy/Generate link.xml")]
- public static void GenerateLinkXml()
- {
- using (var writer = new StreamWriter("Assets/link.xml"))
- {
- writer.WriteLine("");
-
- foreach (var assembly in FantasySettingsScriptableObject.Instance.includeAssembly)
- {
- GenerateLinkXml(writer, assembly, LinkPath);
- Debug.Log($"{assembly} Link generation completed");
- }
-
- if (FantasySettingsScriptableObject.Instance?.linkAssemblyDefinitions != null)
- {
- foreach (var linkAssembly in FantasySettingsScriptableObject.Instance.linkAssemblyDefinitions)
- {
- GenerateLinkXml(writer, linkAssembly.name, LinkPath);
- Debug.Log($"{linkAssembly.name} Link generation completed");
- }
- }
- writer.WriteLine("");
- }
-
- AssetDatabase.Refresh();
- Debug.Log("link.xml generated successfully!");
- }
-
- private static void GenerateLinkXml(StreamWriter writer, string assemblyName, string outputPath)
- {
- var assembly = System.Reflection.Assembly.Load(assemblyName);
- var types = assembly.GetTypes();
- writer.WriteLine($" ");
- foreach (var type in types)
- {
- var typeName = type.FullName.Replace('<', '+').Replace('>', '+');
- writer.WriteLine($" ");
- }
- writer.WriteLine(" ");
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Editor/Runtime/LinkXmlGenerator.cs.meta b/Assets/Scripts/NBC~/Editor/Runtime/LinkXmlGenerator.cs.meta
deleted file mode 100644
index dbab22021..000000000
--- a/Assets/Scripts/NBC~/Editor/Runtime/LinkXmlGenerator.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: cda4c9403de946df9c31654416193a21
-timeCreated: 1722743236
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Editor/Runtime/NBC.Editor.asmdef b/Assets/Scripts/NBC~/Editor/Runtime/NBC.Editor.asmdef
deleted file mode 100644
index 58c1f7b38..000000000
--- a/Assets/Scripts/NBC~/Editor/Runtime/NBC.Editor.asmdef
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "name": "NBC.Editor",
- "rootNamespace": "",
- "references": [
- "GUID:0b7224b83ba514121aa026f3857f820a"
- ],
- "includePlatforms": [
- "Editor"
- ],
- "excludePlatforms": [],
- "allowUnsafeCode": false,
- "overrideReferences": false,
- "precompiledReferences": [],
- "autoReferenced": true,
- "defineConstraints": [],
- "versionDefines": [],
- "noEngineReferences": false
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Editor/Runtime/NBC.Editor.asmdef.meta b/Assets/Scripts/NBC~/Editor/Runtime/NBC.Editor.asmdef.meta
deleted file mode 100644
index d5a4e8b13..000000000
--- a/Assets/Scripts/NBC~/Editor/Runtime/NBC.Editor.asmdef.meta
+++ /dev/null
@@ -1,7 +0,0 @@
-fileFormatVersion: 2
-guid: 36410968656dd49358af485aad0b0c4c
-AssemblyDefinitionImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Editor/Runtime/Settings.meta b/Assets/Scripts/NBC~/Editor/Runtime/Settings.meta
deleted file mode 100644
index 6b097c8be..000000000
--- a/Assets/Scripts/NBC~/Editor/Runtime/Settings.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 3a6997d946f3400e8c423fe1b9245f65
-timeCreated: 1688277110
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Editor/Runtime/Settings/FantasySettings.cs b/Assets/Scripts/NBC~/Editor/Runtime/Settings/FantasySettings.cs
deleted file mode 100644
index 6909092fa..000000000
--- a/Assets/Scripts/NBC~/Editor/Runtime/Settings/FantasySettings.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using UnityEditor;
-
-namespace NBC
-{
- public class FantasySettings
- {
- [MenuItem("Fantasy/Fantasy Settings")]
- public static void OpenFantasySettings()
- {
- SettingsService.OpenProjectSettings("Project/Fantasy Settings");
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Editor/Runtime/Settings/FantasySettings.cs.meta b/Assets/Scripts/NBC~/Editor/Runtime/Settings/FantasySettings.cs.meta
deleted file mode 100644
index 852e825bf..000000000
--- a/Assets/Scripts/NBC~/Editor/Runtime/Settings/FantasySettings.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 977a7c172c30403da60286ba39b7bc72
-timeCreated: 1686913667
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Editor/Runtime/Settings/FantasySettingsProvider.cs b/Assets/Scripts/NBC~/Editor/Runtime/Settings/FantasySettingsProvider.cs
deleted file mode 100644
index 0a7ee7e21..000000000
--- a/Assets/Scripts/NBC~/Editor/Runtime/Settings/FantasySettingsProvider.cs
+++ /dev/null
@@ -1,102 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Reflection;
-using UnityEditor;
-using UnityEngine;
-using UnityEngine.UIElements;
-
-namespace NBC
-{
- public class FantasySettingsProvider : SettingsProvider
- {
- private SerializedObject _serializedObject;
- private SerializedProperty _autoCopyAssembly;
- private SerializedProperty _hotUpdatePath;
- private SerializedProperty _hotUpdateAssemblyDefinitions;
- private SerializedProperty _linkAssemblyDefinitions;
- private SerializedProperty _includeAssembly;
- public FantasySettingsProvider() : base("Project/Fantasy Settings", SettingsScope.Project) { }
-
- public override void OnActivate(string searchContext, VisualElement rootElement)
- {
- Init();
- base.OnActivate(searchContext, rootElement);
- }
-
- public override void OnDeactivate()
- {
- base.OnDeactivate();
- FantasySettingsScriptableObject.Save();
- }
-
- private void Init()
- {
- _serializedObject?.Dispose();
- _serializedObject = new SerializedObject(FantasySettingsScriptableObject.Instance);
- _autoCopyAssembly = _serializedObject.FindProperty("autoCopyAssembly");
- _hotUpdatePath = _serializedObject.FindProperty("hotUpdatePath");
- _hotUpdateAssemblyDefinitions = _serializedObject.FindProperty("hotUpdateAssemblyDefinitions");
- _linkAssemblyDefinitions = _serializedObject.FindProperty("linkAssemblyDefinitions");
- _includeAssembly = _serializedObject.FindProperty("includeAssembly");
- }
-
- public override void OnGUI(string searchContext)
- {
- if (_serializedObject == null || !_serializedObject.targetObject)
- {
- Init();
- }
-
- using (CreateSettingsWindowGUIScope())
- {
- _serializedObject!.Update();
-
- EditorGUI.BeginChangeCheck();
- EditorGUILayout.PropertyField(_autoCopyAssembly);
- EditorGUILayout.PropertyField(_hotUpdatePath);
- EditorGUILayout.PropertyField(_hotUpdateAssemblyDefinitions);
- EditorGUILayout.PropertyField(_includeAssembly);
- EditorGUILayout.PropertyField(_linkAssemblyDefinitions);
- // EditorGUILayout.HelpBox("默认包括Fantasy.Unity,所以不需要再次指定。", MessageType.Info);
-
- if (GUILayout.Button("GenerateLinkXml"))
- {
- LinkXmlGenerator.GenerateLinkXml();
- }
-
- if (EditorGUI.EndChangeCheck())
- {
- _serializedObject.ApplyModifiedProperties();
- FantasySettingsScriptableObject.Save();
- EditorApplication.RepaintHierarchyWindow();
- }
-
- base.OnGUI(searchContext);
- }
- }
-
- private IDisposable CreateSettingsWindowGUIScope()
- {
- var unityEditorAssembly = System.Reflection.Assembly.GetAssembly(typeof(EditorWindow));
- var type = unityEditorAssembly.GetType("UnityEditor.SettingsWindow+GUIScope");
- return Activator.CreateInstance(type) as IDisposable;
- }
-
- static FantasySettingsProvider _provider;
-
- [SettingsProvider]
- public static SettingsProvider CreateMyCustomSettingsProvider()
- {
- if (FantasySettingsScriptableObject.Instance && _provider == null)
- {
- _provider = new FantasySettingsProvider();
- using (var so = new SerializedObject(FantasySettingsScriptableObject.Instance))
- {
- _provider.keywords = GetSearchKeywordsFromSerializedObject(so);
- }
- }
- return _provider;
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Editor/Runtime/Settings/FantasySettingsProvider.cs.meta b/Assets/Scripts/NBC~/Editor/Runtime/Settings/FantasySettingsProvider.cs.meta
deleted file mode 100644
index 72e475d5a..000000000
--- a/Assets/Scripts/NBC~/Editor/Runtime/Settings/FantasySettingsProvider.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 047b2f13e73f413fa000bf7be979fb4a
-timeCreated: 1688380387
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Editor/Runtime/Settings/FantasySettingsScriptableObject.cs b/Assets/Scripts/NBC~/Editor/Runtime/Settings/FantasySettingsScriptableObject.cs
deleted file mode 100644
index c36feab0e..000000000
--- a/Assets/Scripts/NBC~/Editor/Runtime/Settings/FantasySettingsScriptableObject.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-using UnityEditor;
-using UnityEditor.Compilation;
-using UnityEditorInternal;
-using UnityEngine;
-using UnityEngine.Serialization;
-
-namespace NBC
-{
- [ScriptableObjectPath("ProjectSettings/FantasySettings.asset")]
- public class FantasySettingsScriptableObject : ScriptableObjectSingleton, ISerializationCallbackReceiver
- {
- [FormerlySerializedAs("AutoCopyAssembly")] [Header("自动拷贝程序集到HotUpdatePath目录中")]
- public bool autoCopyAssembly = false;
- [FormerlySerializedAs("HotUpdatePath")] [Header("HotUpdate目录(Unity编译后会把所有HotUpdate程序集Copy一份到这个目录下)")]
- public string hotUpdatePath;
- [FormerlySerializedAs("HotUpdateAssemblyDefinitions")] [Header("HotUpdate程序集")]
- public AssemblyDefinitionAsset[] hotUpdateAssemblyDefinitions;
- [FormerlySerializedAs("LinkAssemblyDefinitions")] [Header("指定要生成Link.xml的程序集")]
- public AssemblyDefinitionAsset[] linkAssemblyDefinitions;
- [FormerlySerializedAs("IncludeAssembly")] [Header("生成Link.xml时候默认包含的程序集")]
- public string[] includeAssembly = new[] { "Assembly-CSharp", "Fantasy.Unity" };
- public void OnBeforeSerialize() { }
- public void OnAfterDeserialize() { }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Editor/Runtime/Settings/FantasySettingsScriptableObject.cs.meta b/Assets/Scripts/NBC~/Editor/Runtime/Settings/FantasySettingsScriptableObject.cs.meta
deleted file mode 100644
index b5bae5a80..000000000
--- a/Assets/Scripts/NBC~/Editor/Runtime/Settings/FantasySettingsScriptableObject.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 27a37e930ca3454fb57bc895f50d2106
-timeCreated: 1688277120
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Editor/Runtime/Settings/ScriptableObjectSingleton.cs b/Assets/Scripts/NBC~/Editor/Runtime/Settings/ScriptableObjectSingleton.cs
deleted file mode 100644
index 191948e1b..000000000
--- a/Assets/Scripts/NBC~/Editor/Runtime/Settings/ScriptableObjectSingleton.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-using System;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-using UnityEditorInternal;
-using UnityEngine;
-// ReSharper disable AssignNullToNotNullAttribute
-
-namespace NBC
-{
- public class ScriptableObjectSingleton : ScriptableObject where T : ScriptableObject
- {
- private static T _instance;
-
- public static T Instance
- {
- get
- {
- if (_instance == null)
- {
- _instance = Load();
- }
-
- return _instance;
- }
- }
-
- private static T Load()
- {
- var scriptableObjectPath = GetScriptableObjectPath();
-
- if (string.IsNullOrEmpty(scriptableObjectPath))
- {
- return null;
- }
-
- var loadSerializedFileAndForget = InternalEditorUtility.LoadSerializedFileAndForget(scriptableObjectPath);
-
- if (loadSerializedFileAndForget.Length <= 0)
- {
- return CreateInstance();
- }
-
- return loadSerializedFileAndForget[0] as T;
- }
-
- public static void Save(bool saveAsText = true)
- {
- if (_instance == null)
- {
- Debug.LogError("Cannot save ScriptableObjectSingleton: no instance!");
- return;
- }
-
- var scriptableObjectPath = GetScriptableObjectPath();
-
- if (string.IsNullOrEmpty(scriptableObjectPath))
- {
- return;
- }
-
- var directoryName = Path.GetDirectoryName(scriptableObjectPath);
-
- if (!Directory.Exists(directoryName))
- {
- Directory.CreateDirectory(directoryName);
- }
-
- UnityEngine.Object[] obj = { _instance };
- InternalEditorUtility.SaveToSerializedFileAndForget(obj, scriptableObjectPath, saveAsText);
- }
-
- private static string GetScriptableObjectPath()
- {
- var scriptableObjectPathAttribute = typeof(T).GetCustomAttribute(typeof(ScriptableObjectPathAttribute)) as ScriptableObjectPathAttribute;
- return scriptableObjectPathAttribute?.ScriptableObjectPath;
- }
- }
-
- [AttributeUsage(AttributeTargets.Class, Inherited = false)]
- public class ScriptableObjectPathAttribute : Attribute
- {
- internal readonly string ScriptableObjectPath;
-
- public ScriptableObjectPathAttribute(string scriptableObjectPath)
- {
- if (string.IsNullOrEmpty(scriptableObjectPath))
- {
- throw new ArgumentException("Invalid relative path (it is empty)");
- }
-
- if (scriptableObjectPath[0] == '/')
- {
- scriptableObjectPath = scriptableObjectPath.Substring(1);
- }
-
- ScriptableObjectPath = scriptableObjectPath;
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Editor/Runtime/Settings/ScriptableObjectSingleton.cs.meta b/Assets/Scripts/NBC~/Editor/Runtime/Settings/ScriptableObjectSingleton.cs.meta
deleted file mode 100644
index 5105c6fcc..000000000
--- a/Assets/Scripts/NBC~/Editor/Runtime/Settings/ScriptableObjectSingleton.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 3c77f5208dc14542ae7497d59321ef76
-timeCreated: 1688278016
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Editor/Runtime/WSocket.meta b/Assets/Scripts/NBC~/Editor/Runtime/WSocket.meta
deleted file mode 100644
index 21883b652..000000000
--- a/Assets/Scripts/NBC~/Editor/Runtime/WSocket.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: b9e5c7d1436ec414fa3f69a23aaafc3b
-folderAsset: yes
-DefaultImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Editor/Runtime/WSocket/SettingsWindow.cs b/Assets/Scripts/NBC~/Editor/Runtime/WSocket/SettingsWindow.cs
deleted file mode 100644
index 0313b0e09..000000000
--- a/Assets/Scripts/NBC~/Editor/Runtime/WSocket/SettingsWindow.cs
+++ /dev/null
@@ -1,229 +0,0 @@
-using UnityEngine;
-using UnityEditor;
-using UnityEngine.Networking;
-using System.IO;
-using System;
-
-namespace UnityWebSocket.Editor
-{
- internal class SettingsWindow : EditorWindow
- {
- static SettingsWindow window = null;
- [MenuItem("Tools/UnityWebSocket", priority = 100)]
- internal static void Open()
- {
- if (window != null)
- {
- window.Close();
- }
-
- window = GetWindow(true, "UnityWebSocket");
- window.minSize = window.maxSize = new Vector2(600, 310);
- window.Show();
- window.BeginCheck();
- }
-
- private void OnGUI()
- {
- DrawLogo();
- DrawVersion();
- DrawSeparator(80);
- DrawSeparator(186);
- DrawHelper();
- DrawFooter();
- }
-
- Texture2D logoTex = null;
- private void DrawLogo()
- {
- if (logoTex == null)
- {
- logoTex = new Texture2D(66, 66);
- logoTex.LoadImage(Convert.FromBase64String(LOGO_BASE64.VALUE));
- for (int i = 0; i < 66; i++) for (int j = 0; j < 15; j++) logoTex.SetPixel(i, j, Color.clear);
- logoTex.Apply();
- }
-
- var logoPos = new Rect(10, 10, 66, 66);
- GUI.DrawTexture(logoPos, logoTex);
- var title = "UnityWebSocket";
- var titlePos = new Rect(80, 20, 500, 50);
- GUI.Label(titlePos, title, TextStyle(24));
- }
-
- private void DrawSeparator(int y)
- {
- EditorGUI.DrawRect(new Rect(10, y, 580, 1), Color.white * 0.5f);
- }
-
- private GUIStyle TextStyle(int fontSize = 10, TextAnchor alignment = TextAnchor.UpperLeft, float alpha = 0.85f)
- {
- var style = new GUIStyle();
- style.fontSize = fontSize;
- style.normal.textColor = (EditorGUIUtility.isProSkin ? Color.white : Color.black) * alpha;
- style.alignment = alignment;
- style.richText = true;
- return style;
- }
-
- private void DrawVersion()
- {
- GUI.Label(new Rect(440, 10, 150, 10), "Current Version: " + Settings.VERSION, TextStyle(alignment: TextAnchor.MiddleLeft));
- if (string.IsNullOrEmpty(latestVersion))
- {
- GUI.Label(new Rect(440, 30, 150, 10), "Checking for Updates...", TextStyle(alignment: TextAnchor.MiddleLeft));
- }
- else if (latestVersion == "unknown")
- {
-
- }
- else
- {
- GUI.Label(new Rect(440, 30, 150, 10), "Latest Version: " + latestVersion, TextStyle(alignment: TextAnchor.MiddleLeft));
- if (Settings.VERSION == latestVersion)
- {
- if (GUI.Button(new Rect(440, 50, 150, 18), "Check Update"))
- {
- latestVersion = "";
- changeLog = "";
- BeginCheck();
- }
- }
- else
- {
- if (GUI.Button(new Rect(440, 50, 150, 18), "Update to | " + latestVersion))
- {
- ShowUpdateDialog();
- }
- }
- }
- }
-
- private void ShowUpdateDialog()
- {
- var isOK = EditorUtility.DisplayDialog("UnityWebSocket",
- "Update UnityWebSocket now?\n" + changeLog,
- "Update Now", "Cancel");
-
- if (isOK)
- {
- UpdateVersion();
- }
- }
-
- private void UpdateVersion()
- {
- Application.OpenURL(Settings.GITHUB + "/releases");
- }
-
- private void DrawHelper()
- {
- GUI.Label(new Rect(330, 200, 100, 18), "GitHub:", TextStyle(10, TextAnchor.MiddleRight));
- if (GUI.Button(new Rect(440, 200, 150, 18), "UnityWebSocket"))
- {
- Application.OpenURL(Settings.GITHUB);
- }
-
- GUI.Label(new Rect(330, 225, 100, 18), "Report:", TextStyle(10, TextAnchor.MiddleRight));
- if (GUI.Button(new Rect(440, 225, 150, 18), "Report an Issue"))
- {
- Application.OpenURL(Settings.GITHUB + "/issues/new");
- }
-
- GUI.Label(new Rect(330, 250, 100, 18), "Email:", TextStyle(10, TextAnchor.MiddleRight));
- if (GUI.Button(new Rect(440, 250, 150, 18), Settings.EMAIL))
- {
- var uri = new Uri(string.Format("mailto:{0}?subject={1}", Settings.EMAIL, "UnityWebSocket Feedback"));
- Application.OpenURL(uri.AbsoluteUri);
- }
-
- GUI.Label(new Rect(330, 275, 100, 18), "QQ群:", TextStyle(10, TextAnchor.MiddleRight));
- if (GUI.Button(new Rect(440, 275, 150, 18), Settings.QQ_GROUP))
- {
- Application.OpenURL(Settings.QQ_GROUP_LINK);
- }
- }
-
- private void DrawFooter()
- {
- EditorGUI.DropShadowLabel(new Rect(10, 230, 400, 20), "Developed by " + Settings.AUHTOR);
- EditorGUI.DropShadowLabel(new Rect(10, 250, 400, 20), "All rights reserved");
- }
-
- UnityWebRequest req;
- string changeLog = "";
- string latestVersion = "";
- void BeginCheck()
- {
- EditorApplication.update -= VersionCheckUpdate;
- EditorApplication.update += VersionCheckUpdate;
-
- req = UnityWebRequest.Get(Settings.GITHUB + "/releases/latest");
- req.SendWebRequest();
- }
-
- private void VersionCheckUpdate()
- {
-#if UNITY_2020_3_OR_NEWER
- if (req == null
- || req.result == UnityWebRequest.Result.ConnectionError
- || req.result == UnityWebRequest.Result.DataProcessingError
- || req.result == UnityWebRequest.Result.ProtocolError)
-#elif UNITY_2018_1_OR_NEWER
- if (req == null || req.isNetworkError || req.isHttpError)
-#else
- if (req == null || req.isError)
-#endif
- {
- EditorApplication.update -= VersionCheckUpdate;
- latestVersion = "unknown";
- return;
- }
-
- if (req.isDone)
- {
- EditorApplication.update -= VersionCheckUpdate;
- latestVersion = req.url.Substring(req.url.LastIndexOf("/") + 1).TrimStart('v');
-
- if (Settings.VERSION != latestVersion)
- {
- var text = req.downloadHandler.text;
- var st = text.IndexOf("content=\"" + latestVersion);
- st = st > 0 ? text.IndexOf("\n", st) : -1;
- var end = st > 0 ? text.IndexOf("\" />", st) : -1;
- if (st > 0 && end > st)
- {
- changeLog = text.Substring(st + 1, end - st - 1).Trim();
- changeLog = changeLog.Replace("\r", "");
- changeLog = changeLog.Replace("\n", "\n- ");
- changeLog = "\nCHANGE LOG: \n- " + changeLog + "\n";
- }
- }
-
- Repaint();
- }
- }
- }
-
- internal static class LOGO_BASE64
- {
- internal const string VALUE = "iVBORw0KGgoAAAANSUhEUgAAAEIAAABCCAMAAADUivDaAAAAq1BMVEUAAABKmtcvjtYzl" +
- "9szmNszl9syl9k0mNs0mNwzmNs0mNszl9szl9s0mNs0mNwzmNw0mNwyltk0mNw0mNwzl9s0mNsymNs0mNszmNwzmNwzm" +
- "NszmNs0mNwzl9w0mNwzmNw0mNs0mNs0mNwzl9wzmNs0mNwzmNs0mNwzl90zmNszmNszl9szmNsxmNszmNszmNw0mNwzm" +
- "Nw0mNs2neM4pe41mt43ouo2oOY5qfM+UHlaAAAAMnRSTlMAAwXN3sgI+/069MSCK6M/MA74h9qfFHB8STWMJ9OSdmNcI" +
- "8qya1IeF+/U0EIa57mqmFTYJe4AAAN3SURBVFjD7ZbpkppAFEa/bgVBREF2kEVGFNeZsM77P1kadURnJkr8k1Qlx1Khu" +
- "/pw7+2lwH/+YcgfMBBLG7VocwDamzH+wJBB8Qhjve2f0TdrGwjei6o4Ub/nM/APw5Z7vvSB/qrCrqbD6fBEVtigeMxks" +
- "fX9zWbj+z1jhqgSBplQ50eGo4614WXlRAzgrRhmtSfvxAn7pB0N5ObaKKZZuU5/d37IBcBgUQwqDuf7Z2gUmVAl4NGNr" +
- "/UeHxV5n39ulbaKLI86h6HilmM5M1aN126lpNhtl59yeTsp8nUMvpNC1J3bh5FtfVRk+bJrJunn5d4U4piJ/Vw9eXgsj" +
- "4ZpZaCjg9waZkIpnBWLJ44OwoNu60F2UnSaEkKv4XnAlCpm6B4F/aKMDiyGi2L8SEEAVdxNLuzmgV7nFwObEe2xQVuX+" +
- "RV1lWetga3w+cN1sXgvm4cJH8OEgZC1DPKhfF/BIymmQrMjq/x65FUeEkDup8GxoexZmznHCvANtXU/CAq13yimhQGtm" +
- "H4VCPnBBL1fTKo3CqEcvq7Lb/OwHxWTYlyw+JmjKoVvDLVOQB4pVsM8K8smgvLCxZDlIijwyOEc+nr/msMwK0+GQWGBd" +
- "tmhjv8icTds1s2ammaFh04QLLe69NK7guP6mTDMaw3o6nAX/Z7EXUskPSvWEWg4srVlp5NTDXv9Lce9HGN5eeG4nj5Yz" +
- "ACteU2wQLo4MBtJfd1nw5nG1/s9zwUQ6pykL1TQjqdeuvQW0naz2XKLYL4Cwzr4vj+OQdD96CSp7Lrynp4aeFF0xdm5q" +
- "6OFtFfPv7URxpWJNjd/N+3+I9+1klMav12Qtgbt9R2JaIopjkzaPtOFq4KxUpqfUMSFnQrySWjLoQzRZS4HMH84ME1ej" +
- "S1YJpQZ3B+sR1uCQJSBdGdCk1eAEgORR88KK05W8dh2MA+A/SKCYu3mCJ0Ek7HBx4HHeuwYy5G3x8hSMTJcOMFbinCsn" +
- "hO1V1aszGULvA0g4UFsb4VA0hAFcyo6cgLsAoT7uUtGAH5wQKQle0wuLyxLTaNyJEYwxw4wSljLK1TP8CAaOyhBMMEsj" +
- "OBoXgo7VGElFkSWL+vef1RF2YNXeRWYzQBTpkhC8KaZHhuIogArkQLKClBZjU26B2IZgGz+cpZkHl8g3fYUaW/YP2kb2" +
- "M/V97JY/vZN859n+QmO7XtC9Bf2jAAAAABJRU5ErkJggg==";
- }
-}
diff --git a/Assets/Scripts/NBC~/Editor/Runtime/WSocket/SettingsWindow.cs.meta b/Assets/Scripts/NBC~/Editor/Runtime/WSocket/SettingsWindow.cs.meta
deleted file mode 100644
index 741246883..000000000
--- a/Assets/Scripts/NBC~/Editor/Runtime/WSocket/SettingsWindow.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 902614e06186a482f9e816e1d1984547
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/LICENSE b/Assets/Scripts/NBC~/LICENSE
deleted file mode 100644
index 3c5a71991..000000000
--- a/Assets/Scripts/NBC~/LICENSE
+++ /dev/null
@@ -1,12 +0,0 @@
-MIT License
-
-Copyright (c) 2023 qq362946
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-However, the following entity is explicitly prohibited from using, copying, modifying, or distributing the Software or any of its portions:
-
-泰课在线(https://www.taikr.com/)
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/Assets/Scripts/NBC~/LICENSE.meta b/Assets/Scripts/NBC~/LICENSE.meta
deleted file mode 100644
index b6fff377d..000000000
--- a/Assets/Scripts/NBC~/LICENSE.meta
+++ /dev/null
@@ -1,7 +0,0 @@
-fileFormatVersion: 2
-guid: e68ec9986245d4ecfa0445bda8a7868d
-DefaultImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/README.md b/Assets/Scripts/NBC~/README.md
deleted file mode 100644
index 09d1c5ebf..000000000
--- a/Assets/Scripts/NBC~/README.md
+++ /dev/null
@@ -1,45 +0,0 @@
-# Fantasy
-#### Fantasy是基于.NET的高性能网络开发框架,支持主流协议,前后端分离。
-#### 支持Unity/Godot/WinFrom/WPF/Console等C#客户端接入。
-#### 框架支持TCP\KCP\WebSocket\http(支持Unity发布成H5)三种网络协议。
-#### 适合需要快速上手、可扩展、分布式全平台商业级解决方案的框架。
-## 导航
-* [Fantasy介绍网站](https://www.code-fantasy.com/)
-* [Fantasy的API文档](https://www.code-fantasy.com/doc/api/Fantasy.html)
-* [入门视频观看地址](https://space.bilibili.com/382126312)
-## 快速上手
-* 01.快速入门
- * [1.1.获得Fantasy](https://www.code-fantasy.com/top/download-fantasy/)
- * [1.2.配置文件](https://www.code-fantasy.com/top/config-file/)
- * [1.3.Fantasy的网络](https://www.code-fantasy.com/top/use-network/)
- * [1.4.Fantasy的配置文件](https://www.code-fantasy.com/top/config-file/)
- * [1.5.Fantasy的命令行参数](https://www.code-fantasy.com/top/command-line-parameter/)
- * [1.6.如何升级到最新版](https://www.code-fantasy.com/top/upgrade/)
-* 02.网络通信
- * [2.1.配置网络协议](https://www.code-fantasy.com/network/network-protocols/)
- * [2.2.客户端服务器之间发送消息](https://www.code-fantasy.com/network/session/)
- * [2.3.服务器之间发送消息](https://www.code-fantasy.com/network/networkmessagingomponent/)
- * [2.4.Route通信协议](https://www.code-fantasy.com/network/network-route/)
- * [2.5.Addressable通信协议](https://www.code-fantasy.com/network/network-addressable/)
-* 03.系统组件
- * [3.1.ECS系统](https://www.code-fantasy.com/core/ecs/)
- * [3.2.事件系统](https://www.code-fantasy.com/core/event/)
- * [3.3.任务系统](https://www.code-fantasy.com/core/task/)
- * [3.4.异步协程锁](https://www.code-fantasy.com/core/lock/)
- * [3.5.数据库](https://www.code-fantasy.com/core/db/)
-* [更新日志](https://www.code-fantasy.com/changelog/)
-* [API文档](https://www.code-fantasy.com/doc/api/Fantasy.html)
-* [常见问题](https://www.code-fantasy.com/question/)
-
-## 优质开源项目推荐
-#### ET - ET框架是一整套完善的游戏开发框架。
-#### TEngine - TEngine是一个简单(新手友好开箱即用)且强大的Unity框架全平台解决方案。
-#### Legends-Of-Heroes - 一个LOL风格的球球大作战游戏,基于ET,使用状态同步。
-## 交流与讨论:
-__讨论QQ群 : Fantasy服务器开发交流群 569888673 __
-## 特别鸣谢
-
-感谢JetBrains公司提供的使用许可证!
-
-
-
diff --git a/Assets/Scripts/NBC~/README.md.meta b/Assets/Scripts/NBC~/README.md.meta
deleted file mode 100644
index 2ef7b6e78..000000000
--- a/Assets/Scripts/NBC~/README.md.meta
+++ /dev/null
@@ -1,7 +0,0 @@
-fileFormatVersion: 2
-guid: cf5443fd5b0e44724945a38cbd0fde13
-TextScriptImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Runtime.meta b/Assets/Scripts/NBC~/Runtime.meta
deleted file mode 100644
index b559b1691..000000000
--- a/Assets/Scripts/NBC~/Runtime.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: d4180ba95bb674e6488cd44665e784d6
-folderAsset: yes
-DefaultImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Runtime/Asset.meta b/Assets/Scripts/NBC~/Runtime/Asset.meta
deleted file mode 100644
index 16bd05317..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: 7148f149eca74238a06cee662839e8bf
-folderAsset: yes
-DefaultImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Editor.meta b/Assets/Scripts/NBC~/Runtime/Asset/Editor.meta
deleted file mode 100644
index f0d93c228..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Editor.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: 57b93d152d45c8e4db2b93e67f13f4b2
-folderAsset: yes
-DefaultImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime.meta
deleted file mode 100644
index 7ba7c0d97..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: e949dff72c03bd94a86fb9fcb59cfcff
-folderAsset: yes
-DefaultImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address.meta
deleted file mode 100644
index 75f254523..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 15d567bba8474e428130cba9e1280371
-timeCreated: 1675820358
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Addressable.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Addressable.cs
deleted file mode 100644
index 500f72d3d..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Addressable.cs
+++ /dev/null
@@ -1,149 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-#if UNITY_EDITOR
-using System.Reflection;
-#endif
-
-namespace NBC.Asset
-{
- public interface IAddressableImpl
- {
- public void Load();
- void UpdateBundleInfo(string bundleName);
- VersionData GetVersionData();
- PackageData GetPackageData(string packageName);
- AssetInfo GetAssetInfo(string path, Type type);
- BundleInfo GetBundleInfo(AssetInfo assetInfo);
- BundleInfo GetBundleInfo(BundleData bundleData);
- BundleInfo[] GetAllBundleInfo();
- BundleInfo[] GetAllDependBundleInfos(AssetInfo assetInfo);
- }
-
- internal static class Addressable
- {
- public static Func CreateHandler { get; set; } = AddressableRuntimeImpl.CreateInstance;
- private static IAddressableImpl _impl;
-
- public static void Load()
- {
- CreateHandlerImpl();
- _impl.Load();
- }
-
- public static void UpdateBundleInfo(string bundleName)
- {
- _impl.UpdateBundleInfo(bundleName);
- }
-
- #region Version
-
- public static VersionData GetVersionData()
- {
- return _impl.GetVersionData();
- }
-
- public static PackageData GetPackageData(string packageName)
- {
- return _impl.GetPackageData(packageName);
- }
-
- #endregion
-
- #region Asset
-
- public static AssetInfo GetAssetInfo(string path, Type type)
- {
- return _impl.GetAssetInfo(path, type);
- }
-
- #endregion
-
- #region Bundle
-
- public static BundleInfo GetBundleInfo(AssetInfo assetInfo)
- {
- return _impl.GetBundleInfo(assetInfo);
- }
-
- public static BundleInfo GetBundleInfo(BundleData bundleData)
- {
- return _impl.GetBundleInfo(bundleData);
- }
-
- public static BundleInfo[] GetAllBundleInfo()
- {
- return _impl.GetAllBundleInfo();
- }
-
- public static BundleInfo[] GetAllDependBundleInfos(AssetInfo assetInfo)
- {
- return _impl.GetAllDependBundleInfos(assetInfo);
- }
-
- ///
- /// 获取当前版本可以解压到本地缓存的bundle包
- ///
- ///
- public static BundleInfo[] GetCanUnpackBundles()
- {
- var bundles = GetAllBundleInfo();
- return bundles.Where(bundle => bundle.LoadMode == BundleLoadMode.LoadFromStreaming).ToArray();
- }
-
- ///
- /// 获取当前版本可以下载到本地的bundle包
- ///
- ///
- public static BundleInfo[] GetCanDownloadBundles()
- {
- var bundles = GetAllBundleInfo();
- return bundles.Where(bundle => bundle.LoadMode == BundleLoadMode.LoadFromRemote).ToArray();
- }
-
- #endregion
-
- #region 内部方法
-
- private static void CreateHandlerImpl()
- {
-#if UNITY_EDITOR
- if (Const.Simulate)
- {
- _impl = GetAddressableEditImpl();
- return;
- }
-#endif
- _impl = CreateHandler();
- }
-
-#if UNITY_EDITOR
- ///
- /// 通过反射,实例化editor下的接口实现
- ///
- ///
- private static IAddressableImpl GetAddressableEditImpl()
- {
- var ass = AppDomain.CurrentDomain.GetAssemblies()
- .First(assembly => assembly.GetName().Name == "NBC.Asset.Editor");
- var type = ass.GetType("NBC.Asset.Editor.AddressableEditImpl");
- var manifestFilePath = InvokePublicStaticMethod(type, "CreateInstance") as IAddressableImpl;
- return manifestFilePath;
- }
-
- private static object InvokePublicStaticMethod(System.Type type, string method, params object[] parameters)
- {
- var methodInfo = type.GetMethod(method, BindingFlags.Public | BindingFlags.Static);
- if (methodInfo == null)
- {
- UnityEngine.Debug.LogError($"{type.FullName} not found method : {method}");
- return null;
- }
-
- return methodInfo.Invoke(null, parameters);
- }
-#endif
-
- #endregion
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Addressable.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Addressable.cs.meta
deleted file mode 100644
index a8b16b165..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Addressable.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: ef00a85e62d14d759a4b4cc90d922e44
-timeCreated: 1675932162
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/AddressableRuntimeImpl.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/AddressableRuntimeImpl.cs
deleted file mode 100644
index 77ebc66d4..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/AddressableRuntimeImpl.cs
+++ /dev/null
@@ -1,164 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using UnityEngine;
-
-namespace NBC.Asset
-{
- internal class AddressableRuntimeImpl : IAddressableImpl
- {
- public static IAddressableImpl CreateInstance()
- {
- return new AddressableRuntimeImpl();
- }
-
- private VersionDataReader _versionDataReader;
-
- private readonly Dictionary _assetInfos = new Dictionary();
- private readonly Dictionary _bundleInfos = new Dictionary();
-
- #region Init
-
- public void Load()
- {
- _versionDataReader = new VersionDataReader();
- }
-
- #endregion
-
- #region manifest Data
-
- public VersionData GetVersionData()
- {
- return _versionDataReader.VersionData;
- }
-
- public PackageData GetPackageData(string packageName)
- {
- return _versionDataReader.PackageDataList.Find(p => p.Name == packageName);
- }
-
- #endregion
-
- #region Assets
-
- public AssetInfo GetAssetInfo(string path, Type type)
- {
- path = _versionDataReader.GetAssetRealPath(path);
- var guid = Util.GetAssetGUID(path, type);
- if (!_assetInfos.TryGetValue(guid, out var info))
- {
- var data = _versionDataReader.GetAsset(path);
- if (data != null)
- {
- info = new AssetInfo(data, type);
- _assetInfos[info.GUID] = info;
- }
- }
-
- return info;
- }
-
- #endregion
-
- #region Bundles
-
- ///
- /// 刷新bundle相关信息
- ///
- public void UpdateBundleInfo(string bundleName)
- {
- if (string.IsNullOrEmpty(bundleName))
- {
- foreach (var bundle in _bundleInfos.Values)
- {
- bundle.LoadMode = GetBundleLoadMode(bundle.Bundle);
- }
- }
- else
- {
- if (_bundleInfos.TryGetValue(bundleName, out var bundleInfo))
- {
- bundleInfo.LoadMode = GetBundleLoadMode(bundleInfo.Bundle);
- }
- }
- }
-
- public BundleInfo GetBundleInfo(AssetInfo assetInfo)
- {
- var bundleData = _versionDataReader.GetBundleByAsset(assetInfo.Path);
- return GetBundleInfo(bundleData);
- }
-
- public BundleInfo GetBundleInfo(BundleData bundleData)
- {
- if (bundleData == null)
- throw new Exception("BundleData NOT NULL!");
- if (!_bundleInfos.TryGetValue(bundleData.Name, out var bundleInfo))
- {
- bundleInfo = CreateBundleInfo(bundleData);
- }
-
- return bundleInfo;
- }
-
- public BundleInfo[] GetAllBundleInfo()
- {
- var bundles = _versionDataReader.GetAllBundle();
- List list = new List(bundles.Count);
- foreach (var bundle in bundles)
- {
- list.Add(GetBundleInfo(bundle));
- }
-
- return list.ToArray();
- }
-
- public BundleInfo[] GetAllDependBundleInfos(AssetInfo assetInfo)
- {
- var arr = _versionDataReader.GetAllDependBundle(assetInfo.Path);
- if (arr != null)
- {
- List list = new List();
- foreach (var bundle in arr)
- {
- list.Add(GetBundleInfo(bundle));
- }
-
- return list.ToArray();
- }
-
- return Array.Empty();
- }
-
-
- private BundleInfo CreateBundleInfo(BundleData bundleData)
- {
- var bundleInfo = new BundleInfo(bundleData)
- {
- LoadMode = GetBundleLoadMode(bundleData)
- };
- _bundleInfos[bundleData.Name] = bundleInfo;
- return bundleInfo;
- }
-
- private BundleLoadMode GetBundleLoadMode(BundleData bundleData)
- {
- if (File.Exists(bundleData.CachedDataFilePath))
- {
- return BundleLoadMode.LoadFromCache;
- }
-
-
- if (StreamingAssetsUtil.FileExists(bundleData.NameHash))
- {
- return BundleLoadMode.LoadFromStreaming;
- }
-
- return BundleLoadMode.LoadFromRemote;
- }
-
- #endregion
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/AddressableRuntimeImpl.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/AddressableRuntimeImpl.cs.meta
deleted file mode 100644
index 173a9ba28..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/AddressableRuntimeImpl.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 4ad9800ddd244d50b5d4c7bc18f578b9
-timeCreated: 1677723858
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data.meta
deleted file mode 100644
index a2ed2cb0f..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 017fad8ee8a545caa126cdaad404c93d
-timeCreated: 1677636239
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/AssetData.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/AssetData.cs
deleted file mode 100644
index 34fb851fe..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/AssetData.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace NBC.Asset
-{
- [Serializable]
- public class AssetData
- {
- public string Name;
- public int Bundle;
-
- ///
- /// 所属目录
- ///
- public int Dir;
-
- // ///
- // /// 依赖的bundle
- // ///
- // public List Deps = new List();
-
- ///
- /// 资源可寻址地址
- ///
- public string Address;
-
- ///
- /// 资源真实地址
- ///
- public string Path { get; set; }
-
-
- ///
- /// 资源Bundle
- ///
- public string BundleName { get; set; }
-
-
- public string[] Tags { get; internal set; }
-
- ///
- /// 是否包含Tag
- ///
- public bool HasTag(string[] tags)
- {
- if (tags == null || tags.Length == 0)
- return false;
- if (Tags == null || Tags.Length == 0)
- return false;
-
- foreach (var tag in tags)
- {
- if (Tags.Contains(tag))
- return true;
- }
-
- return false;
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/AssetData.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/AssetData.cs.meta
deleted file mode 100644
index e7488593a..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/AssetData.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 591cdedd5ee84c1c98d1d80d4c8f44fc
-timeCreated: 1677230741
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/BundleData.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/BundleData.cs
deleted file mode 100644
index ae7246773..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/BundleData.cs
+++ /dev/null
@@ -1,114 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace NBC.Asset
-{
- [Serializable]
- public class BundleData
- {
- public string Name;
- public string Hash;
- public int Size;
-
- // ///
- // /// 加载方法
- // ///
- // public byte LoadMethod;
-
- ///
- /// 资源包的分类标签
- ///
- public string[] Tags;
-
- ///
- /// 依赖的bundleId
- ///
- public List Deps = new List();
-
- ///
- /// 所属的包裹名称
- ///
- public string PackageName { set; get; }
-
- public List DependBundles { get; private set; } = new List();
-
- private string _nameHash = string.Empty;
-
- public string NameHash
- {
- get
- {
- if (!string.IsNullOrEmpty(_nameHash)) return _nameHash;
- _nameHash = Util.NameAddHash(Name, Hash);
- return _nameHash;
- }
- }
-
-
- ///
- /// 内置文件路径
- ///
- private string _streamingFilePath;
-
- public string StreamingFilePath
- {
- get
- {
- if (string.IsNullOrEmpty(_streamingFilePath) == false)
- return _streamingFilePath;
-
- _streamingFilePath = Const.GetStreamingPath(NameHash);
- return _streamingFilePath;
- }
- }
-
- ///
- /// 缓存的数据文件路径
- ///
- private string _cachedDataFilePath;
-
- public string CachedDataFilePath
- {
- get
- {
- if (string.IsNullOrEmpty(_cachedDataFilePath) == false)
- return _cachedDataFilePath;
- _cachedDataFilePath = Const.GetCachePath(NameHash);
- return _cachedDataFilePath;
- }
- }
-
- ///
- /// 远程的数据文件路径
- ///
- private string _remoteDataFilePath;
-
- public string RemoteDataFilePath
- {
- get
- {
- if (string.IsNullOrEmpty(_remoteDataFilePath) == false)
- return _remoteDataFilePath;
- _remoteDataFilePath = Const.GetRemotePath(NameHash);
- return _remoteDataFilePath;
- }
- }
-
- ///
- /// 临时的数据文件路径
- ///
- private string _tempDataFilePath;
-
- public string TempDataFilePath
- {
- get
- {
- if (string.IsNullOrEmpty(_tempDataFilePath) == false)
- return _tempDataFilePath;
-
- _tempDataFilePath = $"{CachedDataFilePath}.temp";
- return _tempDataFilePath;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/BundleData.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/BundleData.cs.meta
deleted file mode 100644
index 78d158e64..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/BundleData.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: de6f2556c6e147afb0269b9ca02c6260
-timeCreated: 1677230723
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/PackageData.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/PackageData.cs
deleted file mode 100644
index ab8cbc87c..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/PackageData.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace NBC.Asset
-{
- [Serializable]
- public class PackageData
- {
- public string Name;
- public int Def;
- public List Dirs;
- public List Assets;
- public List Bundles;
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/PackageData.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/PackageData.cs.meta
deleted file mode 100644
index ac95494d6..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/PackageData.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 10936edd968649ecbf4b7a1bb20e84cf
-timeCreated: 1678156381
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/VersionData.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/VersionData.cs
deleted file mode 100644
index 389f94e30..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/VersionData.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace NBC.Asset
-{
- // [Serializable]
- // public class VersionPackagesData
- // {
- // public string Ver;
- // public string Name;
- // public string Hash;
- // public int Size;
- // public int Def;
- // public string NameHash => $"{Name}_{Hash}.json";
- // }
- //
- // [Serializable]
- // public class VersionData
- // {
- // ///
- // /// app版本号
- // ///
- // public string AppVer;
- //
- // ///
- // /// 版本包
- // ///
- // public List Packages = new List();
- //
- // ///
- // /// 导出时间
- // ///
- // public long BuildTime;
- // }
-
- [Serializable]
- public class VersionPackageData
- {
- public List Packages = new List();
- }
-
- [Serializable]
- public class VersionData
- {
- ///
- /// app版本号
- ///
- public string AppVer;
-
- ///
- /// 版本包hash
- ///
- public string Hash;
-
- public long Size;
- ///
- /// 导出时间
- ///
- public long BuildTime;
-
- public string NameHash => $"packages_{Hash}.json";
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/VersionData.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/VersionData.cs.meta
deleted file mode 100644
index 78c819923..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/VersionData.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 671aac8f73924f1bae2ef7753fb6b239
-timeCreated: 1675820403
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/VersionDataReader.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/VersionDataReader.cs
deleted file mode 100644
index 695c8e76c..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/VersionDataReader.cs
+++ /dev/null
@@ -1,139 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using UnityEngine;
-
-namespace NBC.Asset
-{
- internal class VersionDataReader
- {
- private readonly Dictionary _bundles = new Dictionary();
-
- private readonly Dictionary _assets = new Dictionary();
- private readonly Dictionary _addressablePath = new Dictionary();
- public VersionData VersionData { get; private set; }
-
- public List PackageDataList { get; private set; } = new List();
-
- public VersionDataReader()
- {
- ReadVersionData();
- }
-
- public string GetAssetRealPath(string path)
- {
- return _addressablePath.TryGetValue(path, out var realPath) ? realPath : path;
- }
-
- public AssetData GetAsset(string path)
- {
- return _assets.TryGetValue(path, out var assetRef) ? assetRef : null;
- }
-
- public List GetAllBundle()
- {
- List list = new List(_bundles.Count);
- list.AddRange(_bundles.Values);
- return list;
- }
-
- public BundleData GetBundle(string name)
- {
- return _bundles.TryGetValue(name, out var bundleRef) ? bundleRef : null;
- }
-
- public BundleData GetBundleByAsset(string assetPath)
- {
- var asset = GetAsset(assetPath);
- return asset == null ? null : GetBundle(asset.BundleName);
- }
-
- ///
- /// 获取资源所需的所有bundle信息(下标0为所在包)
- ///
- /// 资源原始地址
- ///
- public BundleData[] GetAllDependBundle(string path)
- {
- if (_assets.TryGetValue(path, out var assetData))
- {
- if (_bundles.TryGetValue(assetData.BundleName, out var bundleData))
- {
- var needBundle = new List { bundleData };
- needBundle.AddRange(bundleData.DependBundles.Select(bundle => _bundles[bundle]));
- return needBundle.ToArray();
- }
- }
-
- return Array.Empty();
- }
-
- private void ReadVersionData()
- {
- VersionData = ReadJson(Const.VersionFileName);
- if (VersionData != null)
- {
- var packageData =
- ReadJson(VersionData.NameHash);
- if (packageData != null)
- {
- foreach (var package in packageData.Packages)
- {
- ReadPackage(package);
- }
- }
- }
- else
- {
- Debug.LogError("version data is null");
- }
- }
-
- private void ReadPackage(PackageData packageData)
- {
- if (packageData != null)
- {
- foreach (var bundle in packageData.Bundles)
- {
- foreach (var dep in bundle.Deps)
- {
- var depBundle = packageData.Bundles[dep];
- if (depBundle != null)
- {
- bundle.DependBundles.Add(depBundle.Name);
- }
- }
-
- bundle.PackageName = packageData.Name;
- _bundles[bundle.Name] = bundle;
- }
-
- foreach (var asset in packageData.Assets)
- {
- if (asset.Dir < 0 || asset.Dir >= packageData.Dirs.Count) continue;
- if (asset.Bundle < 0 || asset.Bundle >= packageData.Bundles.Count) continue;
- var dir = packageData.Dirs[asset.Dir];
- var bundle = packageData.Bundles[asset.Bundle];
- asset.Path = $"{dir}/{asset.Name}";
- asset.BundleName = bundle.Name;
- _assets[asset.Path] = asset;
- var filePath = $"{dir}/{Path.GetFileNameWithoutExtension(asset.Name)}";
- //去除后缀后,默认加入寻址
- _addressablePath[filePath] = asset.Path;
- if (asset.Address != asset.Path)
- {
- _addressablePath[asset.Address] = asset.Path;
- }
- }
-
- PackageDataList.Add(packageData);
- }
- }
-
- private T ReadJson(string fileName) where T : new()
- {
- return Util.ReadJson(Const.GetCachePath(fileName));
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/VersionDataReader.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/VersionDataReader.cs.meta
deleted file mode 100644
index 56c1e6343..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Data/VersionDataReader.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: df6f17d0c94e4f9ca2145fab20c9052f
-timeCreated: 1678083955
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Info.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Info.meta
deleted file mode 100644
index f3539ddbc..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Info.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: d09538ede05f44e185e003b29093c3c3
-timeCreated: 1677723806
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Info/AssetInfo.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Info/AssetInfo.cs
deleted file mode 100644
index c740eab59..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Info/AssetInfo.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-using System;
-
-namespace NBC.Asset
-{
- public class AssetInfo
- {
- private readonly AssetData _assetData;
-
- // public AssetData Data => _assetData;
-
- ///
- /// 资源路径
- ///
- public string Path { private set; get; }
-
- ///
- /// 资源类型
- ///
- public Type AssetType { private set; get; }
-
-
- private string _providerGUID;
-
- ///
- /// 唯一标识符
- ///
- public string GUID
- {
- get
- {
- if (!string.IsNullOrEmpty(_providerGUID))
- return _providerGUID;
-
- _providerGUID = Util.GetAssetGUID(Path, AssetType);
- return _providerGUID;
- }
- }
-
- public AssetInfo(AssetData assetData, System.Type assetType)
- {
- if (assetData == null)
- throw new Exception("assetData is null!");
-
- _assetData = assetData;
- AssetType = assetType;
- Path = assetData.Path;
- }
-
- public AssetInfo(AssetData assetData)
- {
- if (assetData == null)
- throw new System.Exception("assetData is null!");
-
- _assetData = assetData;
- AssetType = null;
- Path = assetData.Path;
- }
-
- public bool HasTag(string[] tags)
- {
- return _assetData.HasTag(tags);
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Info/AssetInfo.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Info/AssetInfo.cs.meta
deleted file mode 100644
index c55c015c9..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Info/AssetInfo.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 7edf10c26d554a3d8c03c099062093dd
-timeCreated: 1676965484
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Info/BundleInfo.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Info/BundleInfo.cs
deleted file mode 100644
index e8d7f4721..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Info/BundleInfo.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-namespace NBC.Asset
-{
- public class BundleInfo
- {
- public readonly BundleData Bundle;
- public BundleLoadMode LoadMode;
-
-
- public BundleInfo(BundleData bundleData)
- {
- Bundle = bundleData;
- }
-
- ///
- /// 资源地址
- ///
- public string BundlePath
- {
- get
- {
- if (LoadMode == BundleLoadMode.LoadFromStreaming)
- {
- return Bundle.StreamingFilePath;
- }
-
- if (LoadMode == BundleLoadMode.LoadFromCache)
- {
- return Bundle.CachedDataFilePath;
- }
-
- if (LoadMode == BundleLoadMode.LoadFromRemote)
- {
- return Bundle.RemoteDataFilePath;
- }
-
- return string.Empty;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Info/BundleInfo.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Info/BundleInfo.cs.meta
deleted file mode 100644
index 11bd4f7eb..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Address/Info/BundleInfo.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 5a2f72ad8fc649bc805449e37b9540f2
-timeCreated: 1677118210
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset.meta
deleted file mode 100644
index cc15f6c2b..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: c3d07e0b392948a6952e05b39d689112
-timeCreated: 1676356201
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders.meta
deleted file mode 100644
index 958c266c4..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: e23bf04f44304300ad16382736556ec2
-timeCreated: 1677058068
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/AssetLoadFromDatabase.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/AssetLoadFromDatabase.cs
deleted file mode 100644
index 0f4f6e6dd..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/AssetLoadFromDatabase.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-namespace NBC.Asset
-{
- internal class AssetLoadFromDatabase : IAssetLoader
- {
- public static IAssetLoader CreateInstance()
- {
- return new AssetLoadFromDatabase();
- }
-
- private AssetProvider _provider;
-
- public void Start(AssetProvider provider)
- {
- _provider = provider;
- }
-
- public void Update()
- {
-#if UNITY_EDITOR
- var assetInfo = _provider.AssetInfo;
- var path = assetInfo.Path;
- string guid = UnityEditor.AssetDatabase.AssetPathToGUID(path);
- if (string.IsNullOrEmpty(guid))
- {
- _provider.SetStatus(NTaskStatus.Success, $"Not found asset : {path}");
- return;
- }
-
- UnityEngine.Object obj;
- if (assetInfo.AssetType == null)
- obj = UnityEditor.AssetDatabase.LoadMainAssetAtPath(assetInfo.Path);
- else
- obj = UnityEditor.AssetDatabase.LoadAssetAtPath(assetInfo.Path, assetInfo.AssetType);
-
- if (obj == null)
- {
- _provider.SetStatus(NTaskStatus.Fail);
- }
- else
- {
- _provider.Asset = obj;
- _provider.SetStatus(NTaskStatus.Success);
- }
-#endif
- }
-
- public void WaitForAsyncComplete()
- {
- Update();
- }
-
- public void Destroy()
- {
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/AssetLoadFromDatabase.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/AssetLoadFromDatabase.cs.meta
deleted file mode 100644
index 66e3c9599..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/AssetLoadFromDatabase.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 73a25ea4518949d28d090a974722dbee
-timeCreated: 1678286041
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/AssetLoaderFromBundle.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/AssetLoaderFromBundle.cs
deleted file mode 100644
index de5d508f5..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/AssetLoaderFromBundle.cs
+++ /dev/null
@@ -1,144 +0,0 @@
-using UnityEngine;
-
-namespace NBC.Asset
-{
- internal class AssetLoaderFromBundle : IAssetLoader
- {
- public static IAssetLoader CreateInstance()
- {
- return new AssetLoaderFromBundle();
- }
-
- private enum Steps
- {
- LoadDependency,
- LoadAsset,
- }
-
- private AssetProvider _provider;
- private AssetInfo _assetInfo;
-
- private AssetBundleRequest _cacheRequest;
- private Dependency _dependency;
- private Steps _steps = Steps.LoadDependency;
- private bool _isWaitForAsyncComplete;
-
- private AssetBundleRequest _assetBundleRequest;
- public AssetBundle _assetBundle;
-
- public void Start(AssetProvider provider)
- {
- _provider = provider;
- _assetInfo = provider.AssetInfo;
-
- _dependency = Dependency.GetAssetDependency(_assetInfo);
- _dependency.Retain();
- }
-
- public void Update()
- {
- if (_steps == Steps.LoadDependency)
- {
- if (_isWaitForAsyncComplete)
- {
- _dependency.WaitForAsyncComplete();
- }
-
- if (!_dependency.IsDone) return;
-
- if (!_dependency.IsSucceed)
- {
- Debug.LogError("error");
- SetStatus("dependency fail");
- }
-
- var provider = _dependency.GetMainBundledProvider();
- if (provider != null && provider.AssetBundle != null)
- {
- _assetBundle = provider.AssetBundle;
-
- if (_isWaitForAsyncComplete)
- {
- if (_provider.IsAll)
- {
- SetStatus(_assetBundle.LoadAssetWithSubAssets(_assetInfo.Path, _assetInfo.AssetType));
- }
- else
- {
- SetStatus(_assetBundle.LoadAsset(_assetInfo.Path, _assetInfo.AssetType));
- }
- }
- else
- {
- _assetBundleRequest = _provider.IsAll
- ? _assetBundle.LoadAssetWithSubAssetsAsync(_assetInfo.Path, _assetInfo.AssetType)
- : _assetBundle.LoadAssetAsync(_assetInfo.Path, _assetInfo.AssetType);
- _steps = Steps.LoadAsset;
- }
- }
- else
- {
- //失败,后续补全失败逻辑
- Debug.LogError("error1");
- SetStatus("error");
- }
- }
- else if (_steps == Steps.LoadAsset)
- {
- if (!_assetBundleRequest.isDone) return;
- if (_provider.IsAll)
- {
- SetStatus(_assetBundleRequest.allAssets);
- }
- else
- {
- SetStatus(_assetBundleRequest.asset);
- }
- }
- }
-
- public void WaitForAsyncComplete()
- {
- _isWaitForAsyncComplete = true;
-
- int frame = 1000;
- while (true)
- {
- frame--;
- if (frame == 0)
- {
- break;
- }
-
- Update();
-
- if (_provider.IsDone)
- break;
- }
- }
-
- public void Destroy()
- {
- _dependency.Release();
- _assetBundleRequest = null;
- }
-
-
- private void SetStatus(Object asset)
- {
- _provider.Asset = asset;
- _provider.SetStatus(NTaskStatus.Success);
- }
-
- private void SetStatus(Object[] allAsset)
- {
- _provider.AllAsset = allAsset;
- _provider.SetStatus(NTaskStatus.Success);
- }
-
- private void SetStatus(string error)
- {
- _provider.SetStatus(NTaskStatus.Fail, error);
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/AssetLoaderFromBundle.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/AssetLoaderFromBundle.cs.meta
deleted file mode 100644
index b739eee57..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/AssetLoaderFromBundle.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 4f15a2f6e208403e8e55d45dc7e01fd1
-timeCreated: 1677551825
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/BundleLoaderFromDownload.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/BundleLoaderFromDownload.cs
deleted file mode 100644
index 5ebf9d594..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/BundleLoaderFromDownload.cs
+++ /dev/null
@@ -1,113 +0,0 @@
-using UnityEngine;
-
-namespace NBC.Asset
-{
- internal class BundleLoaderFromDownload : IBundleLoader
- {
- private enum Steps
- {
- Download,
- Load,
- Check,
- Done,
- }
-
- private BundledProvider _provider;
- private Steps _steps = Steps.Download;
- private AssetBundleCreateRequest _createRequest;
- private string _downloadPath;
- private string _loadPath;
- private bool _isWaitForAsyncComplete;
- private DownloadFileTask _downloadFileTask;
-
- public AssetBundle Bundle { set; get; }
-
- public void Start(BundledProvider provider)
- {
- _provider = provider;
- var bundleData = provider.BundleInfo.Bundle;
- _downloadPath = bundleData.RemoteDataFilePath;
- _loadPath = bundleData.CachedDataFilePath;
- _downloadFileTask = new DownloadFileTask(_downloadPath, bundleData.CachedDataFilePath);
- _downloadFileTask.Run();
- }
-
- public void Update()
- {
- if (_steps == Steps.Download)
- {
- if (!_downloadFileTask.IsDone) return;
- Addressable.UpdateBundleInfo(_provider.BundleInfo.Bundle.Name);
- _steps = Steps.Load;
- }
-
- if (_steps == Steps.Load)
- {
- if (_isWaitForAsyncComplete)
- Bundle = AssetBundle.LoadFromFile(_loadPath);
- else
- _createRequest = AssetBundle.LoadFromFileAsync(_loadPath);
- _steps = Steps.Check;
- }
-
- if (_steps == Steps.Check)
- {
- if (_createRequest != null)
- {
- if (_isWaitForAsyncComplete)
- {
- Bundle = _createRequest.assetBundle;
- }
- else
- {
- if (!_createRequest.isDone)
- return;
- Bundle = _createRequest.assetBundle;
- }
- }
-
- if (Bundle == null)
- {
- _steps = Steps.Done;
- _provider.SetStatus(NTaskStatus.Fail,
- $"failed load assetBundle : {_provider.BundleInfo.Bundle.Name}");
- Debug.LogError(_provider.ErrorMsg);
- }
- else
- {
- _provider.SetStatus(NTaskStatus.Success);
- _provider.AssetBundle = Bundle;
- _steps = Steps.Done;
- }
- }
- }
-
- public void WaitForAsyncComplete()
- {
- _isWaitForAsyncComplete = true;
-
- int frame = 1000;
- while (true)
- {
- // 保险机制
- frame--;
- if (frame == 0)
- {
- break;
- }
-
- Update();
- _downloadFileTask.Process();
-
- if (_provider.IsDone)
- break;
- }
- }
-
- public void Destroy()
- {
- _createRequest = null;
- _downloadFileTask = null;
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/BundleLoaderFromDownload.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/BundleLoaderFromDownload.cs.meta
deleted file mode 100644
index bdf80b074..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/BundleLoaderFromDownload.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: b2dee1496d7247acb00dbb7af88a016c
-timeCreated: 1677558190
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/BundleLoaderFromLocal.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/BundleLoaderFromLocal.cs
deleted file mode 100644
index 7d7e11bd9..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/BundleLoaderFromLocal.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-using UnityEngine;
-
-namespace NBC.Asset
-{
- internal class BundleLoaderFromLocal : IBundleLoader
- {
- private enum Steps
- {
- Load,
- Check,
- Done,
- }
-
- private BundledProvider _provider;
- private Steps _steps = Steps.Load;
- private AssetBundleCreateRequest _createRequest;
- private string _loadPath;
- private bool _isWaitForAsyncComplete;
-
- public AssetBundle Bundle { set; get; }
-
- public void Start(BundledProvider provider)
- {
- _provider = provider;
- var info = provider.BundleInfo;
- _loadPath = info.BundlePath;
- }
-
- public void Update()
- {
- if (_steps == Steps.Load)
- {
- if (_isWaitForAsyncComplete)
- Bundle = AssetBundle.LoadFromFile(_loadPath);
- else
- _createRequest = AssetBundle.LoadFromFileAsync(_loadPath);
- _steps = Steps.Check;
- }
-
- if (_steps == Steps.Check)
- {
- if (_createRequest != null)
- {
- if (_isWaitForAsyncComplete)
- {
- Bundle = _createRequest.assetBundle;
- }
- else
- {
- if (!_createRequest.isDone)
- return;
- Bundle = _createRequest.assetBundle;
- }
- }
-
- if (Bundle == null)
- {
- _steps = Steps.Done;
- _provider.SetStatus(NTaskStatus.Fail,
- $"failed load assetBundle : {_provider.BundleInfo.Bundle.Name}");
- Debug.LogError(_provider.ErrorMsg);
- }
- else
- {
- _provider.SetStatus(NTaskStatus.Success);
- _provider.AssetBundle = Bundle;
- _steps = Steps.Done;
- }
- }
- }
-
- public void WaitForAsyncComplete()
- {
- _isWaitForAsyncComplete = true;
-
- int frame = 1000;
- while (true)
- {
- // 保险机制
- frame--;
- if (frame == 0)
- {
- break;
- }
-
- Update();
-
- if (_provider.IsDone)
- break;
- }
- }
-
- public void Destroy()
- {
- _createRequest = null;
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/BundleLoaderFromLocal.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/BundleLoaderFromLocal.cs.meta
deleted file mode 100644
index 46177175a..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/BundleLoaderFromLocal.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: b1157be68cf14e4ea3b8dcb2eab1f59c
-timeCreated: 1677552109
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/IAssetLoader.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/IAssetLoader.cs
deleted file mode 100644
index 35a645f99..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/IAssetLoader.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-namespace NBC.Asset
-{
- public interface IAssetLoader
- {
- void Start(AssetProvider provider);
- void Update();
- void WaitForAsyncComplete();
- void Destroy();
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/IAssetLoader.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/IAssetLoader.cs.meta
deleted file mode 100644
index 842aa394a..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/IAssetLoader.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 66d37ccc10d2432497d403f43d45e6d9
-timeCreated: 1677549879
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/IBundleLoader.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/IBundleLoader.cs
deleted file mode 100644
index 267033490..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/IBundleLoader.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-namespace NBC.Asset
-{
- internal interface IBundleLoader
- {
- void Start(BundledProvider provider);
- void Update();
- void WaitForAsyncComplete();
- void Destroy();
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/IBundleLoader.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/IBundleLoader.cs.meta
deleted file mode 100644
index 835cbddc2..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/IBundleLoader.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 033c5ad1ff974e368aac38947b3702c8
-timeCreated: 1677549943
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/ISceneLoader.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/ISceneLoader.cs
deleted file mode 100644
index 0e259a725..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/ISceneLoader.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-namespace NBC.Asset
-{
- public interface ISceneLoader
- {
- void Start(SceneProvider provider);
- void Update();
- void WaitForAsyncComplete();
- void Destroy();
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/ISceneLoader.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/ISceneLoader.cs.meta
deleted file mode 100644
index ecde14a9d..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/ISceneLoader.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: de7de727380a4f8695304aded82565aa
-timeCreated: 1677832119
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/SceneLoadFromDatabase.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/SceneLoadFromDatabase.cs
deleted file mode 100644
index 8b01aaf63..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/SceneLoadFromDatabase.cs
+++ /dev/null
@@ -1,101 +0,0 @@
-using System.IO;
-using UnityEngine;
-using UnityEngine.SceneManagement;
-
-namespace NBC.Asset
-{
- internal class SceneLoadFromDatabase : ISceneLoader
- {
- public static ISceneLoader CreateInstance()
- {
- return new SceneLoadFromDatabase();
- }
-
- private enum Steps
- {
- LoadDependency,
- LoadScene,
- }
-
- private bool _isWaitForAsyncComplete;
- private SceneProvider _provider;
- private AssetInfo _assetInfo;
- private Steps _steps;
- private AsyncOperation _asyncOperation;
-
- public void Start(SceneProvider provider)
- {
- _provider = provider;
- _assetInfo = provider.AssetInfo;
- _steps = Steps.LoadDependency;
- }
-
- public void Update()
- {
-#if UNITY_EDITOR
- if (_steps == Steps.LoadDependency)
- {
- var scenePath = _assetInfo.Path;
- LoadSceneParameters loadSceneParameters = new LoadSceneParameters
- {
- loadSceneMode = _provider.SceneMode
- };
- if (_isWaitForAsyncComplete)
- {
- UnityEditor.SceneManagement.EditorSceneManager.LoadSceneInPlayMode(scenePath, loadSceneParameters);
- SetStatus();
- }
- else
- {
- _asyncOperation =
- UnityEditor.SceneManagement.EditorSceneManager.LoadSceneAsyncInPlayMode(scenePath,
- loadSceneParameters);
- _steps = Steps.LoadScene;
- }
- }
- else if (_steps == Steps.LoadScene)
- {
- if (!_asyncOperation.isDone) return;
- SetStatus();
- }
-#endif
- }
-
- public void WaitForAsyncComplete()
- {
- _isWaitForAsyncComplete = true;
-
- int frame = 1000;
- while (true)
- {
- frame--;
- if (frame == 0)
- {
- break;
- }
-
- Update();
-
- if (_provider.IsDone)
- break;
- }
- }
-
- public void Destroy()
- {
-
- }
-
- private void SetStatus()
- {
- var sceneObj = SceneManager.GetSceneAt(SceneManager.sceneCount - 1);
- _provider.SceneObject = sceneObj;
- _provider.SetStatus(NTaskStatus.Success);
- }
-
- private void SetStatus(string error)
- {
- _provider.SetStatus(NTaskStatus.Fail, error);
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/SceneLoadFromDatabase.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/SceneLoadFromDatabase.cs.meta
deleted file mode 100644
index f3daac03e..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/SceneLoadFromDatabase.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 46af8c940cb3447a970be02ea0aeea4a
-timeCreated: 1677833907
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/SceneLoaderFromBundle.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/SceneLoaderFromBundle.cs
deleted file mode 100644
index 98a265d67..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/SceneLoaderFromBundle.cs
+++ /dev/null
@@ -1,144 +0,0 @@
-using System.IO;
-using UnityEngine;
-using UnityEngine.SceneManagement;
-
-namespace NBC.Asset
-{
- internal class SceneLoaderFromBundle : ISceneLoader
- {
- public static ISceneLoader CreateInstance()
- {
- return new SceneLoaderFromBundle();
- }
-
- private enum Steps
- {
- LoadDependency,
- LoadScene,
- }
-
- private Dependency _dependency;
- private AssetInfo _assetInfo;
- private Steps _steps = Steps.LoadDependency;
- private SceneProvider _provider;
-
- private bool _isWaitForAsyncComplete;
- private AsyncOperation _asyncOperation;
-
- public void Start(SceneProvider provider)
- {
- _provider = provider;
- var newAsset = true;
- if (_assetInfo == null)
- {
- _assetInfo = provider.AssetInfo;
- }
- else
- {
- if (_assetInfo.GUID == provider.AssetInfo.GUID)
- {
- newAsset = false;
- }
- else
- {
- _assetInfo = provider.AssetInfo;
- }
- }
-
- if (newAsset || _dependency == null)
- {
- _dependency = Dependency.GetAssetDependency(_assetInfo);
- _dependency.Retain();
- }
-
- _steps = Steps.LoadDependency;
- }
-
- public void Update()
- {
- if (_steps == Steps.LoadDependency)
- {
- if (_isWaitForAsyncComplete)
- {
- _dependency.WaitForAsyncComplete();
- }
- else if (!_dependency.IsDone) return;
-
- if (!_dependency.IsSucceed)
- {
- Debug.LogError("error");
- SetStatus("dependency fail");
- }
-
- var provider = _dependency.GetMainBundledProvider();
- if (provider != null && provider.AssetBundle != null)
- {
- var scenePath = Path.GetFileNameWithoutExtension(_assetInfo.Path);
- if (_isWaitForAsyncComplete)
- {
- SceneManager.LoadScene(scenePath, _provider.SceneMode);
- SetStatus();
- }
- else
- {
- _asyncOperation = SceneManager.LoadSceneAsync(scenePath, _provider.SceneMode);
- _asyncOperation.allowSceneActivation = true;
- _steps = Steps.LoadScene;
- }
- }
- else
- {
- //失败,后续补全失败逻辑
- Debug.LogError("error1");
- SetStatus("error");
- }
- }
- else if (_steps == Steps.LoadScene)
- {
- if (!_asyncOperation.isDone) return;
- SetStatus();
- }
- }
-
- public void WaitForAsyncComplete()
- {
- _isWaitForAsyncComplete = true;
-
- int frame = 1000;
- while (true)
- {
- frame--;
- if (frame == 0)
- {
- break;
- }
-
- Update();
-
- if (_provider.IsDone)
- break;
- }
- }
-
- public void Destroy()
- {
- _dependency.Release();
- _asyncOperation = null;
- }
-
-
- private void SetStatus()
-
- {
- var sceneObj = SceneManager.GetSceneAt(SceneManager.sceneCount - 1);
- _provider.SceneObject = sceneObj;
- _provider.SetStatus(NTaskStatus.Success);
- }
-
-
- private void SetStatus(string error)
- {
- _provider.SetStatus(NTaskStatus.Fail, error);
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/SceneLoaderFromBundle.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/SceneLoaderFromBundle.cs.meta
deleted file mode 100644
index 1f398f932..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Loaders/SceneLoaderFromBundle.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: febc5527b0844fbc8d46f8315bafee24
-timeCreated: 1678027484
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers.meta
deleted file mode 100644
index 357ca20b1..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 30c848f308bc4088a66095eb6f34e549
-timeCreated: 1677052587
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/AssetProvider.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/AssetProvider.cs
deleted file mode 100644
index a1032f3e3..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/AssetProvider.cs
+++ /dev/null
@@ -1,117 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using UnityEngine;
-
-namespace NBC.Asset
-{
- public class AssetProvider : ProviderBase
- {
- public static Func CreateLoader { get; set; } = AssetLoaderFromBundle.CreateInstance;
-
- private IAssetLoader _loader;
-
- public AssetInfo AssetInfo { get; internal set; }
-
- public bool IsAll { get; set; }
-
- public UnityEngine.Object Asset { get; set; }
-
- public UnityEngine.Object[] AllAsset { get; set; }
-
-
- protected override void OnStart()
- {
- if (_loader == null) _loader = CreateLoader();
- _loader.Start(this);
- }
-
- protected override NTaskStatus OnProcess()
- {
-#if DEBUG
- DebugRecord();
-#endif
- if (IsDone) return NTaskStatus.Success;
- if (IsWaitForAsyncComplete)
- {
- _loader.WaitForAsyncComplete();
- }
- else
- {
- _loader.Update();
- }
-
- return base.OnProcess();
- }
-
- public override void Destroy()
- {
- Debug.Log($"卸载资源==={AssetInfo.Path}");
- base.Destroy();
- _assets.Remove(this);
- _loader.Destroy();
- _loader = null;
- }
-
- #region Static
-
- private static readonly List _assets = new List();
-
- internal static List GetAssetProviders()
- {
- return _assets;
- }
-
- internal static void ReleaseAllAssets(bool force = true)
- {
- foreach (var asset in _assets)
- {
- asset.Release(force);
- }
- }
-
- internal static void ReleaseAllAssetsByTag(string[] tags, bool force = true)
- {
- foreach (var asset in _assets)
- {
- if (asset.AssetInfo.HasTag(tags))
- {
- asset.Release(force);
- }
- }
- }
-
- internal static AssetProvider GetAssetProvider(AssetInfo assetInfo, bool isAll = false)
- {
- if (assetInfo == null) return null;
- AssetProvider provider = null;
- foreach (var asset in _assets)
- {
- if (asset.AssetInfo == assetInfo)
- {
- provider = asset;
- break;
- }
- }
-
- if (provider == null)
- {
- provider = new AssetProvider
- {
- AssetInfo = assetInfo,
- IsAll = isAll
- };
-#if DEBUG
- provider.InitDebugInfo();
-#endif
- _assets.Add(provider);
- }
-
- provider.Run();
-
- return provider;
- }
-
- #endregion
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/AssetProvider.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/AssetProvider.cs.meta
deleted file mode 100644
index 94af7521d..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/AssetProvider.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 7e767bd7f49546e5af835e60bc4ca363
-timeCreated: 1677057856
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/BundledProvider.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/BundledProvider.cs
deleted file mode 100644
index 171185534..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/BundledProvider.cs
+++ /dev/null
@@ -1,107 +0,0 @@
-using System;
-using System.Collections.Generic;
-using UnityEngine;
-
-namespace NBC.Asset
-{
- internal class BundledProvider : ProviderBase
- {
- public static Func CreateLoader { get; set; } = null;
-
- private IBundleLoader _loader;
- public BundleInfo BundleInfo;
- public AssetBundle AssetBundle { get; set; }
-
- protected override void OnStart()
- {
- _loader.Start(this);
- }
-
- protected override NTaskStatus OnProcess()
- {
-#if DEBUG
- DebugRecord();
-#endif
- if (IsDone) return NTaskStatus.Success;
- if (IsWaitForAsyncComplete)
- {
- _loader.WaitForAsyncComplete();
- }
- else
- {
- _loader.Update();
- }
-
- return base.OnProcess();
- }
-
- public override void Destroy()
- {
- Debug.Log($"卸载Bundle==={BundleInfo.Bundle.Name}");
- base.Destroy();
- _bundled.Remove(this);
- _loader.Destroy();
- if (AssetBundle != null)
- {
- AssetBundle.Unload(true);
- AssetBundle = null;
- }
-
- _loader = null;
- }
-
- #region Static
-
- private static readonly List _bundled = new List();
-
- internal static List GetBundleProviders()
- {
- return _bundled;
- }
-
- internal static BundledProvider GetBundleProvider(BundleInfo bundleInfo)
- {
- BundledProvider provider = null;
- foreach (var bundled in _bundled)
- {
- if (bundled.BundleInfo == bundleInfo)
- {
- provider = bundled;
- break;
- }
- }
-
- if (provider == null)
- {
- provider = new BundledProvider
- {
- BundleInfo = bundleInfo
- };
- provider._loader = GetBundleLoader(provider);
-#if DEBUG
- provider.InitDebugInfo();
-#endif
- _bundled.Add(provider);
- }
-
- provider.Run();
-
- return provider;
- }
-
- internal static IBundleLoader GetBundleLoader(BundledProvider provider)
- {
- var loader = CreateLoader?.Invoke();
- if (loader != null) return loader;
- var bundleInfo = provider.BundleInfo;
- if (bundleInfo.LoadMode == BundleLoadMode.LoadFromRemote)
- {
- return new BundleLoaderFromDownload();
- }
-
- return new BundleLoaderFromLocal();
- }
-
- #endregion
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/BundledProvider.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/BundledProvider.cs.meta
deleted file mode 100644
index 385ac7a79..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/BundledProvider.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 5796a93598ef48cfbe829a4fd48b1cc2
-timeCreated: 1677057801
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/Dependency.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/Dependency.cs
deleted file mode 100644
index 0c2ffe15b..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/Dependency.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-using System.Collections.Generic;
-
-namespace NBC.Asset
-{
- internal class Dependency
- {
- ///
- /// 依赖的资源包加载器列表
- ///
- internal readonly List DependBundles;
-
- public Dependency(List dependBundles)
- {
- DependBundles = dependBundles;
- }
-
- ///
- /// 是否已经完成(无论成功或失败)
- ///
- public bool IsDone
- {
- get
- {
- foreach (var bundle in DependBundles)
- {
- if (!bundle.IsDone)
- return false;
- }
-
- return true;
- }
- }
-
- public bool IsSucceed
- {
- get
- {
- foreach (var loader in DependBundles)
- {
- if (loader.Status != NTaskStatus.Success)
- {
- return false;
- }
- }
-
- return true;
- }
- }
-
- public void WaitForAsyncComplete()
- {
- foreach (var bundle in DependBundles)
- {
- if (!bundle.IsDone)
- bundle.WaitForAsyncComplete();
- }
- }
-
-
- public void Retain()
- {
- foreach (var request in DependBundles)
- {
- // request.Retain();
- }
- }
-
- public void Release()
- {
- foreach (var request in DependBundles)
- {
- request.Release();
- }
- }
-
- public BundledProvider GetMainBundledProvider()
- {
- return DependBundles.Count > 0 ? DependBundles[0] : null;
- }
-
-
- #region Static
-
- internal static Dependency GetAssetDependency(AssetInfo assetInfo)
- {
- var bundleInfos = Addressable.GetAllDependBundleInfos(assetInfo);
- List list = new List();
- foreach (var info in bundleInfos)
- {
- list.Add(BundledProvider.GetBundleProvider(info));
- }
-
- var dep = new Dependency(list);
- return dep;
- }
-
- #endregion
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/Dependency.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/Dependency.cs.meta
deleted file mode 100644
index 365c4ee7e..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/Dependency.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 1f18e197df9a4a1dbca3cb4913cb4f4d
-timeCreated: 1677551909
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/ProviderBase.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/ProviderBase.cs
deleted file mode 100644
index 295ae59d9..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/ProviderBase.cs
+++ /dev/null
@@ -1,110 +0,0 @@
-using System;
-using System.Diagnostics;
-using System.Globalization;
-
-namespace NBC.Asset
-{
- public abstract class ProviderBase : NTask, IRecyclable
- {
- ///
- /// 是否已经销毁
- ///
- public bool IsDestroyed { get; set; }
-
- ///
- /// 是否可以销毁
- ///
- public bool CanDestroy => IsDone && RefCount <= 0;
-
- protected bool IsWaitForAsyncComplete { private set; get; } = false;
-
- public void SetStatus(NTaskStatus status, string info = "")
- {
- Status = status;
- _errorMsg = info;
- }
-
- internal virtual void Run()
- {
- Retain();
- if (!IsDone && !IsRunning)
- {
- Run(TaskRunner.ProviderRunner);
- }
- }
-
- #region RefCounter
-
- ///
- /// 引用计数
- ///
- public int RefCount { get; private set; }
-
- public void Retain()
- {
- RefCount++;
- }
-
- public void Release(bool force = false)
- {
- RefCount--;
- if (force) RefCount = 0;
- if (RefCount > 0) return;
- //释放资源
- Recycler.Add(this);
- }
-
- #endregion
-
- ///
- /// 销毁资源对象
- ///
- public virtual void Destroy()
- {
- IsDestroyed = true;
- }
-
- ///
- /// 等待异步执行完毕
- ///
- public void WaitForAsyncComplete()
- {
- IsWaitForAsyncComplete = true;
- Process();
- }
-
- #region Debug
-
-#if DEBUG
- public string LoadScene = string.Empty;
- public string LoadTime = string.Empty;
- public long LoadTotalTime { protected set; get; }
-
- // 加载耗时统计
- private bool _isRecording;
- private Stopwatch _watch;
-
- internal void InitDebugInfo()
- {
- LoadScene = UnityEngine.SceneManagement.SceneManager.GetActiveScene().name;
- LoadTime = DateTime.Now.ToString("hh:mm:ss");
- }
-
- protected void DebugRecord()
- {
- if (_isRecording == false)
- {
- _isRecording = true;
- _watch = Stopwatch.StartNew();
- }
-
- if (_watch == null) return;
- if (!IsDone) return;
- LoadTotalTime = _watch.ElapsedMilliseconds;
- _watch = null;
- }
-#endif
-
- #endregion
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/ProviderBase.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/ProviderBase.cs.meta
deleted file mode 100644
index 1f1d8307c..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/ProviderBase.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 0582024b8cee499496844a7c5c204286
-timeCreated: 1677051990
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/SceneProvider.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/SceneProvider.cs
deleted file mode 100644
index a959b97c7..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/SceneProvider.cs
+++ /dev/null
@@ -1,122 +0,0 @@
-using System;
-using System.Collections.Generic;
-using UnityEngine;
-using UnityEngine.SceneManagement;
-
-namespace NBC.Asset
-{
- public class SceneProvider : ProviderBase
- {
- public static Func CreateLoader { get; set; } = SceneLoaderFromBundle.CreateInstance;
- private ISceneLoader _loader;
-
- public AssetInfo AssetInfo { get; internal set; }
-
- public UnityEngine.SceneManagement.Scene SceneObject { get; set; }
-
- public LoadSceneMode SceneMode;
- private AsyncOperation _asyncOp;
- private int _priority;
-
- protected override void OnStart()
- {
- _loader.Start(this);
- }
-
- protected override NTaskStatus OnProcess()
- {
-#if DEBUG
- DebugRecord();
-#endif
- if (IsDone) return NTaskStatus.Success;
- if (IsWaitForAsyncComplete)
- {
- _loader.WaitForAsyncComplete();
- }
- else
- {
- _loader.Update();
- }
-
- return base.OnProcess();
- }
-
- public override void Destroy()
- {
- base.Destroy();
- _scenes.Remove(this);
- _loader.Destroy();
- _loader = null;
- }
-
- internal override void Run()
- {
- Retain();
- if (!IsRunning)
- {
- Run(TaskRunner.ProviderRunner);
- }
- }
-
- #region Static
-
- private static readonly List _scenes = new List();
-
- internal static List GetSceneProviders()
- {
- return _scenes;
- }
-
- internal static void ReleaseAllAssets(bool force = true)
- {
- foreach (var asset in _scenes)
- {
- asset.Release(force);
- }
- }
-
- internal static void ReleaseAllAssetsByTag(string[] tags, bool force = true)
- {
- foreach (var asset in _scenes)
- {
- if (asset.AssetInfo.HasTag(tags))
- {
- asset.Release(force);
- }
- }
- }
-
- internal static SceneProvider GetSceneProvider(AssetInfo assetInfo, bool additive = false)
- {
- SceneProvider provider = null;
- foreach (var scene in _scenes)
- {
- if (scene.AssetInfo == assetInfo)
- {
- provider = scene;
- break;
- }
- }
-
- if (provider == null)
- {
- provider = new SceneProvider
- {
- AssetInfo = assetInfo,
- _loader = CreateLoader(),
- SceneMode = additive ? LoadSceneMode.Additive : LoadSceneMode.Single
- };
-#if DEBUG
- provider.InitDebugInfo();
-#endif
- _scenes.Add(provider);
- }
-
- provider.Run();
-
- return provider;
- }
-
- #endregion
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/SceneProvider.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/SceneProvider.cs.meta
deleted file mode 100644
index 336c873f2..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Asset/Providers/SceneProvider.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 64b0e1cc71b24c5c86d2229c56991e95
-timeCreated: 1677831975
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Assets.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Assets.cs
deleted file mode 100644
index b8fb15fc9..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Assets.cs
+++ /dev/null
@@ -1,413 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using UnityEngine;
-using Object = UnityEngine.Object;
-
-namespace NBC.Asset
-{
- public static class Assets
- {
- private static GameObject _monoGameObject;
- private static bool _isInitialize;
- private static NTaskStatus _initializeTaskStatus = NTaskStatus.None;
- private static string _initializeError = string.Empty;
-
-
- public static FTask Initialize()
- {
- if (_isInitialize)
- throw new Exception($"Repeated initialization!");
-
- return InitConfirm();
- }
-
- #region 资源清理
-
- ///
- /// 清理所有缓存
- ///
- public static void ClearAllCache()
- {
- if (Directory.Exists(Const.SavePath))
- {
- Directory.Delete(Const.SavePath, true);
- }
- }
-
- #endregion
-
- #region 资源加载
-
- public static T Load(string path) where T : Object
- {
- var assetProvider = LoadAsset(path, typeof(T));
- if (assetProvider != null)
- {
- return assetProvider.Asset as T;
- }
-
- return null;
- }
-
- public static AssetProvider LoadAsset(string path)
- {
- return LoadAsset(path, typeof(T));
- }
-
- public static AssetProvider LoadAsset(string path, Type type)
- {
- var req = LoadAssetAsync(path, type);
- req?.WaitForAsyncComplete();
- return req;
- }
-
- public static AssetProvider LoadAssetAsync(string path)
- {
- return LoadAssetAsync(path, typeof(T));
- }
-
- public static AssetProvider LoadAssetAsync(string path, Type type)
- {
- var assetInfo = Addressable.GetAssetInfo(path, type);
- return AssetProvider.GetAssetProvider(assetInfo);
- }
-
-
- public static AssetProvider LoadAssetAll(string path)
- {
- return LoadAssetAll(path, typeof(T));
- }
-
- public static AssetProvider LoadAssetAll(string path, Type type)
- {
- var req = LoadAssetAllAsync(path, type);
- req?.WaitForAsyncComplete();
- return req;
- }
-
- public static AssetProvider LoadAssetAllAsync(string path)
- {
- return LoadAssetAllAsync(path, typeof(T));
- }
-
- public static AssetProvider LoadAssetAllAsync(string path, Type type)
- {
- var assetInfo = Addressable.GetAssetInfo(path, type);
- return AssetProvider.GetAssetProvider(assetInfo, true);
- }
-
- #endregion
-
- #region 场景加载
-
- public static SceneProvider LoadScene(string path, bool additive = false)
- {
- var assetInfo = Addressable.GetAssetInfo(path, typeof(Scene));
- if (assetInfo == null)
- {
- throw new Exception($"Scene is null,path={path}");
- }
-
- return SceneProvider.GetSceneProvider(assetInfo, additive);
- }
-
- #endregion
-
- #region 资源卸载
-
- ///
- /// 释放所有资源
- ///
- /// 强制释放
- public static void ReleaseAllAssets(bool force = true)
- {
- AssetProvider.ReleaseAllAssets(force);
- SceneProvider.ReleaseAllAssets(force);
- }
-
- ///
- /// 根据标签,释放所有资源
- ///
- /// 标签
- /// 强制释放
- public static void ReleaseAllAssetsByTag(string[] tags, bool force = true)
- {
- AssetProvider.ReleaseAllAssetsByTag(tags, force);
- SceneProvider.ReleaseAllAssetsByTag(tags, force);
- }
-
- #endregion
-
- #region 检查解压
-
- ///
- /// 可以解压的bundle包数量
- ///
- ///
- public static int CanUnpackBundleCount()
- {
- var arr = Addressable.GetCanUnpackBundles();
- return arr != null ? arr.Length : 0;
- }
-
- ///
- /// 解压资源包任务(解压本地存在的所有资源)
- ///
- /// 自动运行
- ///
- public static UnpackPackagesTask CreateUnpackPackagesTask(bool run = true)
- {
- var task = new UnpackPackagesTask();
- if (run) task.Run(TaskRunner.Def);
- return task;
- }
-
- #endregion
-
- #region 检查更新
-
- ///
- /// 获取当前版本可以下载到本地的bundle包
- ///
- ///
- public static List GetCanDownloadBundles()
- {
- List ret = new List();
- var bundles = Addressable.GetCanDownloadBundles();
- foreach (var bundleInfo in bundles)
- {
- var bundleData = bundleInfo.Bundle;
- //可优化。缓存所有packageName,但该逻辑理论全局只会调用一次,是否需要缓存值得考虑
- if (bundleData != null && IsNeedfulPackage(bundleData.PackageName))
- {
- ret.Add(bundleInfo);
- }
- }
-
- return ret;
- }
-
- ///
- /// 主动下载需要的bundles包任务
- ///
- /// 需要下载的bundle
- /// 自动运行
- ///
- public static DownloadBundlesTask CreateDownloadBundlesTask(List downloadBundles, bool run = true)
- {
- var task = new DownloadBundlesTask(downloadBundles);
- if (run) task.Run();
- return task;
- }
-
- ///
- /// 创建检查更新任务
- ///
- ///
- public static CheckUpdateTask CreateCheckUpdateTask(bool run = true)
- {
- var task = new CheckUpdateTask();
- if (run) task.Run(TaskRunner.Def);
- return task;
- }
-
- ///
- /// 创建版本更新任务
- ///
- public static UpdateVersionTask CreateUpdateVersionTask(UpdateContext context, bool run = true)
- {
- var task = new UpdateVersionTask(context);
- if (run) task.Run();
- return task;
- }
-
- #endregion
-
- #region 默认资源包
-
- private static readonly HashSet _defaultPackage = new HashSet();
-
- ///
- /// 添加一个包进入需要列表
- ///
- ///
- public static void AddNeedfulPackage(string packageName)
- {
- _defaultPackage.Add(packageName);
- }
-
- ///
- /// 移除一个需要的资源包
- ///
- ///
- public static void RemoveNeedfulPackage(string packageName)
- {
- if (_defaultPackage.Contains(packageName)) _defaultPackage.Remove(packageName);
- }
-
- ///
- /// 移除全部额外需要包
- ///
- public static void RemoveAllNeedful()
- {
- _defaultPackage.Clear();
- }
-
- ///
- /// 是否需要这个资源包
- ///
- ///
- ///
- public static bool IsNeedfulPackage(string packageName)
- {
- var ret = _defaultPackage.Contains(packageName);
- if (!ret)
- {
- var package = Addressable.GetPackageData(packageName);
- if (package != null)
- {
- return package.Def == 1;
- }
- }
-
- return ret;
- }
-
- #endregion
-
- #region 调试
-
-#if DEBUG
- private static DebugRemoteServer _debugRemoteServer;
-
-
- public static void StartDebugRemoteServer()
- {
- _debugRemoteServer = _monoGameObject.AddComponent();
- }
-
- public static void StopDebugRemoteServer()
- {
- if (_debugRemoteServer != null)
- {
- Object.DestroyImmediate(_debugRemoteServer);
- }
- }
-
- public static DebugInfo GetDebugInfos()
- {
- DebugInfo info = new DebugInfo();
- info.Frame = Time.frameCount;
- var assetProviders = AssetProvider.GetAssetProviders();
- foreach (var asset in assetProviders)
- {
- var i = CreateDebugAssetInfo(asset.AssetInfo, asset.IsAll);
- SetDebugBaseInfo(asset, i);
- info.AssetInfos.Add(i);
- }
-
- var sceneProviders = SceneProvider.GetSceneProviders();
- foreach (var scene in sceneProviders)
- {
- var i = CreateDebugAssetInfo(scene.AssetInfo, false);
- SetDebugBaseInfo(scene, i);
- info.AssetInfos.Add(i);
- }
-
- var bundleProviders = BundledProvider.GetBundleProviders();
- foreach (var bundle in bundleProviders)
- {
- var bundleInfo = new DebugBundleInfo
- {
- BundleName = bundle.BundleInfo.Bundle.Name
- };
- SetDebugBaseInfo(bundle, bundleInfo);
- info.BundleInfos.Add(bundleInfo);
- }
-
- return info;
- }
-
- private static DebugAssetInfo CreateDebugAssetInfo(AssetInfo asset, bool isAll)
- {
- var assetInfo = new DebugAssetInfo
- {
- Path = asset.Path,
- Type = asset.AssetType.Name,
- IsAll = isAll,
- };
- var bundleInfos = Addressable.GetAllDependBundleInfos(asset);
- foreach (var bundle in bundleInfos)
- {
- assetInfo.Dependency.Add(bundle.Bundle.Name);
- }
-
- return assetInfo;
- }
-
- private static void SetDebugBaseInfo(ProviderBase provider, DebugBaseInfo info)
- {
- info.LoadScene = provider.LoadScene;
- info.Ref = provider.RefCount;
- info.Status = provider.Status.ToString();
- info.LoadTime = provider.LoadTime;
- info.LoadTotalTime = provider.LoadTotalTime;
- }
-#endif
-
- #endregion
-
- #region Private
-
- private static void Update()
- {
- TaskRunner.Update();
- Recycler.Update();
- }
-
- private static async FTask InitConfirm()
- {
- _monoGameObject = new GameObject("Assets", typeof(Mono));
- Mono.AddUpdate(Update);
- InitializationTask task;
- if (Const.Simulate)
- {
- task = new EditorInitializationTask();
- AssetProvider.CreateLoader = AssetLoadFromDatabase.CreateInstance;
- SceneProvider.CreateLoader = SceneLoadFromDatabase.CreateInstance;
- }
- else if (Const.Offline)
- {
- task = new OfflineInitializationTask();
- }
- else
- {
- task = new OnlineInitializationTask();
- }
-
- if (Const.IsWebGLPlatform)
- {
- Const.RemoteUrl = $"{Application.streamingAssetsPath}/";
- }
-
- task.OnCompleted(InitDone);
- task.Run(TaskRunner.Def);
- _isInitialize = true;
- await task.Task;
- }
-
- ///
- /// 初始化完成回调
- ///
- ///
- private static void InitDone(ITask taskBase)
- {
- Debug.Log("初始化完成===");
- _initializeTaskStatus = taskBase.Status;
- _initializeError = taskBase.ErrorMsg;
- }
-
- #endregion
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Assets.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Assets.cs.meta
deleted file mode 100644
index 7c003d853..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Assets.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: a339636ce1b94bcbb5163bf34c3e11b6
-timeCreated: 1675930154
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Const.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Const.meta
deleted file mode 100644
index 354d7f85c..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Const.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: de24143fe7a345ceb02108d8cc9730e0
-folderAsset: yes
-DefaultImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Const/Const.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Const/Const.cs
deleted file mode 100644
index d772fba1c..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Const/Const.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-using System.IO;
-using UnityEngine;
-
-namespace NBC.Asset
-{
- public static class Const
- {
- public const string BundleDirName = "Bundles";
- public const string VersionFileName = "version.json";
-
- public static bool IsWebGLPlatform => Application.platform == RuntimePlatform.WebGLPlayer;
-
- public static readonly string SavePath =
- $"{Application.persistentDataPath}{Path.DirectorySeparatorChar}{BundleDirName}{Path.DirectorySeparatorChar}";
-
- public static readonly string StreamingAssetsPath =
- $"{Application.streamingAssetsPath}{Path.DirectorySeparatorChar}";
-
- public static string RemoteUrl = "http://127.0.0.1:8181/";
-
- public static bool Offline;
- public static bool Simulate;
-
- public static int DownloadTimeOut = 10;
-
-
- public static string GetStreamingPath(string file)
- {
- return $"{StreamingAssetsPath}{file}";
- }
-
- public static string GetCachePath(string file)
- {
- return $"{SavePath}{file}";
- }
-
- public static string GetCacheTempPath(string file)
- {
- return $"{SavePath}{file}.temp";
- }
-
- public static string GetRemotePath(string file)
- {
- if (!Application.isEditor && IsWebGLPlatform)
- {
- return $"{RemoteUrl}/{file}";
- }
- return $"{RemoteUrl}{BundleDirName}/{file}";
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Const/Const.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Const/Const.cs.meta
deleted file mode 100644
index 8cf7690df..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Const/Const.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: de19e53b3f774094918543bbbc7318a0
-timeCreated: 1624159347
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Enums.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Enums.meta
deleted file mode 100644
index 1abf501b9..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Enums.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 7239be5c8a2a45ff91ff7118816b9c9b
-timeCreated: 1677663981
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Enums/BundleLoadMode.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Enums/BundleLoadMode.cs
deleted file mode 100644
index f7c50056f..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Enums/BundleLoadMode.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-namespace NBC.Asset
-{
- public enum BundleLoadMode
- {
- None,
- LoadFromStreaming,
- LoadFromCache,
- LoadFromRemote
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Enums/BundleLoadMode.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Enums/BundleLoadMode.cs.meta
deleted file mode 100644
index 1026d8cdb..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Enums/BundleLoadMode.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 43bdba8ab37f4164913472c931edd6e4
-timeCreated: 1677663989
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services.meta
deleted file mode 100644
index d7c600f8c..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: dff0030f0ed04cc6a834c994e98f2300
-timeCreated: 1677125510
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services/Debug.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services/Debug.meta
deleted file mode 100644
index 3116895b9..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services/Debug.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 31105beb84d840a3a8aa41ec7fecf129
-timeCreated: 1679673084
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services/Debug/DebugInfo.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services/Debug/DebugInfo.cs
deleted file mode 100644
index 866a01f05..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services/Debug/DebugInfo.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace NBC.Asset
-{
-#if DEBUG
- [Serializable]
- public class DebugBaseInfo
- {
- public int Ref;
- public string LoadScene;
- public string LoadTime;
- public long LoadTotalTime;
- public string Status;
- }
-
- [Serializable]
- public class DebugAssetInfo : DebugBaseInfo
- {
- public string Path;
- public string Type;
- public bool IsAll;
- public List Dependency = new List();
- }
-
- [Serializable]
- public class DebugBundleInfo : DebugBaseInfo
- {
- public string BundleName;
- }
-
- [Serializable]
- public class DebugInfo
- {
- public int Frame;
- public List AssetInfos = new List();
- public List BundleInfos = new List();
- }
-
-#endif
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services/Debug/DebugInfo.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services/Debug/DebugInfo.cs.meta
deleted file mode 100644
index bf8170bdf..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services/Debug/DebugInfo.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 2db971d4daa94c33bf490be190061969
-timeCreated: 1679673090
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services/Debug/DebugRemoteServer.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services/Debug/DebugRemoteServer.cs
deleted file mode 100644
index 8b37f5a21..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services/Debug/DebugRemoteServer.cs
+++ /dev/null
@@ -1,117 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net;
-using System.Net.NetworkInformation;
-using System.Net.Sockets;
-using System.Text;
-using UnityEngine;
-
-namespace NBC.Asset
-{
-#if DEBUG
-
- public class DebugRemoteServer : MonoBehaviour
- {
- static HttpListener _httpListener;
-
- private readonly Queue _contexts = new Queue();
-
- void Start()
- {
- _httpListener = new HttpListener();
- //定义url及端口号,通常设置为配置文件
- _httpListener.Prefixes.Add("http://+:8080/");
- //启动监听器
- _httpListener.Start();
- _httpListener.BeginGetContext(Result, null);
- var ip = GetIP();
- Debug.Log($"调试服务端初始化完毕ip={ip},正在等待调试客户端请求,时间:{DateTime.Now}");
- }
-
- private void Result(IAsyncResult ar)
- {
- //继续异步监听
- _httpListener.BeginGetContext(Result, null);
- var guid = Guid.NewGuid().ToString();
- Debug.Log($"接到新的请求:{guid},时间:{DateTime.Now}");
- //获得context对象
- var context = _httpListener.EndGetContext(ar);
- _contexts.Enqueue(context);
- }
-
-
- private string HandleRequest(HttpListenerRequest request, HttpListenerResponse response)
- {
- response.StatusDescription = "200";
- response.StatusCode = 200;
- try
- {
- var info = Assets.GetDebugInfos();
- var json = JsonUtility.ToJson(info, true);
- return json;
- }
- catch (Exception e)
- {
- response.StatusDescription = "404";
- response.StatusCode = 404;
- return e.ToString();
- }
- }
-
- private void Update()
- {
- HandleContext();
- }
-
- private void HandleContext()
- {
- if (_contexts.Count < 1) return;
- var context = _contexts.Dequeue();
- var request = context.Request;
- var response = context.Response;
- // 如果是js的ajax请求,还可以设置跨域的ip地址与参数
- context.Response.AppendHeader("Access-Control-Allow-Origin", "*");
- context.Response.ContentType = "text/plain;charset=UTF-8";
- context.Response.AddHeader("Content-type", "text/json"); //添加响应头信息
- context.Response.ContentEncoding = Encoding.UTF8;
-
- string returnObj = HandleRequest(request, response); //定义返回客户端的信息
-
- Debug.Log("返回内容=" + returnObj);
- var returnByteArr = Encoding.UTF8.GetBytes(returnObj); //设置客户端返回信息的编码
- try
- {
- using (var stream = response.OutputStream)
- {
- //把处理信息返回到客户端
- stream.Write(returnByteArr, 0, returnByteArr.Length);
- }
- }
- catch (Exception ex)
- {
- Debug.LogError($"远程调试异常:{ex}");
- }
- }
-
- ///
- /// 获取本机IP
- ///
- ///
- private string GetIP()
- {
- try
- {
- var ips = Dns.GetHostAddresses(Dns.GetHostName());
- var localIp = ips.First(ip => ip.AddressFamily == AddressFamily.InterNetwork);
- return localIp.ToString();
- }
- catch (Exception e)
- {
- Debug.LogError(e);
- return string.Empty;
- }
- }
- }
-#endif
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services/Debug/DebugRemoteServer.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services/Debug/DebugRemoteServer.cs.meta
deleted file mode 100644
index b32a38f23..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services/Debug/DebugRemoteServer.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 32cd4999e50b4e2980d22792f53a5f40
-timeCreated: 1679831911
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services/IDecryptionServices.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services/IDecryptionServices.cs
deleted file mode 100644
index f637caa00..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services/IDecryptionServices.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-namespace NBC.Asset
-{
- public struct DecryptFileInfo
- {
- ///
- /// 资源包名称
- ///
- public string BundleName;
-
- ///
- /// 文件路径
- ///
- public string FilePath;
- }
-
- ///
- /// 解密类服务接口
- ///
- public interface IDecryptionServices
- {
- ///
- /// 文件偏移解密方法
- ///
- ulong LoadFromFileOffset(DecryptFileInfo fileInfo);
-
- ///
- /// 文件内存解密方法
- ///
- byte[] LoadFromMemory(DecryptFileInfo fileInfo);
-
- ///
- /// 文件流解密方法
- ///
- System.IO.FileStream LoadFromStream(DecryptFileInfo fileInfo);
-
- ///
- /// 文件流解密的托管缓存大小
- ///
- uint GetManagedReadBufferSize();
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services/IDecryptionServices.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services/IDecryptionServices.cs.meta
deleted file mode 100644
index 4cd7d31bf..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services/IDecryptionServices.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 93a19c9344864bcaaa364b72644b8df1
-timeCreated: 1677125520
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services/Recycler.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services/Recycler.cs
deleted file mode 100644
index 2474f20b6..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services/Recycler.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-using System.Collections.Generic;
-
-namespace NBC.Asset
-{
- public interface IRecyclable
- {
- bool IsDestroyed { get; }
- bool CanDestroy { get; }
- void Destroy();
- }
-
- ///
- /// 资源回收器
- ///
- public static class Recycler
- {
- ///
- /// 当前运行的回收任务
- ///
- static readonly List Coroutines = new List();
-
- ///
- /// 准备要运行的回收任务
- ///
- static readonly List ReadyTask = new List();
-
-
- public static void Add(IRecyclable recyclable)
- {
- ReadyTask.Add(recyclable);
- }
-
- ///
- /// 取消回收
- ///
- ///
- public static void Cancel(IRecyclable recyclable)
- {
- ReadyTask.Remove(recyclable);
- }
-
- public static void Update()
- {
- //正在加载时,不卸载资源
- if (TaskRunner.ProviderRunner.RunningTaskNum > 0) return;
- for (var i = 0; i < ReadyTask.Count; i++)
- {
- var task = ReadyTask[i];
- if (!task.CanDestroy) continue;
- ReadyTask.RemoveAt(i);
- Coroutines.Add(task);
- i--;
- }
-
- for (var i = 0; i < Coroutines.Count; i++)
- {
- var task = Coroutines[i];
- Coroutines.RemoveAt(i);
- i--;
- if (task.IsDestroyed) continue;
- if (task.CanDestroy) task.Destroy();
- }
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services/Recycler.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services/Recycler.cs.meta
deleted file mode 100644
index 72da68211..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Services/Recycler.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 0a68b7437aa942838124a1717199c5cb
-timeCreated: 1679229337
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks.meta
deleted file mode 100644
index 067f9eaca..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: ad5d171e13704e538c9ea9f8ab3a2725
-timeCreated: 1678173529
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/AssetTaskBase.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/AssetTaskBase.cs
deleted file mode 100644
index 2331f7679..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/AssetTaskBase.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-namespace NBC.Asset
-{
- // public class AssetTaskBase : Task
- // {
- // public override void Run(IRunner runner = null)
- // {
- // Reset();
- // if (runner == null)
- // {
- // runner = TaskRunner.DefRunner;
- // }
- //
- // runner.Run(this);
- // }
- // }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/AssetTaskBase.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/AssetTaskBase.cs.meta
deleted file mode 100644
index 6010c4fed..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/AssetTaskBase.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: a230a7ede67349d0ac9560cbfc937cbf
-timeCreated: 1678766484
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download.meta
deleted file mode 100644
index 8c94ab03b..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 26f8ef4bac2749ff9c5eba207ffc611f
-timeCreated: 1678178605
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadBundlesTask.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadBundlesTask.cs
deleted file mode 100644
index 7570d55d3..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadBundlesTask.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.Collections.Generic;
-
-namespace NBC.Asset
-{
- ///
- /// 下载当前版本资源包任务
- ///
- public class DownloadBundlesTask : DownloadTaskBase
- {
- private readonly SequenceTaskCollection _taskList = new SequenceTaskCollection();
- private readonly List _downloadBundles;
-
- public DownloadBundlesTask(List downloadBundles)
- {
- _downloadBundles = downloadBundles;
- }
-
- protected override void OnStart()
- {
- foreach (var bundle in _downloadBundles)
- {
- if (bundle.LoadMode != BundleLoadMode.LoadFromRemote) continue;
- var bundleData = bundle.Bundle;
- _taskList.AddTask(new DownloadFileTask(bundleData.RemoteDataFilePath, bundleData.CachedDataFilePath,
- bundleData.Hash));
- }
-
- _taskList.Run(TaskRunner.DownloadRunner);
- }
-
- protected override NTaskStatus OnProcess()
- {
- return _taskList.IsDone ? NTaskStatus.Success : NTaskStatus.Running;
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadBundlesTask.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadBundlesTask.cs.meta
deleted file mode 100644
index 8db2cbd31..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadBundlesTask.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: dbe7d222c526467784688d950118b1b4
-timeCreated: 1678689987
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadCertificateHandler.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadCertificateHandler.cs
deleted file mode 100644
index ea3b8abb4..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadCertificateHandler.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using UnityEngine.Networking;
-
-namespace NBC.Asset
-{
- public class DownloadCertificateHandler : CertificateHandler
- {
- protected override bool ValidateCertificate(byte[] certificateData)
- {
- return true;
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadCertificateHandler.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadCertificateHandler.cs.meta
deleted file mode 100644
index e31456209..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadCertificateHandler.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 2f6add9368cc45bcb0720de176a19000
-timeCreated: 1679280715
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadFileTask.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadFileTask.cs
deleted file mode 100644
index 96ecbeca2..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadFileTask.cs
+++ /dev/null
@@ -1,300 +0,0 @@
-using System.IO;
-using UnityEngine;
-using UnityEngine.Networking;
-
-namespace NBC.Asset
-{
- ///
- /// 下载文件
- ///
- public class DownloadFileTask : DownloadTaskBase
- {
- private const string DownloadHeaderKey = "Content-Length";
- private const int RetryDownloadCount = 3;
-
- public readonly string DownloadPath;
-
- public readonly string SavePath;
- public readonly string FileHash;
-
- ///
- /// 开启断点续传
- ///
- public bool ReDownload = true;
-
- public DownloadFileTask(string path, string savePath, string hash = "")
- {
- DownloadPath = path;
- SavePath = savePath;
- FileHash = hash;
- }
-
- public enum DownLoadStatus
- {
- None,
- GetHeader,
- PrepareDownload,
- Download,
- VerifyingFile,
- Success,
- Failed,
- }
-
- private ulong _downloadTotalSize = 1;
- private UnityWebRequest _content;
- private UnityWebRequest _header;
- private bool _isAbort;
- private ulong _latestDownloadBytes;
- private float _latestDownloadRealtime;
- private ulong _fileOriginLength;
- private int RetryCount;
-
- private long ResponseCode = 0;
-
- public DownLoadStatus DownloadStatus { get; protected internal set; } = DownLoadStatus.None;
- public override float Progress => DownloadedBytes * 1f / DownloadTotalSize;
-
- public ulong DownloadedBytes { get; protected set; }
-
- public ulong DownloadTotalSize
- {
- get => _downloadTotalSize;
- set
- {
- _downloadTotalSize = value;
- if (_downloadTotalSize < 1) _downloadTotalSize = 1;
- }
- }
-
-
- public void Abort()
- {
- Fail("abort");
- Dispose();
- }
-
- protected override void OnStart()
- {
- DownloadStatus = DownLoadStatus.GetHeader;
- }
-
- protected override NTaskStatus OnProcess()
- {
- if (DownloadStatus == DownLoadStatus.GetHeader)
- {
- _header = UnityWebRequest.Head(DownloadPath);
- _header.SendWebRequest();
- DownloadStatus = DownLoadStatus.PrepareDownload;
- }
-
- if (DownloadStatus == DownLoadStatus.PrepareDownload)
- {
- if (_header == null)
- {
- Fail($"get header info error");
- Debug.LogError("get header info error");
- return NTaskStatus.Fail;
- }
-
- if (!_header.isDone) return NTaskStatus.Running;
-
- Reset();
- //远程文件信息
- var value = _header.GetResponseHeader(DownloadHeaderKey);
- if (ulong.TryParse(value, out var totalSize))
- {
- DownloadTotalSize = totalSize;
- }
-
- if (ReDownload)
- {
- //读取未下载完成的文件信息
- var tempInfo = new FileInfo(SavePath);
- if (tempInfo.Exists)
- {
- _fileOriginLength = (ulong)tempInfo.Length;
- if (_fileOriginLength == DownloadTotalSize)
- {
- DownloadedBytes = _fileOriginLength;
- DownloadStatus = DownLoadStatus.VerifyingFile;
- return NTaskStatus.Running;
- }
- }
- }
- else
- {
- _fileOriginLength = 0;
- }
-
- _content = UnityWebRequest.Get(DownloadPath);
- if (_fileOriginLength > 0)
- {
- Debug.Log($"断点续传===={_fileOriginLength} path={DownloadPath}");
-#if UNITY_2019_1_OR_NEWER
- _content.SetRequestHeader("Range", $"bytes={_fileOriginLength}-");
- _content.downloadHandler = new DownloadHandlerFile(SavePath, true);
-#else
- _request.DownloadedBytes = 0;
- _content.downloadHandler = new DownloadHandlerFile(TempPath);
-#endif
- }
- else
- {
- _content.downloadHandler = new DownloadHandlerFile(SavePath);
- }
-
- _content.certificateHandler = new DownloadCertificateHandler();
- _content.disposeDownloadHandlerOnDispose = true;
- _content.disposeCertificateHandlerOnDispose = true;
- _content.disposeUploadHandlerOnDispose = true;
- _content.SendWebRequest();
- DownloadStatus = DownLoadStatus.Download;
- }
-
- if (DownloadStatus == DownLoadStatus.Download)
- {
- DownloadedBytes = _fileOriginLength + _content.downloadedBytes;
- if (!_content.isDone)
- {
- CheckTimeout();
- return NTaskStatus.Running;
- }
-
- bool hasError = false;
- // 检查网络错误
-#if UNITY_2020_3_OR_NEWER
- if (_content.result != UnityWebRequest.Result.Success)
- {
- hasError = true;
- _errorMsg = _content.error;
- ResponseCode = _content.responseCode;
- }
-#else
- if (_content.isNetworkError || _content.isHttpError)
- {
- hasError = true;
- _errorMsg = _content.error;
- ResponseCode = _content.responseCode;
- }
-#endif
- // 如果网络异常
- if (hasError)
- {
- RetryCount++;
- if (RetryCount <= RetryDownloadCount)
- {
- Debug.Log($"网络异常 重新开始下载={DownloadPath} code={ResponseCode} msg={_content.error}");
- //重新开始下载
- DownloadStatus = DownLoadStatus.PrepareDownload;
- }
- else
- {
- //重试后还是网络错误,直接失败
- Debug.Log("重试后还是网络错误,直接失败");
- DownloadStatus = DownLoadStatus.Failed;
- }
- }
- else
- {
- DownloadStatus = DownLoadStatus.VerifyingFile;
- }
- }
-
- if (DownloadStatus == DownLoadStatus.VerifyingFile)
- {
- Dispose();
- var tryPass = false;
- var tempInfo = new FileInfo(SavePath);
-
- if (tempInfo.Exists)
- {
- if (tempInfo.Length == (long)DownloadTotalSize)
- {
- tryPass = true;
- }
- else
- {
- _errorMsg = "file size error";
- }
-
- if (!string.IsNullOrEmpty(FileHash))
- {
- var hash = Util.ComputeHash(SavePath);
- if (FileHash.Equals(hash))
- {
- tryPass = true;
- }
- else
- {
- _errorMsg = "file hash error";
- }
- }
- }
- else
- {
- _errorMsg = "file not exists";
- }
-
- if (!tryPass)
- {
- // 验证失败后删除文件
- if (File.Exists(SavePath))
- File.Delete(SavePath);
- Debug.Log("验证失败后删除文件,尝试重新下载");
- //重新下载
- DownloadStatus = DownLoadStatus.PrepareDownload;
- }
- else
- {
- DownloadStatus = DownLoadStatus.Success;
- }
- }
-
- if (DownloadStatus == DownLoadStatus.Success)
- {
- return NTaskStatus.Success;
- }
-
- if (DownloadStatus == DownLoadStatus.Failed)
- {
- return NTaskStatus.Fail;
- }
-
- return NTaskStatus.Running;
- }
-
-
- private void CheckTimeout()
- {
- if (_isAbort) return;
-
- if (_latestDownloadBytes != DownloadedBytes)
- {
- _latestDownloadBytes = DownloadedBytes;
- _latestDownloadRealtime = Time.realtimeSinceStartup;
- }
-
- float offset = Time.realtimeSinceStartup - _latestDownloadRealtime;
- if (_latestDownloadRealtime > 0 && offset > Const.DownloadTimeOut)
- {
- _content.Abort();
- _isAbort = true;
- }
- }
-
- private void Dispose()
- {
- if (_header != null)
- {
- _header.Dispose();
- _header = null;
- }
-
- if (_content != null)
- {
- _content.Dispose();
- _content = null;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadFileTask.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadFileTask.cs.meta
deleted file mode 100644
index a43b3ef9a..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadFileTask.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: fc534770270e47bd9b36acb09ba8bad9
-timeCreated: 1678176990
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadRunner.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadRunner.cs
deleted file mode 100644
index a1f5d3344..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadRunner.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-namespace NBC.Asset
-{
- public class DownloadRunner: Runner
- {
-
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadRunner.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadRunner.cs.meta
deleted file mode 100644
index f6ad98753..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadRunner.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: b4f1c82b77b844fca292c3226b3a1620
-timeCreated: 1678761539
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadTaskBase.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadTaskBase.cs
deleted file mode 100644
index 609107c1d..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadTaskBase.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using System;
-
-namespace NBC.Asset
-{
- public class DownloadTaskBase : NTask
- {
- public virtual void Run()
- {
- Run(TaskRunner.DownloadRunner);
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadTaskBase.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadTaskBase.cs.meta
deleted file mode 100644
index 00145c745..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Download/DownloadTaskBase.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 321c6ff70e3b45138a9af2585706447f
-timeCreated: 1678762460
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization.meta
deleted file mode 100644
index f38d0decd..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 986e39ec068243938bc33d4beb6931f7
-timeCreated: 1678178617
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/EditorInitializationTask.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/EditorInitializationTask.cs
deleted file mode 100644
index e62aa1f0a..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/EditorInitializationTask.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-namespace NBC.Asset
-{
- ///
- /// 编辑器初始化任务
- ///
- internal sealed class EditorInitializationTask : InitializationTask
- {
- public override float Progress => _taskList.Progress;
- private readonly SequenceTaskCollection _taskList = new SequenceTaskCollection();
-
- protected override void OnStart()
- {
- _taskList.AddTask(new RunFunctionTask(Addressable.Load));
- _taskList.Run(TaskRunner.Def);
- }
-
- protected override NTaskStatus OnProcess()
- {
- return _taskList.IsDone ? NTaskStatus.Success : NTaskStatus.Running;
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/EditorInitializationTask.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/EditorInitializationTask.cs.meta
deleted file mode 100644
index 24bdb51a5..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/EditorInitializationTask.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: a024ad33e47f472bac1560a1445a86e0
-timeCreated: 1678289705
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/InitializationTask.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/InitializationTask.cs
deleted file mode 100644
index 1d52f3071..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/InitializationTask.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-namespace NBC.Asset
-{
- public abstract class InitializationTask : NTask
- {
-
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/InitializationTask.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/InitializationTask.cs.meta
deleted file mode 100644
index ddab3aa86..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/InitializationTask.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 0ddf142fca6745ffab9246551b920fb5
-timeCreated: 1678178623
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/OfflineInitializationTask.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/OfflineInitializationTask.cs
deleted file mode 100644
index d66a731d7..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/OfflineInitializationTask.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-namespace NBC.Asset
-{
- ///
- /// 离线模式初始化任务
- ///
- internal sealed class OfflineInitializationTask : InitializationTask
- {
- public override float Progress => _taskList.Progress;
- private readonly SequenceTaskCollection _taskList = new SequenceTaskCollection();
-
- protected override void OnStart()
- {
- _taskList.AddTask(new CheckCoverInstallTask());
- _taskList.AddTask(new UnpackVersionTask());
- _taskList.AddTask(new CheckUnpackPackageTask());
- _taskList.AddTask(new RunFunctionTask(Addressable.Load));
- _taskList.Run(TaskRunner.Def);
- }
-
- protected override NTaskStatus OnProcess()
- {
- return _taskList.IsDone ? _taskList.Status : NTaskStatus.Running;
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/OfflineInitializationTask.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/OfflineInitializationTask.cs.meta
deleted file mode 100644
index 4d0594e85..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/OfflineInitializationTask.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: ae221ab297cd4bad9ee57abccd8bf15a
-timeCreated: 1678289694
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/OnlineInitializationTask.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/OnlineInitializationTask.cs
deleted file mode 100644
index 725edb79a..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/OnlineInitializationTask.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-namespace NBC.Asset
-{
- ///
- /// 线上模式初始化任务
- /// 优先从persistentData读取,如果没有,则从StreamingAssets拷贝清单文件到解压目录
- ///
- internal sealed class OnlineInitializationTask : InitializationTask
- {
- public override float Progress => _taskList.Progress;
- private readonly SequenceTaskCollection _taskList = new SequenceTaskCollection();
-
- protected override void OnStart()
- {
- _taskList.AddTask(new CheckCoverInstallTask());
- _taskList.AddTask(new UnpackVersionTask(true));
- _taskList.AddTask(new CheckUnpackPackageTask(true));
- _taskList.AddTask(new RunFunctionTask(Addressable.Load));
- _taskList.Run(TaskRunner.Def);
- }
-
- protected override NTaskStatus OnProcess()
- {
- return _taskList.IsDone ? _taskList.Status : NTaskStatus.Running;
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/OnlineInitializationTask.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/OnlineInitializationTask.cs.meta
deleted file mode 100644
index 36f8a6c15..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/OnlineInitializationTask.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: f61ebb0aa33b4ad29959494481b9f791
-timeCreated: 1678289682
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/StepTasks.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/StepTasks.meta
deleted file mode 100644
index 41fd3b99a..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/StepTasks.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 4eb2452a725944268e0beb871bbd6a22
-timeCreated: 1678290546
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/StepTasks/CheckCoverInstallTask.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/StepTasks/CheckCoverInstallTask.cs
deleted file mode 100644
index 0beb82898..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/StepTasks/CheckCoverInstallTask.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-namespace NBC.Asset
-{
- ///
- /// 检查是否覆盖安装相关操作
- ///
- public class CheckCoverInstallTask : NTask
- {
- protected override NTaskStatus OnProcess()
- {
- return NTaskStatus.Success;
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/StepTasks/CheckCoverInstallTask.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/StepTasks/CheckCoverInstallTask.cs.meta
deleted file mode 100644
index 752a008bd..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/StepTasks/CheckCoverInstallTask.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 5320f83282e844c398ba79be297eabca
-timeCreated: 1678291123
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/StepTasks/CheckUnpackPackageTask.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/StepTasks/CheckUnpackPackageTask.cs
deleted file mode 100644
index 3638c678e..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/StepTasks/CheckUnpackPackageTask.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-using System.IO;
-
-namespace NBC.Asset
-{
- ///
- /// 检查是否需要解压package清单文件
- ///
- public class CheckUnpackPackageTask : NTask
- {
- private readonly ParallelTaskCollection _taskList = new ParallelTaskCollection();
- private readonly bool _download;
-
- public CheckUnpackPackageTask(bool download = false)
- {
- _download = download;
- }
-
- protected override void OnStart()
- {
- var versionData = Util.ReadJson(Const.GetCachePath(Const.VersionFileName));
- if (versionData != null)
- {
- var cachePath = Const.GetCachePath(versionData.NameHash);
- if (!File.Exists(cachePath))
- {
- _taskList.AddTask(new UnpackFileTask(versionData.NameHash, _download));
- }
- }
-
- _taskList.Run(TaskRunner.Def);
- }
-
- protected override NTaskStatus OnProcess()
- {
- return _taskList.IsDone ? _taskList.Status : NTaskStatus.Running;
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/StepTasks/CheckUnpackPackageTask.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/StepTasks/CheckUnpackPackageTask.cs.meta
deleted file mode 100644
index 9a0850f54..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Initialization/StepTasks/CheckUnpackPackageTask.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: b8a22acc2aba454e9ebab180f56b2427
-timeCreated: 1678610857
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Provider.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Provider.meta
deleted file mode 100644
index cf078eef9..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Provider.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 89ae896710534240ba9eef93e8d5cb29
-timeCreated: 1679225311
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Provider/ProviderRunner.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Provider/ProviderRunner.cs
deleted file mode 100644
index 8f2d87615..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Provider/ProviderRunner.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace NBC.Asset
-{
- public class ProviderRunner : Runner
- {
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Provider/ProviderRunner.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Provider/ProviderRunner.cs.meta
deleted file mode 100644
index 07f465878..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Provider/ProviderRunner.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 0c2dd1bfc154446d958ee446f6df2c30
-timeCreated: 1679225326
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/RunFunctionTask.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/RunFunctionTask.cs
deleted file mode 100644
index 00da38f7c..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/RunFunctionTask.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-
-namespace NBC.Asset
-{
- public class RunFunctionTask : NTask
- {
- private readonly Action _action;
-
- public RunFunctionTask(Action action)
- {
- _action = action;
- }
-
- protected override void OnStart()
- {
- _action?.Invoke();
- Finish();
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/RunFunctionTask.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/RunFunctionTask.cs.meta
deleted file mode 100644
index 43fb5e9e7..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/RunFunctionTask.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 08fc4f83348346ec9092cd019a4d0c07
-timeCreated: 1678610568
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/TaskRunner.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/TaskRunner.cs
deleted file mode 100644
index 7cec08fce..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/TaskRunner.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-namespace NBC.Asset
-{
- public static class TaskRunner
- {
- #region Static
-
- public static readonly DownloadRunner DownloadRunner = new DownloadRunner();
- public static readonly ProviderRunner ProviderRunner = new ProviderRunner();
- public static readonly Runner Def = new Runner();
-
-
- public static void Update()
- {
- DownloadRunner.Process();
- ProviderRunner.Process();
- Def.Process();
- }
-
- #endregion
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/TaskRunner.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/TaskRunner.cs.meta
deleted file mode 100644
index 9c0807138..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/TaskRunner.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: a7125bea4a9b4d80a044469ce0e81f4c
-timeCreated: 1678762319
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Unpack.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Unpack.meta
deleted file mode 100644
index 60bb02a96..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Unpack.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 1535c7c444cc41c680aeff9570417415
-timeCreated: 1678681206
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Unpack/UnpackFileTask.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Unpack/UnpackFileTask.cs
deleted file mode 100644
index cb06c298a..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Unpack/UnpackFileTask.cs
+++ /dev/null
@@ -1,106 +0,0 @@
-using System.IO;
-using UnityEngine.Networking;
-
-namespace NBC.Asset
-{
- ///
- /// 解压文件到指定目录
- ///
- public class UnpackFileTask : NTask
- {
- private enum Steps
- {
- LoadStreaming,
- Download,
- Done,
- }
-
- private readonly string _fileName;
- private readonly string _savePath;
- private Steps _steps;
- private NTaskStatus _taskStatus = NTaskStatus.Success;
- private UnityWebRequest _request;
- private DownloadFileTask _downloadFileTask;
- private bool _download;
-
- public UnpackFileTask(string fileName, bool download = false)
- {
- _fileName = fileName;
- _savePath = Const.GetCachePath(fileName);
- _download = download;
- }
-
-
- protected override void OnStart()
- {
- if (File.Exists(_savePath))
- {
- File.Delete(_savePath);
- }
-
- _steps = Steps.LoadStreaming;
- }
-
-
- protected override NTaskStatus OnProcess()
- {
- if (_steps == Steps.LoadStreaming)
- {
- _progress = 0;
- if (_request == null)
- {
- var filePath = Const.GetStreamingPath(_fileName);
- _request = UnityWebRequest.Get(filePath);
- _request.downloadHandler = new DownloadHandlerFile(_savePath);
- _request.SendWebRequest();
- }
-
- _progress = _request.downloadProgress * 0.5f;
-
- if (!_request.isDone) return NTaskStatus.Running;
- if (_request.result == UnityWebRequest.Result.Success)
- {
- //结束,判断是否成功
- if (File.Exists(_savePath))
- {
- _progress = 1;
- _steps = Steps.Done;
- }
- else
- {
- if (_download)
- {
- _taskStatus = NTaskStatus.Fail;
- _steps = Steps.Download;
- }
- }
- }
- else
- {
- if (_download)
- {
- _taskStatus = NTaskStatus.Fail;
- _steps = Steps.Download;
- }
- }
- }
- else if (_steps == Steps.Download)
- {
- if (_downloadFileTask == null)
- {
- _downloadFileTask = new DownloadFileTask(Const.GetRemotePath(_fileName), _savePath);
- _downloadFileTask.Run();
- }
-
- _progress = 0.5f + _downloadFileTask.Progress * 0.5f;
- if (!_downloadFileTask.IsDone) return NTaskStatus.Running;
- _taskStatus = _downloadFileTask.Status;
- _steps = Steps.Done;
- _progress = 1;
- }
-
-
- return _steps == Steps.Done ? _taskStatus : NTaskStatus.Running;
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Unpack/UnpackFileTask.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Unpack/UnpackFileTask.cs.meta
deleted file mode 100644
index d8bd9b2d1..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Unpack/UnpackFileTask.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: d8ab8a4dc8dd4137b6f28a7a4180199e
-timeCreated: 1678608659
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Unpack/UnpackPackagesTask.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Unpack/UnpackPackagesTask.cs
deleted file mode 100644
index 9edb65d22..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Unpack/UnpackPackagesTask.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-namespace NBC.Asset
-{
- ///
- /// 解压资源包任务
- ///
- public class UnpackPackagesTask : NTask
- {
- private readonly ParallelTaskCollection _taskList = new ParallelTaskCollection();
-
- public override float Progress => _taskList.Progress;
-
- protected override void OnStart()
- {
- _taskList.ParallelNum = 5;
- var bundles = Addressable.GetCanUnpackBundles();
- foreach (var bundle in bundles)
- {
- _taskList.AddTask(new UnpackFileTask(bundle.Bundle.NameHash));
- }
-
- _taskList.Run(TaskRunner.Def);
- }
-
- protected override NTaskStatus OnProcess()
- {
- return _taskList.IsDone ? NTaskStatus.Success : NTaskStatus.Running;
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Unpack/UnpackPackagesTask.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Unpack/UnpackPackagesTask.cs.meta
deleted file mode 100644
index b6dbc5a13..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Unpack/UnpackPackagesTask.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 2766582c3bd64d04a342ffd7c335c78c
-timeCreated: 1678681264
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Unpack/UnpackVersionTask.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Unpack/UnpackVersionTask.cs
deleted file mode 100644
index fb3b6313b..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Unpack/UnpackVersionTask.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using System.IO;
-
-namespace NBC.Asset
-{
- public class UnpackVersionTask : NTask
- {
- private readonly bool _download;
- private readonly string _savePath;
- private UnpackFileTask _unpackFileTask;
-
- public UnpackVersionTask(bool download = false)
- {
- _savePath = Const.GetCachePath(Const.VersionFileName);
- _download = download;
- }
-
- protected override void OnStart()
- {
- if (File.Exists(_savePath))
- {
- Finish();
- }
- else
- {
- _unpackFileTask = new UnpackFileTask(Const.VersionFileName, _download);
- _unpackFileTask.Run(TaskRunner.Def);
- }
- }
-
- protected override NTaskStatus OnProcess()
- {
- if (_unpackFileTask != null)
- {
- return _unpackFileTask.Status;
- }
-
- return NTaskStatus.Success;
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Unpack/UnpackVersionTask.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Unpack/UnpackVersionTask.cs.meta
deleted file mode 100644
index 134c8301c..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Unpack/UnpackVersionTask.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: e1f227f69183cd14284e786c29c74120
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Update.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Update.meta
deleted file mode 100644
index 6b86cc87e..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Update.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: dee2f81c0c774940a5852483047cb886
-timeCreated: 1678695432
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Update/CheckUpdateTask.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Update/CheckUpdateTask.cs
deleted file mode 100644
index 1230eebcf..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Update/CheckUpdateTask.cs
+++ /dev/null
@@ -1,159 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace NBC.Asset
-{
- ///
- /// 检查更新内容任务
- ///
- public class CheckUpdateTask : NTask
- {
- public readonly UpdateContext Context = new UpdateContext();
-
- enum Step
- {
- ///
- /// 获取远程版本清单
- ///
- GetVersionData,
-
- ///
- /// 检测版本清单
- ///
- CheckVersionData,
-
- ///
- /// 获取包清单
- ///
- GetPackageData,
-
- ///
- /// 检查包清单
- ///
- CheckPackageData,
- Success,
- }
-
- private Step _step = Step.GetVersionData;
-
- private DownloadFileTask _getVersionFileTask;
-
- private DownloadFileTask _getPackageTask;
-
- protected override NTaskStatus OnProcess()
- {
- if (Const.Simulate) return NTaskStatus.Success;
- if (_step == Step.GetVersionData)
- {
- if (_getVersionFileTask == null)
- {
- _getVersionFileTask = new DownloadFileTask(
- Const.GetRemotePath($"{Const.VersionFileName}?t={Util.GetTimestamp()}"),
- Const.GetCacheTempPath(Const.VersionFileName));
- _getVersionFileTask.ReDownload = false;
- _getVersionFileTask.Run();
- }
-
- if (!_getVersionFileTask.IsDone) return NTaskStatus.Running;
- _step = Step.CheckVersionData;
- }
-
- if (_step == Step.CheckVersionData)
- {
- CheckVersionData();
- }
-
- if (_step == Step.GetPackageData)
- {
- if (Context.NewVersionData == null)
- {
- _step = Step.Success;
- return NTaskStatus.Running;
- }
-
- if (_getPackageTask == null)
- {
- var newVersionData = Context.NewVersionData;
- var fileName = newVersionData.NameHash;
- _getPackageTask = new DownloadFileTask(Const.GetRemotePath(fileName),
- Const.GetCacheTempPath(fileName), newVersionData.Hash);
- _getPackageTask.Run(TaskRunner.Def);
- }
-
- if (!_getPackageTask.IsDone) return NTaskStatus.Running;
- _step = Step.CheckPackageData;
- }
-
- if (_step == Step.CheckPackageData)
- {
- //检查需要下载的bundle信息
- CheckPackageData();
- }
-
-
- return NTaskStatus.Success;
- }
-
- private void CheckVersionData()
- {
- var newVersionData = Util.ReadJson(Const.GetCacheTempPath(Const.VersionFileName));
- var nowVersionData = Addressable.GetVersionData();
- if (newVersionData != null)
- {
- if (newVersionData.Hash == nowVersionData.Hash && newVersionData.Size == nowVersionData.Size)
- {
- //没有变化,不需要检查
- _step = Step.Success;
- return;
- }
-
- Context.NewVersionData = newVersionData;
- }
-
- _step = Step.GetPackageData;
- }
-
-
- ///
- /// 检查资源包需要更新的bundle
- ///
- private void CheckPackageData()
- {
- var fileName = Context.NewVersionData.NameHash;
- var versionPackageData = Util.ReadJson(Const.GetCacheTempPath(fileName));
- if (versionPackageData != null)
- {
- foreach (var package in versionPackageData.Packages)
- {
- var can = package.Def == 1 || Assets.IsNeedfulPackage(package.Name);
- //不需要检测的包直接跳过
- if (!can) return;
- var oldPackageData = Addressable.GetPackageData(package.Name);
- var different = CompareBundles(package.Bundles, oldPackageData.Bundles);
- if (different.Count > 0)
- {
- foreach (var data in different)
- {
- Context.NeedUpdateBundleList.Add(data);
- }
- }
- }
- }
- }
-
- private List CompareBundles(List newBundles, List oldBundles)
- {
- List list = new List();
- foreach (var bundle in newBundles)
- {
- var o = oldBundles.Find(b => b.Name == bundle.Name);
- if (o == null || o.Hash != bundle.Hash || o.Size != bundle.Size)
- {
- list.Add(bundle);
- }
- }
-
- return list;
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Update/CheckUpdateTask.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Update/CheckUpdateTask.cs.meta
deleted file mode 100644
index 8735fb67b..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Update/CheckUpdateTask.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: c86b2e1c83c44b5392fc5b315955ea62
-timeCreated: 1678695473
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Update/UpdateContext.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Update/UpdateContext.cs
deleted file mode 100644
index 26140c1a0..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Update/UpdateContext.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System.Collections.Generic;
-using System.Linq;
-
-namespace NBC.Asset
-{
- public class UpdateContext
- {
- ///
- /// 需要更新的文件总大小
- ///
- public long DownloadTotalSize => NeedUpdateBundleList.Sum(data => data.Size);
-
- ///
- /// 需要更新的bundles
- ///
- public readonly HashSet NeedUpdateBundleList = new HashSet();
-
- // ///
- // /// 需要更新的package
- // ///
- // public readonly HashSet NeedVersionPackages = new HashSet();
-
- public VersionData NewVersionData;
-
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Update/UpdateContext.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Update/UpdateContext.cs.meta
deleted file mode 100644
index 7b306a73a..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Update/UpdateContext.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 2c885b61fa9f498996c98a6c15c988ca
-timeCreated: 1678802682
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Update/UpdateVersionTask.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Update/UpdateVersionTask.cs
deleted file mode 100644
index c367a4f48..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Update/UpdateVersionTask.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-using System.Collections.Generic;
-using System.IO;
-
-namespace NBC.Asset
-{
- ///
- /// 更新版本内容任务
- ///
- public class UpdateVersionTask : DownloadTaskBase
- {
- private UpdateContext _context;
- private SequenceTaskCollection _sequence = new SequenceTaskCollection();
- private ParallelTaskCollection _downloadParallel = new ParallelTaskCollection();
- public override float Progress => _downloadParallel.Progress;
-
- public UpdateVersionTask(UpdateContext context)
- {
- _context = context;
- }
-
- protected override void OnStart()
- {
- _sequence.FailBreak = true;
- _downloadParallel.ParallelNum = 5;
- _downloadParallel.FailBreak = true;
- var bundles = _context.NeedUpdateBundleList;
- if (bundles != null && bundles.Count > 0)
- {
- foreach (var bundle in bundles)
- {
- _downloadParallel.AddTask(new DownloadFileTask(bundle.RemoteDataFilePath,
- bundle.CachedDataFilePath));
- }
-
- _sequence.AddTask(_downloadParallel);
- }
-
- _sequence.AddTask(new RunFunctionTask(TryCoverNewVersionData));
- _sequence.AddTask(new RunFunctionTask(Addressable.Load));
-
- _sequence.Run(TaskRunner.DownloadRunner);
- }
-
- protected override NTaskStatus OnProcess()
- {
- return _sequence.IsDone ? _sequence.Status : NTaskStatus.Running;
- }
-
- ///
- /// 尝试覆盖旧的版本清单文件
- ///
- private void TryCoverNewVersionData()
- {
- if (_context.NewVersionData != null)
- {
- var nameHash = _context.NewVersionData.NameHash;
- //覆盖旧的清单文件
- File.Copy(Const.GetCacheTempPath(nameHash), Const.GetCachePath(nameHash), true);
- }
-
- //覆盖旧的version.json
- File.Copy(Const.GetCacheTempPath(Const.VersionFileName), Const.GetCachePath(Const.VersionFileName), true);
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Update/UpdateVersionTask.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Update/UpdateVersionTask.cs.meta
deleted file mode 100644
index 47304f077..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Tasks/Update/UpdateVersionTask.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 613c439d2f0342cdb2ec473d38a3c0a3
-timeCreated: 1678769071
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Utils.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Utils.meta
deleted file mode 100644
index 873ead52a..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Utils.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: b1320ef18b534b9c94e8b5bf027db8dc
-timeCreated: 1675051510
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Utils/Mono.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Utils/Mono.cs
deleted file mode 100644
index e6520d29c..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Utils/Mono.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-using System;
-using UnityEngine;
-
-namespace NBC.Asset
-{
- public class Mono : MonoBehaviour
- {
- public static void AddUpdate(Action action)
- {
- Inst.OnUpdate += action;
- }
-
- public static void RemoveUpdate(Action action)
- {
- Inst.OnUpdate -= action;
- }
-
- private event Action OnUpdate;
-
- private static bool IsQuiting { get; set; }
-
- private static Mono _inst;
-
- private static Mono Inst => _inst;
-
- protected void OnApplicationQuit()
- {
- IsQuiting = true;
- }
-
- protected void Awake()
- {
- if (_inst != null)
- {
- DestroyImmediate(this.gameObject);
- return;
- }
-
- DontDestroyOnLoad(gameObject);
- _inst = this;
- }
-
- protected void Update()
- {
- OnUpdate?.Invoke();
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Utils/Mono.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Utils/Mono.cs.meta
deleted file mode 100644
index b73b23ca7..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Utils/Mono.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 65fa40d33dad48ce98cf96a06fcb1923
-timeCreated: 1676445894
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Utils/StreamingAssetsUtil.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Utils/StreamingAssetsUtil.cs
deleted file mode 100644
index 39092c6a9..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Utils/StreamingAssetsUtil.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-using UnityEngine;
-
-namespace NBC.Asset
-{
- public sealed class StreamingAssetsUtil
- {
-#if UNITY_ANDROID && !UNITY_EDITOR
- private static AndroidJavaClass _unityPlayerClass;
- public static AndroidJavaClass UnityPlayerClass
- {
- get
- {
- if (_unityPlayerClass == null)
- _unityPlayerClass = new UnityEngine.AndroidJavaClass("com.unity3d.player.UnityPlayer");
- return _unityPlayerClass;
- }
- }
-
- private static AndroidJavaObject _currentActivity;
- public static AndroidJavaObject CurrentActivity
- {
- get
- {
- if (_currentActivity == null)
- _currentActivity = UnityPlayerClass.GetStatic("currentActivity");
- return _currentActivity;
- }
- }
-
- ///
- /// 利用安卓原生接口查询内置文件是否存在
- ///
- public static bool FileExists(string filePath)
- {
- return CurrentActivity.Call("CheckAssetExist", filePath);
- }
-#else
- public static bool FileExists(string filePath)
- {
- return System.IO.File.Exists(System.IO.Path.Combine(Application.streamingAssetsPath, filePath));
- }
-#endif
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Utils/StreamingAssetsUtil.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Utils/StreamingAssetsUtil.cs.meta
deleted file mode 100644
index 148d30ee7..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Utils/StreamingAssetsUtil.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 51cf1710fc4454b43af24289d9f807d5
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Utils/Util.cs b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Utils/Util.cs
deleted file mode 100644
index d5c61ba86..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Utils/Util.cs
+++ /dev/null
@@ -1,108 +0,0 @@
-using System;
-using System.IO;
-using System.Security.Cryptography;
-using System.Text;
-using UnityEngine;
-
-namespace NBC.Asset
-{
- public static class Util
- {
- public static long GetTimestamp()
- {
- var timeSpan = DateTime.Now.ToUniversalTime() - new DateTime(1970, 1, 1, 0, 0, 0, 0);
- return Convert.ToInt64(timeSpan.TotalSeconds);
- }
- public static DateTime TimestampToTime(long timestamp)
- {
- DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
- return startTime.AddSeconds(timestamp);
- }
-
- public static string GetFriendlySize(long byteSize)
- {
- string[] sizes = { "B", "KB", "MB", "GB", "TB" };
- int order = 0;
- long prevOrderRemainder = 0;
- while (byteSize >= 1024 && order < sizes.Length - 1)
- {
- order++;
- prevOrderRemainder = byteSize % 1024;
- byteSize /= 1024;
- }
-
- double byteSizeFloat = byteSize + (double)prevOrderRemainder / 1024;
-
- string result = $"{byteSizeFloat:0.##}{sizes[order]}";
- return result;
- }
-
- public static string GetAssetGUID(string path, Type type)
- {
- return type == null ? $"{path}[null]" : $"{path}[{type.Name}]";
- }
-
- public static string NameAddHash(string name, string hash)
- {
- var ext = Path.GetExtension(name);
- var nameWithExt = name.Replace(ext, string.Empty);
- return $"{nameWithExt}_{hash}{ext}";
- }
-
- public static int GetFileSize(string path)
- {
- if (!File.Exists(path)) return 0;
- var bytes = File.ReadAllBytes(path);
- return bytes.Length;
- }
-
- public static string ComputeHash(byte[] bytes)
- {
- var data = MD5.Create().ComputeHash(bytes);
- return GetHash(data);
- }
-
- public static string ComputeHash(string filePath)
- {
- if (!File.Exists(filePath))
- {
- return string.Empty;
- }
-
- using (var stream = File.OpenRead(filePath))
- {
- return GetHash(MD5.Create().ComputeHash(stream));
- }
- }
-
- public static string GetHash(byte[] bytes)
- {
- var sb = new StringBuilder();
- foreach (var b in bytes)
- {
- sb.Append(b.ToString("x2"));
- }
-
- return sb.ToString();
- }
-
-
- public static void WriteJson(object so, string filePath)
- {
- var json = JsonUtility.ToJson(so);
-
- File.WriteAllText(filePath, json);
- }
-
- public static T ReadJson(string filePath)
- {
- if (File.Exists(filePath))
- {
- var json = File.ReadAllText(filePath);
- return JsonUtility.FromJson(json);
- }
-
- return default;
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Utils/Util.cs.meta b/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Utils/Util.cs.meta
deleted file mode 100644
index 5fd81e0e5..000000000
--- a/Assets/Scripts/NBC~/Runtime/Asset/Runtime/Utils/Util.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 806e9a48e3054f61acd04f83fe429b24
-timeCreated: 1675051516
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Core.meta b/Assets/Scripts/NBC~/Runtime/Core.meta
deleted file mode 100644
index 12f960bbf..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: 076d59bda84794582abf2d7b23d3cc01
-folderAsset: yes
-DefaultImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Runtime/Core/App.cs b/Assets/Scripts/NBC~/Runtime/Core/App.cs
deleted file mode 100644
index bcb6a3957..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/App.cs
+++ /dev/null
@@ -1,107 +0,0 @@
-using System;
-using System.Collections.Generic;
-using UnityEngine;
-
-namespace NBC
-{
- public partial class App : MonoBehaviour
- {
- public static App Inst { get; private set; }
-
- private static Scene _scene;
- public static Scene Main => _scene;
- private static event Action OnInitialized;
-
- public static event Action OnUpdate;
- public static event Action OnLateUpdate;
- public static event Action OnFixedUpdate;
- public static event Action OnApplicationQuitAction;
- public static event Action OnApplicationPauseAction;
-
- ///
- /// Scene下的事件系统组件
- ///
- public static UIComponent UI { get; internal set; }
-
- public static void Init(Action callback = null)
- {
- if (Inst != null) return;
- new GameObject("App").AddComponent();
- OnInitialized += callback;
- }
-
- private void Awake()
- {
- Inst = this;
- DontDestroyOnLoad(gameObject);
- }
-
- private void Start()
- {
- StartAsync().Coroutine();
- }
-
- private void Update()
- {
- OnUpdate?.Invoke();
- }
-
- private void LateUpdate()
- {
- OnLateUpdate?.Invoke();
- }
-
- private void FixedUpdate()
- {
- OnFixedUpdate?.Invoke();
- }
-
- private void OnApplicationQuit()
- {
- OnApplicationQuitAction?.Invoke();
- }
-
- private void OnApplicationPause(bool pauseStatus)
- {
- OnApplicationPauseAction?.Invoke();
- }
-
- private void OnDestroy()
- {
- _scene?.Dispose();
- }
-
- private async FTask StartAsync()
- {
- // 初始化框架
- var assemblies = AppDomain.CurrentDomain.GetAssemblies();
- List loadAssemblies = new List();
- foreach (var assembly in assemblies)
- {
- // 跳过系统程序集以提高性能(可选)
- if (IsSystemAssembly(assembly))
- continue;
- loadAssemblies.Add(assembly);
- }
-
- await NBC.Platform.Unity.Entry.Initialize(loadAssemblies.ToArray());
- _scene = await Scene.Create(SceneRuntimeMode.MainThread);
- UI = _scene.AddComponent();
- OnInitialized?.Invoke();
- }
-
- // 判断是否是系统程序集(可选优化)
- private static bool IsSystemAssembly(System.Reflection.Assembly assembly)
- {
- string assemblyName = assembly.FullName;
- return assemblyName.StartsWith("System") ||
- assemblyName.StartsWith("Microsoft.") ||
- assemblyName.StartsWith("UnityEngine") ||
- assemblyName.StartsWith("UnityEditor") ||
- assemblyName.StartsWith("mscorlib") ||
- assemblyName.StartsWith("netstandard") ||
- assemblyName.StartsWith("nunit.") ||
- assemblyName.StartsWith("Unity.");
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Core/App.cs.meta b/Assets/Scripts/NBC~/Runtime/Core/App.cs.meta
deleted file mode 100644
index 24f0b21f2..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/App.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 28c45f379c66403cbe3cc294b3f6e657
-timeCreated: 1751440516
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Core/Assembly.meta b/Assets/Scripts/NBC~/Runtime/Core/Assembly.meta
deleted file mode 100644
index 19f46f054..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/Assembly.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: b5b24e6eec64b4702b871053139f8add
-folderAsset: yes
-DefaultImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Runtime/Core/Assembly/AssemblyInfo.cs b/Assets/Scripts/NBC~/Runtime/Core/Assembly/AssemblyInfo.cs
deleted file mode 100644
index 7f6c1d074..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/Assembly/AssemblyInfo.cs
+++ /dev/null
@@ -1,89 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using NBC.DataStructure.Collection;
-
-// ReSharper disable CollectionNeverQueried.Global
-#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
-
-namespace NBC.Assembly
-{
- ///
- /// AssemblyInfo提供有关程序集和类型的信息
- ///
- public sealed class AssemblyInfo
- {
- ///
- /// 唯一标识
- ///
- public readonly long AssemblyIdentity;
- ///
- /// 获取或设置与此程序集相关联的 实例。
- ///
- public System.Reflection.Assembly Assembly { get; private set; }
- ///
- /// 程序集类型集合,获取一个列表,包含从程序集加载的所有类型。
- ///
- public readonly List AssemblyTypeList = new List();
- ///
- /// 程序集类型分组集合,获取一个分组列表,将接口类型映射到实现这些接口的类型。
- ///
- public readonly OneToManyList AssemblyTypeGroupList = new OneToManyList();
-
- ///
- /// 初始化 类的新实例。
- ///
- ///
- public AssemblyInfo(long assemblyIdentity)
- {
- AssemblyIdentity = assemblyIdentity;
- }
-
- ///
- /// 从指定的程序集加载类型信息并进行分类。
- ///
- /// 要加载信息的程序集。
- public void Load(System.Reflection.Assembly assembly)
- {
- Assembly = assembly;
- var assemblyTypes = assembly.GetTypes().ToList();
-
- foreach (var type in assemblyTypes)
- {
- if (type.IsAbstract || type.IsInterface)
- {
- continue;
- }
-
- var interfaces = type.GetInterfaces();
-
- foreach (var interfaceType in interfaces)
- {
- AssemblyTypeGroupList.Add(interfaceType, type);
- }
- }
-
- AssemblyTypeList.AddRange(assemblyTypes);
- }
-
- ///
- /// 重新加载程序集的类型信息。
- ///
- ///
- public void ReLoad(System.Reflection.Assembly assembly)
- {
- Unload();
- Load(assembly);
- }
-
- ///
- /// 卸载程序集的类型信息。
- ///
- public void Unload()
- {
- AssemblyTypeList.Clear();
- AssemblyTypeGroupList.Clear();
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Core/Assembly/AssemblyInfo.cs.meta b/Assets/Scripts/NBC~/Runtime/Core/Assembly/AssemblyInfo.cs.meta
deleted file mode 100644
index b5e3a2846..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/Assembly/AssemblyInfo.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 6588e9470957646dfa79849126de341c
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Runtime/Core/Assembly/AssemblySystem.cs b/Assets/Scripts/NBC~/Runtime/Core/Assembly/AssemblySystem.cs
deleted file mode 100644
index 25de73752..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/Assembly/AssemblySystem.cs
+++ /dev/null
@@ -1,286 +0,0 @@
-using System;
-using System.Collections.Concurrent;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Security.Cryptography;
-using System.Text;
-using NBC.Async;
-using NBC.Helper;
-
-#pragma warning disable CS8604 // Possible null reference argument.
-#pragma warning disable CS8602 // Dereference of a possibly null reference.
-#pragma warning disable CS8603
-#pragma warning disable CS8618
-namespace NBC.Assembly
-{
- ///
- /// 管理程序集加载和卸载的帮助类。
- ///
- public static class AssemblySystem
- {
-#if FANTASY_WEBGL
- private static readonly List AssemblySystems = new List();
- private static readonly Dictionary AssemblyList = new Dictionary();
-#else
- private static readonly ConcurrentQueue AssemblySystems = new ConcurrentQueue();
- private static readonly ConcurrentDictionary AssemblyList = new ConcurrentDictionary();
-#endif
- ///
- /// 初始化 AssemblySystem。(仅限内部)
- ///
- ///
- internal static async FTask InnerInitialize(params System.Reflection.Assembly[] assemblies)
- {
- await LoadAssembly(typeof(AssemblySystem).Assembly);
- foreach (var assembly in assemblies)
- {
- await LoadAssembly(assembly);
- }
- }
-
- ///
- /// 加载指定的程序集,并触发相应的事件。
- ///
- /// 要加载的程序集。
- /// 如果当前Domain中已经存在同名的Assembly,使用Domain中的程序集。
- public static async FTask LoadAssembly(System.Reflection.Assembly assembly, bool isCurrentDomain = true)
- {
- if (isCurrentDomain)
- {
- var currentDomainAssemblies = System.AppDomain.CurrentDomain.GetAssemblies();
- var currentAssembly = currentDomainAssemblies.FirstOrDefault(d => d.GetName().Name == assembly.GetName().Name);
- if (currentAssembly != null)
- {
- assembly = currentAssembly;
- }
- }
-
- var assemblyIdentity = AssemblyIdentity(assembly);
-
- if (AssemblyList.TryGetValue(assemblyIdentity, out var assemblyInfo))
- {
- assemblyInfo.ReLoad(assembly);
- foreach (var assemblySystem in AssemblySystems)
- {
- await assemblySystem.ReLoad(assemblyIdentity);
- }
- }
- else
- {
- assemblyInfo = new AssemblyInfo(assemblyIdentity);
- assemblyInfo.Load(assembly);
- AssemblyList.TryAdd(assemblyIdentity, assemblyInfo);
- foreach (var assemblySystem in AssemblySystems)
- {
- await assemblySystem.Load(assemblyIdentity);
- }
- }
- }
-
- ///
- /// 卸载程序集
- ///
- ///
- public static async FTask UnLoadAssembly(System.Reflection.Assembly assembly)
- {
- var assemblyIdentity = AssemblyIdentity(assembly);
-
- if (!AssemblyList.Remove(assemblyIdentity, out var assemblyInfo))
- {
- return;
- }
-
- assemblyInfo.Unload();
- foreach (var assemblySystem in AssemblySystems)
- {
- await assemblySystem.OnUnLoad(assemblyIdentity);
- }
- }
-
- ///
- /// 将AssemblySystem接口的object注册到程序集管理中心
- ///
- ///
- public static async FTask Register(object obj)
- {
- if (obj is not IAssembly assemblySystem)
- {
- return;
- }
-#if FANTASY_WEBGL
- AssemblySystems.Add(assemblySystem);
-#else
- AssemblySystems.Enqueue(assemblySystem);
-#endif
- foreach (var (assemblyIdentity, _) in AssemblyList)
- {
- await assemblySystem.Load(assemblyIdentity);
- }
- }
-
- ///
- /// 程序集管理中心卸载注册的Load、ReLoad、UnLoad的接口
- ///
- ///
- public static void UnRegister(object obj)
- {
- if (obj is not IAssembly assemblySystem)
- {
- return;
- }
-#if FANTASY_WEBGL
- AssemblySystems.Remove(assemblySystem);
-#else
- var count = AssemblySystems.Count;
-
- for (var i = 0; i < count; i++)
- {
- if (!AssemblySystems.TryDequeue(out var removeAssemblySystem))
- {
- continue;
- }
-
- if (removeAssemblySystem == assemblySystem)
- {
- break;
- }
-
- AssemblySystems.Enqueue(removeAssemblySystem);
- }
-#endif
- }
-
- ///
- /// 获取所有已加载程序集中的所有类型。
- ///
- /// 所有已加载程序集中的类型。
- public static IEnumerable ForEach()
- {
- foreach (var (_, assemblyInfo) in AssemblyList)
- {
- foreach (var type in assemblyInfo.AssemblyTypeList)
- {
- yield return type;
- }
- }
- }
-
- ///
- /// 获取指定程序集中的所有类型。
- ///
- /// 程序集唯一标识。
- /// 指定程序集中的类型。
- public static IEnumerable ForEach(long assemblyIdentity)
- {
- if (!AssemblyList.TryGetValue(assemblyIdentity, out var assemblyInfo))
- {
- yield break;
- }
-
- foreach (var type in assemblyInfo.AssemblyTypeList)
- {
- yield return type;
- }
- }
-
- ///
- /// 获取所有已加载程序集中实现指定类型的所有类型。
- ///
- /// 要查找的基类或接口类型。
- /// 所有已加载程序集中实现指定类型的类型。
- public static IEnumerable ForEach(Type findType)
- {
- foreach (var (_, assemblyInfo) in AssemblyList)
- {
- if (!assemblyInfo.AssemblyTypeGroupList.TryGetValue(findType, out var assemblyLoad))
- {
- continue;
- }
-
- foreach (var type in assemblyLoad)
- {
- yield return type;
- }
- }
- }
-
- ///
- /// 获取指定程序集中实现指定类型的所有类型。
- ///
- /// 程序集唯一标识。
- /// 要查找的基类或接口类型。
- /// 指定程序集中实现指定类型的类型。
- public static IEnumerable ForEach(long assemblyIdentity, Type findType)
- {
- if (!AssemblyList.TryGetValue(assemblyIdentity, out var assemblyInfo))
- {
- yield break;
- }
-
- if (!assemblyInfo.AssemblyTypeGroupList.TryGetValue(findType, out var assemblyLoad))
- {
- yield break;
- }
-
- foreach (var type in assemblyLoad)
- {
- yield return type;
- }
- }
-
- ///
- /// 获取指定程序集的实例。
- ///
- /// 程序集名称。
- /// 指定程序集的实例,如果未加载则返回 null。
- public static System.Reflection.Assembly GetAssembly(long assemblyIdentity)
- {
- return !AssemblyList.TryGetValue(assemblyIdentity, out var assemblyInfo) ? null : assemblyInfo.Assembly;
- }
-
- ///
- /// 获取当前框架注册的Assembly
- ///
- ///
- public static IEnumerable ForEachAssembly
- {
- get
- {
- foreach (var (_, assemblyInfo) in AssemblyList)
- {
- yield return assemblyInfo.Assembly;
- }
- }
- }
-
- ///
- /// 根据Assembly的强命名计算唯一标识。
- ///
- ///
- ///
- private static long AssemblyIdentity(System.Reflection.Assembly assembly)
- {
- return HashCodeHelper.ComputeHash64(assembly.GetName().Name);
- }
-
- ///
- /// 释放资源,卸载所有加载的程序集。
- ///
- public static void Dispose()
- {
- DisposeAsync().Coroutine();
- }
-
- private static async FTask DisposeAsync()
- {
- foreach (var (_, assemblyInfo) in AssemblyList.ToArray())
- {
- await UnLoadAssembly(assemblyInfo.Assembly);
- }
-
- AssemblyList.Clear();
- AssemblySystems.Clear();
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Core/Assembly/AssemblySystem.cs.meta b/Assets/Scripts/NBC~/Runtime/Core/Assembly/AssemblySystem.cs.meta
deleted file mode 100644
index 6474bd994..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/Assembly/AssemblySystem.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 6f06892fa649d49c287bf07095569ae0
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Runtime/Core/Assembly/IAssembly.cs b/Assets/Scripts/NBC~/Runtime/Core/Assembly/IAssembly.cs
deleted file mode 100644
index f86c9f13c..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/Assembly/IAssembly.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using System;
-using NBC.Async;
-
-namespace NBC.Assembly
-{
- ///
- /// 实现这个接口、会再程序集首次加载、卸载、重载的时候调用
- ///
- public interface IAssembly : IDisposable
- {
- ///
- /// 程序集加载时调用
- ///
- /// 程序集标识
- public FTask Load(long assemblyIdentity);
- ///
- /// 程序集重新加载的时候调用
- ///
- /// 程序集标识
- public FTask ReLoad(long assemblyIdentity);
- ///
- /// 卸载的时候调用
- ///
- /// 程序集标识
- public FTask OnUnLoad(long assemblyIdentity);
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Core/Assembly/IAssembly.cs.meta b/Assets/Scripts/NBC~/Runtime/Core/Assembly/IAssembly.cs.meta
deleted file mode 100644
index 11db0dc68..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/Assembly/IAssembly.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: f14fcbf29decc4d47b6c548a3d5f2a3f
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Runtime/Core/DataStructure.meta b/Assets/Scripts/NBC~/Runtime/Core/DataStructure.meta
deleted file mode 100644
index 9aa09d412..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/DataStructure.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: afe876696fb5f4779abe3289a3bf4f9f
-folderAsset: yes
-DefaultImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection.meta b/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection.meta
deleted file mode 100644
index 04e1280a4..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: 0b3d477f03f404310b5ad48f89d1f193
-folderAsset: yes
-DefaultImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/CircularBuffer.cs b/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/CircularBuffer.cs
deleted file mode 100644
index d7a68c06e..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/CircularBuffer.cs
+++ /dev/null
@@ -1,346 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type.
-#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
-
-namespace NBC.DataStructure.Collection
-{
- /// 环形缓存(自增式缓存,自动扩充、不会收缩缓存、所以不要用这个操作过大的IO流)
- /// 1、环大小8192,溢出的会自动增加环的大小。
- /// 2、每个块都是一个环形缓存,当溢出的时候会自动添加到下一个环中。
- /// 3、当读取完成后用过的环会放在缓存中,不会销毁掉。
- ///
- /// 自增式缓存类,继承自 Stream 和 IDisposable 接口。
- /// 环形缓存具有自动扩充的特性,但不会收缩,适用于操作不过大的 IO 流。
- ///
- public sealed class CircularBuffer : Stream, IDisposable
- {
- private byte[] _lastBuffer;
- ///
- /// 环形缓存块的默认大小
- ///
- public const int ChunkSize = 8192;
- private readonly Queue _bufferCache = new Queue();
- private readonly Queue _bufferQueue = new Queue();
- ///
- /// 获取或设置环形缓存的第一个索引位置
- ///
- public int FirstIndex { get; set; }
- ///
- /// 获取或设置环形缓存的最后一个索引位置
- ///
- public int LastIndex { get; set; }
- ///
- /// 获取环形缓存的总长度
- ///
- public override long Length
- {
- get
- {
- if (_bufferQueue.Count == 0)
- {
- return 0;
- }
-
- return (_bufferQueue.Count - 1) * ChunkSize + LastIndex - FirstIndex;
- }
- }
-
- ///
- /// 获取环形缓存的第一个块
- ///
- public byte[] First
- {
- get
- {
- if (_bufferQueue.Count == 0)
- {
- AddLast();
- }
-
- return _bufferQueue.Peek();
- }
- }
-
- ///
- /// 获取环形缓存的最后一个块
- ///
- public byte[] Last
- {
- get
- {
- if (_bufferQueue.Count == 0)
- {
- AddLast();
- }
-
- return _lastBuffer;
- }
- }
- ///
- /// 向环形缓存中添加一个新的块
- ///
- public void AddLast()
- {
- var buffer = _bufferCache.Count > 0 ? _bufferCache.Dequeue() : new byte[ChunkSize];
- _bufferQueue.Enqueue(buffer);
- _lastBuffer = buffer;
- }
- ///
- /// 从环形缓存中移除第一个块
- ///
- public void RemoveFirst()
- {
- _bufferCache.Enqueue(_bufferQueue.Dequeue());
- }
-
- ///
- /// 从流中读取指定数量的数据到缓存。
- ///
- /// 源数据流。
- /// 要读取的字节数。
- public void Read(Stream stream, int count)
- {
- if (count > Length)
- {
- throw new Exception($"bufferList length < count, {Length} {count}");
- }
-
- var copyCount = 0;
- while (copyCount < count)
- {
- var n = count - copyCount;
- if (ChunkSize - FirstIndex > n)
- {
- stream.Write(First, FirstIndex, n);
- FirstIndex += n;
- copyCount += n;
- }
- else
- {
- stream.Write(First, FirstIndex, ChunkSize - FirstIndex);
- copyCount += ChunkSize - FirstIndex;
- FirstIndex = 0;
- RemoveFirst();
- }
- }
- }
-
- ///
- /// 从缓存中读取指定数量的数据到内存。
- ///
- /// 目标内存。
- /// 要读取的字节数。
- public void Read(Memory memory, int count)
- {
- if (count > Length)
- {
- throw new Exception($"bufferList length < count, {Length} {count}");
- }
-
- var copyCount = 0;
- while (copyCount < count)
- {
- var n = count - copyCount;
- var asMemory = First.AsMemory();
-
- if (ChunkSize - FirstIndex > n)
- {
- var slice = asMemory.Slice(FirstIndex, n);
- slice.CopyTo(memory.Slice(copyCount, n));
- FirstIndex += n;
- copyCount += n;
- }
- else
- {
- var length = ChunkSize - FirstIndex;
- var slice = asMemory.Slice(FirstIndex, length);
- slice.CopyTo(memory.Slice(copyCount, length));
- copyCount += ChunkSize - FirstIndex;
- FirstIndex = 0;
- RemoveFirst();
- }
- }
- }
-
- ///
- /// 从自定义流中读取数据到指定的缓冲区。
- ///
- /// 目标缓冲区,用于存储读取的数据。
- /// 目标缓冲区中的起始偏移量。
- /// 要读取的字节数。
- /// 实际读取的字节数。
- public override int Read(byte[] buffer, int offset, int count)
- {
- if (buffer.Length < offset + count)
- {
- throw new Exception($"buffer length < count, buffer length: {buffer.Length} {offset} {count}");
- }
-
- var length = Length;
- if (length < count)
- {
- count = (int) length;
- }
-
- var copyCount = 0;
-
- // 循环直到成功读取所需的字节数
- while (copyCount < count)
- {
- var copyLength = count - copyCount;
-
- if (ChunkSize - FirstIndex > copyLength)
- {
- // 将数据从当前块的缓冲区复制到目标缓冲区
- Array.Copy(First, FirstIndex, buffer, copyCount + offset, copyLength);
-
- FirstIndex += copyLength;
- copyCount += copyLength;
- continue;
- }
-
- // 复制当前块中剩余的数据,并切换到下一个块
- Array.Copy(First, FirstIndex, buffer, copyCount + offset, ChunkSize - FirstIndex);
- copyCount += ChunkSize - FirstIndex;
- FirstIndex = 0;
-
- RemoveFirst();
- }
-
- return count;
- }
-
- ///
- /// 将数据从给定的字节数组写入流中。
- ///
- /// 包含要写入的数据的字节数组。
- public void Write(byte[] buffer)
- {
- Write(buffer, 0, buffer.Length);
- }
-
- ///
- /// 将数据从给定的流写入流中。
- ///
- /// 包含要写入的数据的流。
- public void Write(Stream stream)
- {
- var copyCount = 0;
- var count = (int) (stream.Length - stream.Position);
-
- while (copyCount < count)
- {
- if (LastIndex == ChunkSize)
- {
- AddLast();
- LastIndex = 0;
- }
-
- var n = count - copyCount;
-
- if (ChunkSize - LastIndex > n)
- {
- _ = stream.Read(Last, LastIndex, n);
- LastIndex += count - copyCount;
- copyCount += n;
- }
- else
- {
- _ = stream.Read(Last, LastIndex, ChunkSize - LastIndex);
- copyCount += ChunkSize - LastIndex;
- LastIndex = ChunkSize;
- }
- }
- }
-
- ///
- /// 将数据从给定的字节数组写入流中。
- ///
- /// 包含要写入的数据的字节数组。
- /// 开始写入的缓冲区中的索引。
- /// 要写入的字节数。
- public override void Write(byte[] buffer, int offset, int count)
- {
- var copyCount = 0;
-
- while (copyCount < count)
- {
- if (ChunkSize == LastIndex)
- {
- AddLast();
- LastIndex = 0;
- }
-
- var byteLength = count - copyCount;
-
- if (ChunkSize - LastIndex > byteLength)
- {
- Array.Copy(buffer, copyCount + offset, Last, LastIndex, byteLength);
- LastIndex += byteLength;
- copyCount += byteLength;
- }
- else
- {
- Array.Copy(buffer, copyCount + offset, Last, LastIndex, ChunkSize - LastIndex);
- copyCount += ChunkSize - LastIndex;
- LastIndex = ChunkSize;
- }
- }
- }
-
- ///
- /// 获取一个值,指示流是否支持读取操作。
- ///
- public override bool CanRead { get; } = true;
- ///
- /// 获取一个值,指示流是否支持寻找操作。
- ///
- public override bool CanSeek { get; } = false;
- ///
- /// 获取一个值,指示流是否支持写入操作。
- ///
- public override bool CanWrite { get; } = true;
- ///
- /// 获取或设置流中的位置。
- ///
- public override long Position { get; set; }
-
- ///
- /// 刷新流(在此实现中引发未实现异常)。
- ///
- public override void Flush()
- {
- throw new NotImplementedException();
- }
-
- ///
- /// 在流中寻找特定位置(在此实现中引发未实现异常)。
- ///
- public override long Seek(long offset, SeekOrigin origin)
- {
- throw new NotImplementedException();
- }
-
- ///
- /// 设置流的长度(在此实现中引发未实现异常)。
- ///
- public override void SetLength(long value)
- {
- throw new NotImplementedException();
- }
-
- ///
- /// 释放 CustomStream 使用的所有资源。
- ///
- public new void Dispose()
- {
- _bufferQueue.Clear();
- _lastBuffer = null;
- FirstIndex = 0;
- LastIndex = 0;
- base.Dispose();
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/CircularBuffer.cs.meta b/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/CircularBuffer.cs.meta
deleted file mode 100644
index ee284a26f..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/CircularBuffer.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 38264758f23d1448a975efc4f4b7da63
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/ConcurrentOneToManyListPool.cs b/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/ConcurrentOneToManyListPool.cs
deleted file mode 100644
index d8a5e94e0..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/ConcurrentOneToManyListPool.cs
+++ /dev/null
@@ -1,197 +0,0 @@
-#if !FANTASY_WEBGL
-using System;
-using System.Collections.Concurrent;
-using System.Collections.Generic;
-using System.Linq;
-using NBC.Pool;
-
-#pragma warning disable CS8603 // Possible null reference return.
-
-namespace NBC.DataStructure.Collection
-{
- ///
- /// 并发的一对多列表池,用于维护具有相同键的多个值的关联关系,实现了 接口。
- ///
- /// 关键字的类型,不能为空。
- /// 值的类型。
- public class ConcurrentOneToManyListPool : ConcurrentOneToManyList, IDisposable, IPool where TKey : notnull
- {
- private bool _isPool;
- private bool _isDispose;
-
- ///
- /// 创建一个 的实例。
- ///
- /// 创建的实例。
- public static ConcurrentOneToManyListPool Create()
- {
- var a = MultiThreadPool.Rent>();
- a._isDispose = false;
- a._isPool = true;
- return a;
- }
-
- ///
- /// 释放实例占用的资源。
- ///
- public void Dispose()
- {
- if (_isDispose)
- {
- return;
- }
-
- _isDispose = true;
- // 清空实例的数据
- Clear();
- // 将实例返回到池中以便重用
- MultiThreadPool.Return(this);
- }
-
- ///
- /// 获取一个值,该值指示当前实例是否为对象池中的实例。
- ///
- ///
- public bool IsPool()
- {
- return _isPool;
- }
-
- ///
- /// 设置一个值,该值指示当前实例是否为对象池中的实例。
- ///
- ///
- public void SetIsPool(bool isPool)
- {
- _isPool = isPool;
- }
- }
-
- ///
- /// 并发的一对多列表,用于维护具有相同键的多个值的关联关系。
- ///
- /// 关键字的类型,不能为空。
- /// 值的类型。
- public class ConcurrentOneToManyList : ConcurrentDictionary> where TKey : notnull
- {
- private readonly Queue> _queue = new Queue>();
- private readonly int _recyclingLimit = 120;
-
- ///
- /// 初始化 类的新实例。
- ///
- public ConcurrentOneToManyList()
- {
- }
-
- ///
- /// 设置最大缓存数量
- ///
- ///
- /// 1:防止数据量过大、所以超过recyclingLimit的数据还是走GC.
- /// 2:设置成0不控制数量,全部缓存
- ///
- public ConcurrentOneToManyList(int recyclingLimit)
- {
- _recyclingLimit = recyclingLimit;
- }
-
- ///
- /// 判断指定键的列表是否包含指定值。
- ///
- /// 要搜索的键。
- /// 要搜索的值。
- /// 如果列表包含值,则为 true;否则为 false。
- public bool Contains(TKey key, TValue value)
- {
- TryGetValue(key, out var list);
-
- return list != null && list.Contains(value);
- }
-
- ///
- /// 向指定键的列表中添加一个值。
- ///
- /// 要添加值的键。
- /// 要添加的值。
- public void Add(TKey key, TValue value)
- {
- if (!TryGetValue(key, out var list))
- {
- list = Fetch();
- list.Add(value);
- base[key] = list;
- return;
- }
-
- list.Add(value);
- }
-
- ///
- /// 获取指定键的列表中的第一个值。
- ///
- /// 要获取第一个值的键。
- /// 指定键的列表中的第一个值,如果不存在则为默认值。
- public TValue First(TKey key)
- {
- return !TryGetValue(key, out var list) ? default : list.FirstOrDefault();
- }
-
- ///
- /// 从指定键的列表中移除一个值。
- ///
- /// 要移除值的键。
- /// 要移除的值。
- public void RemoveValue(TKey key, TValue value)
- {
- if (!TryGetValue(key, out var list)) return;
-
- list.Remove(value);
-
- if (list.Count == 0) RemoveKey(key);
- }
-
- ///
- /// 从字典中移除指定键以及其关联的列表。
- ///
- /// 要移除的键。
- public void RemoveKey(TKey key)
- {
- if (!TryRemove(key, out var list)) return;
-
- Recycle(list);
- }
-
- ///
- /// 从队列中获取一个列表,如果队列为空则创建一个新的列表。
- ///
- /// 获取的列表。
- private List Fetch()
- {
- return _queue.Count <= 0 ? new List() : _queue.Dequeue();
- }
-
- ///
- /// 将一个列表回收到队列中。
- ///
- /// 要回收的列表。
- private void Recycle(List list)
- {
- list.Clear();
-
- if (_recyclingLimit != 0 && _queue.Count > _recyclingLimit) return;
-
- _queue.Enqueue(list);
- }
-
- ///
- /// 清空当前类的数据,包括从基类继承的数据以及自定义的数据队列。
- ///
- protected new void Clear()
- {
- base.Clear();
- _queue.Clear();
- }
- }
-}
-#endif
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/ConcurrentOneToManyListPool.cs.meta b/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/ConcurrentOneToManyListPool.cs.meta
deleted file mode 100644
index 3b3b7d2ba..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/ConcurrentOneToManyListPool.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 21b2d3135b133441aa08c5eb1768a103
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/ConcurrentOneToManyQueuePool.cs b/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/ConcurrentOneToManyQueuePool.cs
deleted file mode 100644
index e6ee79ff6..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/ConcurrentOneToManyQueuePool.cs
+++ /dev/null
@@ -1,194 +0,0 @@
-#if !FANTASY_WEBGL
-using System;
-using System.Collections.Concurrent;
-using System.Collections.Generic;
-using NBC.Pool;
-
-#pragma warning disable CS8603
-
-namespace NBC.DataStructure.Collection
-{
- ///
- /// 表示一个并发的一对多队列池,用于维护具有相同键的多个值的关联关系,实现了 接口。
- ///
- /// 关键字的类型,不能为空。
- /// 值的类型。
- public class ConcurrentOneToManyQueuePool : ConcurrentOneToManyQueue, IDisposable, IPool where TKey : notnull
- {
- private bool _isPool;
- private bool _isDispose;
-
- ///
- /// 创建并返回一个 的实例。
- ///
- /// 创建的实例。
- public static ConcurrentOneToManyQueuePool Create()
- {
- var a = MultiThreadPool.Rent>();
- a._isDispose = false;
- a._isPool = true;
- return a;
- }
-
- ///
- /// 释放当前实例所占用的资源,并将实例返回到对象池中,以便重用。
- ///
- public void Dispose()
- {
- if (_isDispose)
- {
- return;
- }
-
- _isDispose = true;
- Clear();
- // 将实例返回到对象池中,以便重用
- MultiThreadPool.Return(this);
- }
-
- ///
- /// 获取一个值,该值指示当前实例是否为对象池中的实例。
- ///
- ///
- public bool IsPool()
- {
- return _isPool;
- }
-
- ///
- /// 设置一个值,该值指示当前实例是否为对象池中的实例。
- ///
- ///
- public void SetIsPool(bool isPool)
- {
- _isPool = isPool;
- }
- }
-
- ///
- /// 表示一个并发的一对多队列,用于维护具有相同键的多个值的关联关系。
- ///
- /// 关键字的类型,不能为空。
- /// 值的类型。
- public class ConcurrentOneToManyQueue : ConcurrentDictionary> where TKey : notnull
- {
- private readonly Queue> _queue = new Queue>();
- private readonly int _recyclingLimit;
-
- ///
- /// 设置最大缓存数量
- ///
- ///
- /// 1:防止数据量过大、所以超过recyclingLimit的数据还是走GC.
- /// 2:设置成0不控制数量,全部缓存
- ///
- public ConcurrentOneToManyQueue(int recyclingLimit = 0)
- {
- _recyclingLimit = recyclingLimit;
- }
-
- ///
- /// 判断指定键的队列是否包含指定值。
- ///
- /// 要搜索的键。
- /// 要搜索的值。
- /// 如果队列包含值,则为 true;否则为 false。
- public bool Contains(TKey key, TValue value)
- {
- TryGetValue(key, out var list);
-
- return list != null && list.Contains(value);
- }
-
- ///
- /// 向指定键的队列中添加一个值。
- ///
- /// 要添加值的键。
- /// 要添加的值。
- public void Enqueue(TKey key, TValue value)
- {
- if (!TryGetValue(key, out var list))
- {
- list = Fetch();
- list.Enqueue(value);
- TryAdd(key, list);
- return;
- }
-
- list.Enqueue(value);
- }
-
- ///
- /// 从指定键的队列中出队并返回一个值。
- ///
- /// 要出队的键。
- /// 出队的值,如果队列为空则为默认值。
- public TValue Dequeue(TKey key)
- {
- if (!TryGetValue(key, out var list) || list.Count == 0) return default;
-
- var value = list.Dequeue();
-
- if (list.Count == 0) RemoveKey(key);
-
- return value;
- }
-
- ///
- /// 尝试从指定键的队列中出队一个值。
- ///
- /// 要出队的键。
- /// 出队的值,如果队列为空则为默认值。
- /// 如果成功出队,则为 true;否则为 false。
- public bool TryDequeue(TKey key, out TValue value)
- {
- value = Dequeue(key);
-
- return value != null;
- }
-
- ///
- /// 从字典中移除指定键以及其关联的队列。
- ///
- /// 要移除的键。
- public void RemoveKey(TKey key)
- {
- if (!TryGetValue(key, out var list)) return;
-
- TryRemove(key, out _);
- Recycle(list);
- }
-
- ///
- /// 从队列中获取一个新的队列,如果队列为空则创建一个新的队列。
- ///
- /// 获取的队列。
- private Queue Fetch()
- {
- return _queue.Count <= 0 ? new Queue() : _queue.Dequeue();
- }
-
- ///
- /// 将一个队列回收到队列池中。
- ///
- /// 要回收的队列。
- private void Recycle(Queue list)
- {
- list.Clear();
-
- if (_recyclingLimit != 0 && _queue.Count > _recyclingLimit) return;
-
- _queue.Enqueue(list);
- }
-
- ///
- /// 清空当前类的数据,包括从基类继承的键值对字典中的数据以及自定义的队列池。
- ///
- protected new void Clear()
- {
- base.Clear();
- _queue.Clear();
- }
- }
-}
-#endif
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/ConcurrentOneToManyQueuePool.cs.meta b/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/ConcurrentOneToManyQueuePool.cs.meta
deleted file mode 100644
index 1497661d9..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/ConcurrentOneToManyQueuePool.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 50a0f004d8b7b4075a4ce01376e49375
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/HashSetPool.cs b/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/HashSetPool.cs
deleted file mode 100644
index 5e46af055..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/HashSetPool.cs
+++ /dev/null
@@ -1,134 +0,0 @@
-using System;
-using System.Collections.Generic;
-using NBC.Pool;
-
-namespace NBC.DataStructure.Collection
-{
- ///
- /// 可释放的哈希集合对象池。
- ///
- /// 哈希集合中元素的类型。
- public sealed class HashSetPool : HashSet, IDisposable, IPool
- {
- private bool _isPool;
- private bool _isDispose;
-
- ///
- /// 释放实例所占用的资源,并将实例返回到对象池中,以便重用。
- ///
- public void Dispose()
- {
- if (_isDispose)
- {
- return;
- }
-
- _isDispose = true;
- Clear();
-#if FANTASY_WEBGL
- Pool>.Return(this);
-#else
- MultiThreadPool.Return(this);
-#endif
- }
-
- ///
- /// 创建一个 哈希集合池的实例。
- ///
- /// 创建的实例。
- public static HashSetPool Create()
- {
-#if FANTASY_WEBGL
- var list = Pool>.Rent();
- list._isDispose = false;
- list._isPool = true;
- return list;
-#else
- var list = MultiThreadPool.Rent>();
- list._isDispose = false;
- list._isPool = true;
- return list;
-#endif
- }
-
- ///
- /// 获取一个值,该值指示当前实例是否为对象池中的实例。
- ///
- ///
- public bool IsPool()
- {
- return _isPool;
- }
-
- ///
- /// 设置一个值,该值指示当前实例是否为对象池中的实例。
- ///
- ///
- public void SetIsPool(bool isPool)
- {
- _isPool = isPool;
- }
- }
-
- ///
- /// 基本哈希集合对象池,他自持有实际的哈希集合。
- ///
- /// 哈希集合中元素的类型。
- public sealed class HashSetBasePool : IDisposable, IPool
- {
- private bool _isPool;
-
- ///
- /// 存储实际的哈希集合
- ///
- public HashSet Set = new HashSet();
-
- ///
- /// 创建一个 基本哈希集合对象池的实例。
- ///
- /// 创建的实例。
- public static HashSetBasePool Create()
- {
-#if FANTASY_WEBGL
- var hashSetBasePool = Pool>.Rent();
- hashSetBasePool._isPool = true;
- return hashSetBasePool;
-#else
- var hashSetBasePool = MultiThreadPool.Rent>();
- hashSetBasePool._isPool = true;
- return hashSetBasePool;
-#endif
- }
-
- ///
- /// 释放实例所占用的资源,并将实例返回到对象池中,以便重用。
- ///
- public void Dispose()
- {
- Set.Clear();
-#if FANTASY_WEBGL
- Pool>.Return(this);
-#else
- MultiThreadPool.Return(this);
-#endif
- }
-
- ///
- /// 获取一个值,该值指示当前实例是否为对象池中的实例。
- ///
- ///
- public bool IsPool()
- {
- return _isPool;
- }
-
- ///
- /// 设置一个值,该值指示当前实例是否为对象池中的实例。
- ///
- ///
- public void SetIsPool(bool isPool)
- {
- throw new NotImplementedException();
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/HashSetPool.cs.meta b/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/HashSetPool.cs.meta
deleted file mode 100644
index 27aadf41e..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/HashSetPool.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: c49468bddc6524c419ace92b9ad68a5d
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/ListPool.cs b/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/ListPool.cs
deleted file mode 100644
index 13c272fef..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/ListPool.cs
+++ /dev/null
@@ -1,101 +0,0 @@
-using System;
-using System.Collections.Generic;
-using NBC.Pool;
-
-// ReSharper disable ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract
-
-namespace NBC.DataStructure.Collection
-{
- ///
- /// 可释放的列表(List)对象池。
- ///
- /// 列表中元素的类型。
- public sealed class ListPool : List, IDisposable, IPool
- {
- private bool _isPool;
- private bool _isDispose;
-
- ///
- /// 释放实例所占用的资源,并将实例返回到对象池中,以便重用。
- ///
- public void Dispose()
- {
- if (_isDispose)
- {
- return;
- }
-
- _isDispose = true;
- Clear();
-#if FANTASY_WEBGL
- Pool>.Return(this);
-#else
- MultiThreadPool.Return(this);
-#endif
- }
-
- ///
- /// 使用指定的元素创建一个 列表(List)对象池的实例。
- ///
- /// 要添加到列表的元素。
- /// 创建的实例。
- public static ListPool Create(params T[] args)
- {
-#if FANTASY_WEBGL
- var list = Pool>.Rent();
-#else
- var list = MultiThreadPool.Rent>();
-#endif
- list._isDispose = false;
- list._isPool = true;
-
- if (args != null)
- {
- list.AddRange(args);
- }
-
- return list;
- }
-
- ///
- /// 使用指定的列表创建一个 列表(List)对象池的实例。
- ///
- /// 要添加到列表的元素列表。
- /// 创建的实例。
- public static ListPool Create(List args)
- {
-#if FANTASY_WEBGL
- var list = Pool>.Rent();
-#else
- var list = MultiThreadPool.Rent>();
-#endif
- list._isDispose = false;
- list._isPool = true;
-
- if (args != null)
- {
- list.AddRange(args);
- }
-
- return list;
- }
-
- ///
- /// 获取一个值,该值指示当前实例是否为对象池中的实例。
- ///
- ///
- public bool IsPool()
- {
- return _isPool;
- }
-
- ///
- /// 设置一个值,该值指示当前实例是否为对象池中的实例。
- ///
- ///
- public void SetIsPool(bool isPool)
- {
- _isPool = isPool;
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/ListPool.cs.meta b/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/ListPool.cs.meta
deleted file mode 100644
index 5827c4a13..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/ListPool.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: f629886e3686046c6b00225679a7dbf5
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/OneToManyHashSetPool.cs b/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/OneToManyHashSetPool.cs
deleted file mode 100644
index e0a223d01..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/OneToManyHashSetPool.cs
+++ /dev/null
@@ -1,208 +0,0 @@
-using System;
-using System.Collections.Generic;
-using NBC.Pool;
-
-#pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type.
-
-namespace NBC.DataStructure.Collection
-{
- ///
- /// 一对多哈希集合(OneToManyHashSet)对象池。
- ///
- /// 键的类型。
- /// 值的类型。
- public class OneToManyHashSetPool : OneToManyHashSet, IDisposable, IPool where TKey : notnull
- {
- private bool _isPool;
- private bool _isDispose;
-
- ///
- /// 创建一个 一对多哈希集合(OneToManyHashSet)对象池的实例。
- ///
- /// 创建的实例。
- public static OneToManyHashSetPool Create()
- {
-#if FANTASY_WEBGL
- var a = Pool>.Rent();
-#else
- var a = MultiThreadPool.Rent>();
-#endif
- a._isDispose = false;
- a._isPool = true;
- return a;
- }
-
- ///
- /// 释放实例所占用的资源,并将实例返回到对象池中,以便重用。
- ///
- public void Dispose()
- {
- if (_isDispose)
- {
- return;
- }
-
- _isDispose = true;
- Clear();
-#if FANTASY_WEBGL
- Pool>.Return(this);
-#else
- MultiThreadPool.Return(this);
-#endif
- }
-
- ///
- /// 获取一个值,该值指示当前实例是否为对象池中的实例。
- ///
- ///
- public bool IsPool()
- {
- return _isPool;
- }
-
- ///
- /// 设置一个值,该值指示当前实例是否为对象池中的实例。
- ///
- ///
- public void SetIsPool(bool isPool)
- {
- _isPool = isPool;
- }
- }
-
- ///
- /// 一对多哈希集合(OneToManyHashSet),用于创建和管理键对应多个值的集合。
- ///
- /// 键的类型。
- /// 值的类型。
- public class OneToManyHashSet : Dictionary> where TKey : notnull
- {
- /// 用于回收和重用的空闲值集合队列。
- private readonly Queue> _queue = new Queue>();
- /// 设置最大回收限制,用于控制值集合的最大数量。
- private readonly int _recyclingLimit = 120;
- /// 一个空的、不包含任何元素的哈希集合,用于在查找失败时返回。
- private static HashSet _empty = new HashSet();
-
- ///
- /// 初始化 类的新实例。
- ///
- public OneToManyHashSet() { }
-
- ///
- /// 设置最大缓存数量
- ///
- ///
- /// 1:防止数据量过大、所以超过recyclingLimit的数据还是走GC.
- /// 2:设置成0不控制数量,全部缓存
- ///
- public OneToManyHashSet(int recyclingLimit)
- {
- _recyclingLimit = recyclingLimit;
- }
-
- ///
- /// 判断指定的键值对是否存在于集合中。
- ///
- /// 键。
- /// 值。
- /// 如果存在则为 true,否则为 false。
- public bool Contains(TKey key, TValue value)
- {
- TryGetValue(key, out var list);
-
- return list != null && list.Contains(value);
- }
-
- ///
- /// 添加指定的键值对到集合中。
- ///
- /// 键。
- /// 值。
- public void Add(TKey key, TValue value)
- {
- if (!TryGetValue(key, out var list))
- {
- list = Fetch();
- list.Add(value);
- Add(key, list);
-
- return;
- }
-
- list.Add(value);
- }
-
- ///
- /// 从集合中移除指定键对应的值。
- ///
- /// 键。
- /// 要移除的值。
- public void RemoveValue(TKey key, TValue value)
- {
- if (!TryGetValue(key, out var list)) return;
-
- list.Remove(value);
-
- if (list.Count == 0) RemoveKey(key);
- }
-
- ///
- /// 从集合中移除指定键及其对应的值集合。
- ///
- /// 键。
- public void RemoveKey(TKey key)
- {
- if (!TryGetValue(key, out var list)) return;
-
- Remove(key);
- Recycle(list);
- }
-
- ///
- /// 获取指定键对应的值集合,如果不存在则返回一个空的哈希集合。
- ///
- /// 键。
- /// 对应的值集合或空的哈希集合。
- public HashSet GetValue(TKey key)
- {
- if (TryGetValue(key, out HashSet value))
- {
- return value;
- }
-
- return _empty;
- }
-
- ///
- /// 从队列中获取一个空闲的值集合,或者创建一个新的。
- ///
- /// 值集合。
- private HashSet Fetch()
- {
- return _queue.Count <= 0 ? new HashSet() : _queue.Dequeue();
- }
-
- ///
- /// 回收值集合到队列中,以便重复利用。
- ///
- /// 要回收的值集合。
- private void Recycle(HashSet list)
- {
- list.Clear();
-
- if (_recyclingLimit != 0 && _queue.Count > _recyclingLimit) return;
-
- _queue.Enqueue(list);
- }
-
- ///
- /// 清空集合中的数据并和队列。
- ///
- protected new void Clear()
- {
- base.Clear();
- _queue.Clear();
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/OneToManyHashSetPool.cs.meta b/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/OneToManyHashSetPool.cs.meta
deleted file mode 100644
index 445c83d09..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/OneToManyHashSetPool.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 4e0cac58c09d6429faba279d03ef2317
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/OneToManyListPool.cs b/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/OneToManyListPool.cs
deleted file mode 100644
index 1f7d469d1..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/OneToManyListPool.cs
+++ /dev/null
@@ -1,253 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using NBC.Pool;
-
-#pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type.
-#pragma warning disable CS8603 // Possible null reference return.
-
-namespace NBC.DataStructure.Collection
-{
- ///
- /// 可回收的、一对多关系的列表池。
- ///
- /// 键的类型。
- /// 值的类型。
- public class OneToManyListPool : OneToManyList, IDisposable, IPool where TKey : notnull
- {
- private bool _isPool;
- private bool _isDispose;
-
- ///
- /// 创建一个 一对多关系的列表池的实例。
- ///
- /// 创建的实例。
- public static OneToManyListPool Create()
- {
-#if FANTASY_WEBGL || FANTASY_EXPORTER
- var list = Pool>.Rent();
-#else
- var list = MultiThreadPool.Rent>();
-#endif
- list._isDispose = false;
- list._isPool = true;
- return list;
- }
-
- ///
- /// 释放当前对象所占用的资源,并将对象回收到对象池中。
- ///
- public void Dispose()
- {
- if (_isDispose)
- {
- return;
- }
-
- _isDispose = true;
- Clear();
-#if FANTASY_WEBGL || FANTASY_EXPORTER
- Pool>.Return(this);
-#else
- MultiThreadPool.Return(this);
-#endif
- }
-
- ///
- /// 获取一个值,该值指示当前实例是否为对象池中的实例。
- ///
- ///
- public bool IsPool()
- {
- return _isPool;
- }
-
- ///
- /// 设置一个值,该值指示当前实例是否为对象池中的实例。
- ///
- ///
- public void SetIsPool(bool isPool)
- {
- _isPool = isPool;
- }
- }
-
- ///
- /// 一对多关系的列表字典。
- ///
- /// 键的类型。
- /// 值的类型。
- public class OneToManyList : Dictionary> where TKey : notnull
- {
- private readonly int _recyclingLimit = 120;
- private static readonly List Empty = new List();
- private readonly Queue> _queue = new Queue>();
-
- ///
- /// 初始化一个新的 实例。
- ///
- public OneToManyList() { }
-
- ///
- /// 对整个字典的所有 List 进行排序
- ///
- public void SortAll()
- {
- foreach (var key in Keys.ToList()) // 使用 ToList() 避免修改集合异常
- {
- this[key] = this[key].OrderByDescending(GetSortValue).ToList();
- }
- }
-
- // 获取对象的排序值(SortAttribute 的值,默认 0)
- private int GetSortValue(TValue obj)
- {
- if (obj == null) return 0;
-
- var sortAttr = obj.GetType().GetCustomAttribute();
- return sortAttr?.Sort ?? 0;
- }
-
- ///
- /// 设置最大缓存数量
- ///
- ///
- /// 1:防止数据量过大、所以超过recyclingLimit的数据还是走GC.
- /// 2:设置成0不控制数量,全部缓存
- ///
- public OneToManyList(int recyclingLimit)
- {
- _recyclingLimit = recyclingLimit;
- }
-
- ///
- /// 判断给定的键和值是否存在于列表中。
- ///
- /// 要搜索的键。
- /// 要搜索的值。
- /// 如果存在则为 ,否则为 。
- public bool Contains(TKey key, TValue value)
- {
- TryGetValue(key, out var list);
-
- return list != null && list.Contains(value);
- }
-
- ///
- /// 向列表中添加指定键和值。
- ///
- /// 要添加值的键。
- /// 要添加的值。
- public void Add(TKey key, TValue value)
- {
- if (!TryGetValue(key, out var list))
- {
- list = Fetch();
- list.Add(value);
- Add(key, list);
-
- return;
- }
-
- list.Add(value);
- }
-
- ///
- /// 获取指定键对应的列表中的第一个值。
- ///
- /// 要获取值的键。
- /// 键对应的列表中的第一个值。
- public TValue First(TKey key)
- {
- return !TryGetValue(key, out var list) ? default : list.FirstOrDefault();
- }
-
- ///
- /// 从列表中移除指定键和值。
- ///
- /// 要移除值的键。
- /// 要移除的值。
- /// 如果成功移除则为 ,否则为 。
- public bool RemoveValue(TKey key, TValue value)
- {
- if (!TryGetValue(key, out var list))
- {
- return true;
- }
-
- var isRemove = list.Remove(value);
-
- if (list.Count == 0)
- {
- isRemove = RemoveByKey(key);
- }
-
- return isRemove;
- }
-
- ///
- /// 从列表中移除指定键及其关联的所有值。
- ///
- /// 要移除的键。
- /// 如果成功移除则为 ,否则为 。
- public bool RemoveByKey(TKey key)
- {
- if (!TryGetValue(key, out var list))
- {
- return false;
- }
-
- Remove(key);
- Recycle(list);
- return true;
- }
-
- ///
- /// 获取指定键关联的所有值的列表。
- ///
- /// 要获取值的键。
- /// 键关联的所有值的列表。
- public List GetValues(TKey key)
- {
- if (TryGetValue(key, out List list))
- {
- return list;
- }
-
- return Empty;
- }
-
- ///
- /// 清除字典中的所有键值对,并回收相关的值集合。
- ///
- public new void Clear()
- {
- foreach (var keyValuePair in this) Recycle(keyValuePair.Value);
-
- base.Clear();
- }
-
- ///
- /// 从空闲值集合队列中获取一个值集合,如果队列为空则创建一个新的值集合。
- ///
- /// 从队列中获取的值集合。
- private List Fetch()
- {
- return _queue.Count <= 0 ? new List() : _queue.Dequeue();
- }
-
- ///
- /// 回收一个不再使用的值集合到空闲值集合队列中。
- ///
- /// 要回收的值集合。
- private void Recycle(List list)
- {
- list.Clear();
-
- if (_recyclingLimit != 0 && _queue.Count > _recyclingLimit) return;
-
- _queue.Enqueue(list);
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/OneToManyListPool.cs.meta b/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/OneToManyListPool.cs.meta
deleted file mode 100644
index b1bbb98c9..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/OneToManyListPool.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 2c48383c842aa40b683f03b79f845932
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/OneToManyQueuePool.cs b/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/OneToManyQueuePool.cs
deleted file mode 100644
index e787ba82d..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/OneToManyQueuePool.cs
+++ /dev/null
@@ -1,204 +0,0 @@
-using System;
-using System.Collections.Generic;
-using NBC.Pool;
-
-#pragma warning disable CS8603
-
-namespace NBC.DataStructure.Collection
-{
- ///
- /// 支持一对多关系的队列池,用于存储具有相同键的值的队列集合。
- ///
- /// 键的类型。
- /// 值的类型。
- public class OneToManyQueuePool : OneToManyQueue, IDisposable, IPool where TKey : notnull
- {
- private bool _isPool;
- private bool _isDispose;
-
- ///
- /// 创建一个 一对多关系的队列池的实例。
- ///
- /// 创建的实例。
- public static OneToManyQueuePool Create()
- {
-#if FANTASY_WEBGL
- var a = Pool>.Rent();
-#else
- var a = MultiThreadPool.Rent>();
-#endif
- a._isDispose = false;
- a._isPool = true;
- return a;
- }
-
- ///
- /// 释放当前实例所占用的资源,并将实例回收到对象池中。
- ///
- public void Dispose()
- {
- if (_isDispose)
- {
- return;
- }
-
- _isDispose = true;
- Clear();
-#if FANTASY_WEBGL
- Pool>.Return(this);
-#else
- MultiThreadPool.Return(this);
-#endif
- }
-
- ///
- /// 获取一个值,该值指示当前实例是否为对象池中的实例。
- ///
- ///
- public bool IsPool()
- {
- return _isPool;
- }
-
- ///
- /// 设置一个值,该值指示当前实例是否为对象池中的实例。
- ///
- ///
- public void SetIsPool(bool isPool)
- {
- _isPool = isPool;
- }
- }
-
- ///
- /// 支持一对多关系的队列,用于存储具有相同键的值的队列集合。
- ///
- /// 键的类型。
- /// 值的类型。
- public class OneToManyQueue : Dictionary> where TKey : notnull
- {
- private readonly Queue> _queue = new Queue>();
- private readonly int _recyclingLimit;
-
- ///
- /// 创建一个 一对多关系的队列的实例。设置最大缓存数量
- ///
- ///
- /// 1:防止数据量过大、所以超过recyclingLimit的数据还是走GC.
- /// 2:设置成0不控制数量,全部缓存
- ///
- public OneToManyQueue(int recyclingLimit = 0)
- {
- _recyclingLimit = recyclingLimit;
- }
-
- ///
- /// 判断指定键的值队列是否包含指定的值。
- ///
- /// 要查找的键。
- /// 要查找的值。
- /// 如果存在,则为 true;否则为 false。
- public bool Contains(TKey key, TValue value)
- {
- TryGetValue(key, out var list);
-
- return list != null && list.Contains(value);
- }
-
- ///
- /// 将指定的值添加到指定键的值队列中。
- ///
- /// 要添加值的键。
- /// 要添加的值。
- public void Enqueue(TKey key, TValue value)
- {
- if (!TryGetValue(key, out var list))
- {
- list = Fetch();
- list.Enqueue(value);
- Add(key, list);
- return;
- }
-
- list.Enqueue(value);
- }
-
- ///
- /// 从指定键的值队列中出队一个值。
- ///
- /// 要出队的键。
- /// 出队的值。
- public TValue Dequeue(TKey key)
- {
- if (!TryGetValue(key, out var list) || list.Count == 0)
- {
- return default;
- }
-
- var value = list.Dequeue();
-
- if (list.Count == 0)
- {
- RemoveKey(key);
- }
-
- return value;
- }
-
- ///
- /// 尝试从指定键的值队列中出队一个值。
- ///
- /// 要出队的键。
- /// 出队的值。
- /// 如果成功出队,则为 true;否则为 false。
- public bool TryDequeue(TKey key, out TValue value)
- {
- value = Dequeue(key);
-
- return value != null;
- }
-
- ///
- /// 从字典中移除指定键及其对应的值队列。
- ///
- /// 要移除的键。
- public void RemoveKey(TKey key)
- {
- if (!TryGetValue(key, out var list)) return;
-
- Remove(key);
- Recycle(list);
- }
-
- ///
- /// 从队列池中获取一个值队列。如果队列池为空,则创建一个新的值队列。
- ///
- /// 获取的值队列。
- private Queue Fetch()
- {
- return _queue.Count <= 0 ? new Queue() : _queue.Dequeue();
- }
-
- ///
- /// 回收一个不再使用的值队列到队列池中,以便重用。
- ///
- /// 要回收的值队列。
- private void Recycle(Queue list)
- {
- list.Clear();
-
- if (_recyclingLimit != 0 && _queue.Count > _recyclingLimit) return;
-
- _queue.Enqueue(list);
- }
-
- ///
- /// 清空当前实例的数据,同时回收所有值队列。
- ///
- protected new void Clear()
- {
- base.Clear();
- _queue.Clear();
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/OneToManyQueuePool.cs.meta b/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/OneToManyQueuePool.cs.meta
deleted file mode 100644
index b90e2c13c..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/OneToManyQueuePool.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 8b6455b3359394987af4c0a4855189e9
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/ReuseList.cs b/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/ReuseList.cs
deleted file mode 100644
index 50be9bc89..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/ReuseList.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-using System;
-using System.Collections.Generic;
-using NBC.Pool;
-
-namespace NBC.DataStructure.Collection
-{
- ///
- /// 可重用的列表,继承自 类。该类支持通过对象池重用列表实例,以减少对象分配和释放的开销。
- ///
- /// 列表中元素的类型。
- public sealed class ReuseList : List, IDisposable, IPool
- {
- private bool _isPool;
- private bool _isDispose;
-
- ///
- /// 创建一个 可重用的列表的实例。
- ///
- /// 创建的实例。
- public static ReuseList Create()
- {
-#if FANTASY_WEBGL
- var list = Pool>.Rent();
-#else
- var list = MultiThreadPool.Rent>();
-#endif
- list._isDispose = false;
- list._isPool = true;
- return list;
- }
-
- ///
- /// 释放该实例所占用的资源,并将实例返回到对象池中,以便重用。
- ///
- public void Dispose()
- {
- if (_isDispose)
- {
- return;
- }
-
- _isDispose = true;
- Clear();
-#if FANTASY_WEBGL
- Pool>.Return(this);
-#else
- MultiThreadPool.Return(this);
-#endif
- }
-
- ///
- /// 获取一个值,该值指示当前实例是否为对象池中的实例。
- ///
- ///
- public bool IsPool()
- {
- return _isPool;
- }
-
- ///
- /// 设置一个值,该值指示当前实例是否为对象池中的实例。
- ///
- ///
- public void SetIsPool(bool isPool)
- {
- _isPool = isPool;
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/ReuseList.cs.meta b/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/ReuseList.cs.meta
deleted file mode 100644
index 1b600f720..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/ReuseList.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 9826877496b99479892a7359519298d5
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/SortedConcurrentOneToManyListPool.cs b/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/SortedConcurrentOneToManyListPool.cs
deleted file mode 100644
index 98198a9a5..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/SortedConcurrentOneToManyListPool.cs
+++ /dev/null
@@ -1,226 +0,0 @@
-#if !FANTASY_WEBGL
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using NBC.Pool;
-
-#pragma warning disable CS8603
-
-namespace NBC.DataStructure.Collection
-{
- ///
- /// 基于排序字典和并发集合实现的一对多映射列表的对象池包装类,继承自 类,
- /// 同时实现了 接口,以支持对象的重用和释放。
- ///
- /// 键的类型。
- /// 值的类型。
- public class SortedConcurrentOneToManyListPool : SortedConcurrentOneToManyList, IDisposable, IPool where TKey : notnull
- {
- private bool _isPool;
- private bool _isDispose;
-
- ///
- /// 创建一个新的 实例,使用默认的参数设置。
- ///
- /// 新创建的 实例。
- public static SortedConcurrentOneToManyListPool Create()
- {
- var a = MultiThreadPool.Rent>();
- a._isDispose = false;
- a._isPool = true;
- return a;
- }
-
- ///
- /// 释放当前对象池实例,将其返回到对象池以供重用。
- ///
- public void Dispose()
- {
- if (_isDispose)
- {
- return;
- }
-
- _isDispose = true;
- Clear();
- MultiThreadPool.Return(this);
- }
-
- ///
- /// 获取一个值,该值指示当前实例是否为对象池中的实例。
- ///
- ///
- public bool IsPool()
- {
- return _isPool;
- }
-
- ///
- /// 设置一个值,该值指示当前实例是否为对象池中的实例。
- ///
- ///
- public void SetIsPool(bool isPool)
- {
- _isPool = isPool;
- }
- }
-
- ///
- /// 基于排序字典和并发集合实现的一多对映射列表类,继承自 类,
- /// 用于在多个值与一个键关联的情况下进行管理和存储。该类支持并发操作,适用于多线程环境。
- ///
- /// 键的类型。
- /// 值的类型。
- public class SortedConcurrentOneToManyList : SortedDictionary> where TKey : notnull
- {
- /// 用于同步操作的锁对象,它确保在多线程环境下对数据的安全访问。
- private readonly object _lockObject = new object();
- /// 用于存储缓存的队列。
- private readonly Queue> _queue = new Queue>();
- /// 控制缓存回收的限制。当缓存的数量超过此限制时,旧的缓存将会被回收。
- private readonly int _recyclingLimit;
-
- ///
- /// 初始化一个新的 类的实例,使用默认的参数设置。
- ///
- public SortedConcurrentOneToManyList()
- {
- }
-
- ///
- /// 初始化一个新的 类的实例,指定最大缓存数量。
- ///
- ///
- /// 1:防止数据量过大、所以超过recyclingLimit的数据还是走GC.
- /// 2:设置成0不控制数量,全部缓存
- ///
- public SortedConcurrentOneToManyList(int recyclingLimit = 0)
- {
- _recyclingLimit = recyclingLimit;
- }
-
- ///
- /// 检查指定的键和值是否存在于映射列表中。
- ///
- /// 要检查的键。
- /// 要检查的值。
- /// 如果存在,则为 true;否则为 false。
- public bool Contains(TKey key, TValue value)
- {
- lock (_lockObject)
- {
- TryGetValue(key, out var list);
-
- return list != null && list.Contains(value);
- }
- }
-
- ///
- /// 将指定的值添加到与指定键关联的列表中。
- ///
- /// 要关联值的键。
- /// 要添加到列表的值。
- public void Add(TKey key, TValue value)
- {
- lock (_lockObject)
- {
- if (!TryGetValue(key, out var list))
- {
- list = Fetch();
- list.Add(value);
- base[key] = list;
- return;
- }
-
- list.Add(value);
- }
- }
-
- ///
- /// 获取与指定键关联的列表中的第一个值。
- /// 如果列表不存在或为空,则返回默认值。
- ///
- /// 要获取第一个值的键。
- /// 第一个值,或默认值。
- public TValue First(TKey key)
- {
- lock (_lockObject)
- {
- return !TryGetValue(key, out var list) ? default : list.FirstOrDefault();
- }
- }
-
- ///
- /// 从与指定键关联的列表中移除指定的值。
- /// 如果列表不存在或值不存在于列表中,则不执行任何操作。
- ///
- /// 要移除值的键。
- /// 要移除的值。
- public void RemoveValue(TKey key, TValue value)
- {
- lock (_lockObject)
- {
- if (!TryGetValue(key, out var list)) return;
-
- list.Remove(value);
-
- if (list.Count == 0) RemoveKey(key);
- }
- }
-
- ///
- /// 从映射列表中移除指定的键及其关联的列表。
- /// 如果键不存在于映射列表中,则不执行任何操作。
- ///
- /// 要移除的键。
- public void RemoveKey(TKey key)
- {
- lock (_lockObject)
- {
- if (!TryGetValue(key, out var list)) return;
-
- Remove(key);
-
- Recycle(list);
- }
- }
-
- ///
- /// 从缓存中获取一个可重用的列表。如果缓存中不存在列表,则创建一个新的列表并返回。
- ///
- /// 可重用的列表。
- private List Fetch()
- {
- lock (_lockObject)
- {
- return _queue.Count <= 0 ? new List() : _queue.Dequeue();
- }
- }
-
- ///
- /// 将不再使用的列表回收到缓存中,以便重复利用。如果缓存数量超过限制,则丢弃列表而不进行回收。
- ///
- /// 要回收的列表。
- private void Recycle(List list)
- {
- lock (_lockObject)
- {
- list.Clear();
-
- if (_recyclingLimit != 0 && _queue.Count > _recyclingLimit) return;
-
- _queue.Enqueue(list);
- }
- }
-
- ///
- /// 清空映射列表以及队列。
- ///
- protected new void Clear()
- {
- base.Clear();
- _queue.Clear();
- }
- }
-}
-#endif
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/SortedConcurrentOneToManyListPool.cs.meta b/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/SortedConcurrentOneToManyListPool.cs.meta
deleted file mode 100644
index 2ca59b28e..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/SortedConcurrentOneToManyListPool.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: fef1d9dea81914fcf9fc9f5b1e5989d5
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/SortedOneToManyHashSetPool.cs b/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/SortedOneToManyHashSetPool.cs
deleted file mode 100644
index 0c49ca86b..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/SortedOneToManyHashSetPool.cs
+++ /dev/null
@@ -1,192 +0,0 @@
-using System;
-using System.Collections.Generic;
-using NBC.Pool;
-
-namespace NBC.DataStructure.Collection
-{
- ///
- /// 基于排序字典实现的一对多关系的映射哈希集合的对象池包装类,将唯一键映射到多个值的哈希集合。
- /// 同时实现了 接口,以支持对象的重用和释放。
- ///
- /// 字典中键的类型。
- /// 哈希集合中值的类型。
- public class SortedOneToManyHashSetPool : SortedOneToManyHashSet, IDisposable, IPool where TKey : notnull
- {
- private bool _isPool;
- private bool _isDispose;
-
- ///
- /// 创建一个 实例。
- ///
- /// 新创建的实例。
- public static SortedOneToManyHashSetPool Create()
- {
-#if FANTASY_WEBGL
- var a = Pool>.Rent();
-#else
- var a = MultiThreadPool.Rent>();
-#endif
- a._isDispose = false;
- a._isPool = true;
- return a;
- }
-
- ///
- /// 释放当前对象池实例,将其返回到对象池以供重用。
- ///
- public void Dispose()
- {
- if (_isDispose)
- {
- return;
- }
-
- _isDispose = true;
- Clear();
-#if FANTASY_WEBGL
- Pool>.Return(this);
-#else
- MultiThreadPool.Return(this);
-#endif
- }
-
- ///
- /// 获取一个值,该值指示当前实例是否为对象池中的实例。
- ///
- ///
- public bool IsPool()
- {
- return _isPool;
- }
-
- ///
- /// 设置一个值,该值指示当前实例是否为对象池中的实例。
- ///
- ///
- public void SetIsPool(bool isPool)
- {
- _isPool = isPool;
- }
- }
-
- ///
- /// 基于排序字典实现的一对多关系的映射哈希集合类,将唯一键映射到多个值的哈希集合。
- /// 用于在多个值与一个键关联的情况下进行管理和存储。
- ///
- /// 字典中键的类型。
- /// 集合中值的类型。
- public class SortedOneToManyHashSet : SortedDictionary> where TKey : notnull
- {
- private readonly Queue> _queue = new Queue>();
- private readonly int _recyclingLimit = 120;
-
- ///
- /// 创建一个新的 实例。
- ///
- public SortedOneToManyHashSet() { }
-
- ///
- /// 创建一个新的 实例,设置最大缓存数量
- ///
- ///
- /// 1:防止数据量过大、所以超过recyclingLimit的数据还是走GC.
- /// 2:设置成0不控制数量,全部缓存
- ///
- public SortedOneToManyHashSet(int recyclingLimit)
- {
- _recyclingLimit = recyclingLimit;
- }
-
- ///
- /// 判断哈希集合中是否包含指定的键值对。
- ///
- /// 要查找的键。
- /// 要查找的值。
- /// 如果键值对存在,则为 true;否则为 false。
- public bool Contains(TKey key, TValue value)
- {
- TryGetValue(key, out var list);
-
- return list != null && list.Contains(value);
- }
-
- ///
- /// 将指定值添加到给定键关联的哈希集合中。
- ///
- /// 要添加值的键。
- /// 要添加的值。
- public void Add(TKey key, TValue value)
- {
- if (!TryGetValue(key, out var list))
- {
- list = Fetch();
- list.Add(value);
- Add(key, list);
-
- return;
- }
-
- list.Add(value);
- }
-
- ///
- /// 从指定键关联的哈希集合中移除特定值。
- /// 如果哈希集合不存在或值不存在于集合中,则不执行任何操作。
- ///
- /// 要移除值的键。
- /// 要移除的值。
- public void RemoveValue(TKey key, TValue value)
- {
- if (!TryGetValue(key, out var list)) return;
-
- list.Remove(value);
-
- if (list.Count == 0) RemoveKey(key);
- }
-
- ///
- /// 从字典中移除指定键以及关联的哈希集合,并将集合进行回收。
- /// 如果键不存在于映射列表中,则不执行任何操作。
- ///
- /// 要移除的键。
- public void RemoveKey(TKey key)
- {
- if (!TryGetValue(key, out var list)) return;
-
- Remove(key);
-
- Recycle(list);
- }
-
- ///
- /// 获取一个空的或回收的哈希集合。
- ///
- /// 获取的哈希集合实例。
- private HashSet Fetch()
- {
- return _queue.Count <= 0 ? new HashSet() : _queue.Dequeue();
- }
-
- ///
- /// 回收一个哈希集合,将其清空并放入回收队列中。
- ///
- /// 要回收的哈希集合。
- private void Recycle(HashSet list)
- {
- list.Clear();
-
- if (_recyclingLimit != 0 && _queue.Count > _recyclingLimit) return;
-
- _queue.Enqueue(list);
- }
-
- ///
- /// 重写 Clear 方法,清空字典并清空回收队列。
- ///
- protected new void Clear()
- {
- base.Clear();
- _queue.Clear();
- }
- }
-}
\ No newline at end of file
diff --git a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/SortedOneToManyHashSetPool.cs.meta b/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/SortedOneToManyHashSetPool.cs.meta
deleted file mode 100644
index 13e463b7a..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/SortedOneToManyHashSetPool.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 4fe9032846c3f4a11be30459a9e12d7a
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/SortedOneToManyListPool.cs b/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/SortedOneToManyListPool.cs
deleted file mode 100644
index dc349c91f..000000000
--- a/Assets/Scripts/NBC~/Runtime/Core/DataStructure/Collection/SortedOneToManyListPool.cs
+++ /dev/null
@@ -1,217 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using NBC.Pool;
-
-#pragma warning disable CS8603
-
-namespace NBC.DataStructure.Collection
-{
- ///
- /// 基于排序字典实现的一对多映射列表的对象池包装类,继承自 类,
- /// 同时实现了 接口,以支持对象的重用和释放。
- ///
- /// 字典中键的类型。
- /// 列表中值的类型。
- public class SortedOneToManyListPool : SortedOneToManyList, IDisposable, IPool where TKey : notnull
- {
- private bool _isPool;
- private bool _isDispose;
-
- ///
- /// 创建一个