Compare commits
36
Commits
RunAndCry
...
bea394d022
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bea394d022 | ||
|
|
2c6877cb3f | ||
|
|
019e3a053e | ||
|
|
727e9a3c17 | ||
|
|
48e11dd3b0 | ||
|
|
4b98ec0129 | ||
|
|
304bfc6e1f | ||
|
|
db6eb219c8 | ||
|
|
d2c5c45604 | ||
|
|
0fca1a32f9 | ||
|
|
9103cb0a5a | ||
|
|
4770499d97 | ||
|
|
f6e8131d22 | ||
|
|
7e1f7cecc2 | ||
|
|
6732aef384 | ||
|
|
ecff1e69cd | ||
|
|
eb4dff803e | ||
|
|
fea9d3586f | ||
|
|
79593877a7 | ||
|
|
a5ce6e3165 | ||
|
|
d9a1271262 | ||
|
|
4c16a63abd | ||
|
|
b4de41894f | ||
|
|
77fd9af29d | ||
|
|
a1c2c5fd18 | ||
|
|
485d54f272 | ||
|
|
0d0787b887 | ||
|
|
5d856ae162 | ||
|
|
dd1399e015 | ||
|
|
2b656412d5 | ||
|
|
36e6bc3bc2 | ||
|
|
1e31e1e8b1 | ||
|
|
2897eb88bf | ||
|
|
134adda787 | ||
|
|
2f56a5758d | ||
|
|
fb9510a6b2 |
No files matched your search
@@ -13,5 +13,8 @@ MonoBehaviour:
|
|||||||
m_Name: AddressableAssetGroupSortSettings
|
m_Name: AddressableAssetGroupSortSettings
|
||||||
m_EditorClassIdentifier: Unity.Addressables.Editor::UnityEditor.AddressableAssets.Settings.GroupSchemas.AddressableAssetGroupSortSettings
|
m_EditorClassIdentifier: Unity.Addressables.Editor::UnityEditor.AddressableAssets.Settings.GroupSchemas.AddressableAssetGroupSortSettings
|
||||||
sortOrder:
|
sortOrder:
|
||||||
|
- 3f67261f611d8cd43a09d4d5cf638d8d
|
||||||
|
- 1e9bc7e1e4087c0488fccf896b0ed49f
|
||||||
|
- d7e4a8c4f2a42c64587c34ab7446f091
|
||||||
- 7e9d70e73e500eb9287683466ebf646f
|
- 7e9d70e73e500eb9287683466ebf646f
|
||||||
- d447fc60305c17a17bf20948ab295a45
|
- d447fc60305c17a17bf20948ab295a45
|
||||||
@@ -15,7 +15,7 @@ MonoBehaviour:
|
|||||||
m_DefaultGroup: d447fc60305c17a17bf20948ab295a45
|
m_DefaultGroup: d447fc60305c17a17bf20948ab295a45
|
||||||
m_currentHash:
|
m_currentHash:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
Hash: 1290af012af335115858ec31670d830d
|
Hash: 00000000000000000000000000000000
|
||||||
m_OptimizeCatalogSize: 0
|
m_OptimizeCatalogSize: 0
|
||||||
m_BuildRemoteCatalog: 0
|
m_BuildRemoteCatalog: 0
|
||||||
m_CatalogRequestsTimeout: 0
|
m_CatalogRequestsTimeout: 0
|
||||||
@@ -60,8 +60,11 @@ MonoBehaviour:
|
|||||||
m_BuildAddressablesWithPlayerBuild: 0
|
m_BuildAddressablesWithPlayerBuild: 0
|
||||||
m_overridePlayerVersion: '[UnityEditor.PlayerSettings.bundleVersion]'
|
m_overridePlayerVersion: '[UnityEditor.PlayerSettings.bundleVersion]'
|
||||||
m_GroupAssets:
|
m_GroupAssets:
|
||||||
|
- {fileID: 11400000, guid: df8f8d52915542e49a11fbc177f3cf2c, type: 2}
|
||||||
|
- {fileID: 11400000, guid: 3eb9af1699b33ee4fa3ddeb0a1a9f793, type: 2}
|
||||||
- {fileID: 11400000, guid: ba51c0b85beab267d8f41a72df4fb657, type: 2}
|
- {fileID: 11400000, guid: ba51c0b85beab267d8f41a72df4fb657, type: 2}
|
||||||
- {fileID: 11400000, guid: 7c592a6445170e8379910601b962cb30, type: 2}
|
- {fileID: 11400000, guid: 7c592a6445170e8379910601b962cb30, type: 2}
|
||||||
|
- {fileID: 11400000, guid: 6334e9a905fd7634a8c646d57a23968d, type: 2}
|
||||||
m_BuildSettings:
|
m_BuildSettings:
|
||||||
m_LogResourceManagerExceptions: 1
|
m_LogResourceManagerExceptions: 1
|
||||||
m_BundleBuildPath: Temp/com.unity.addressables/AssetBundles
|
m_BundleBuildPath: Temp/com.unity.addressables/AssetBundles
|
||||||
|
|||||||
@@ -14,8 +14,124 @@ MonoBehaviour:
|
|||||||
m_EditorClassIdentifier: Unity.Addressables.Editor::UnityEditor.AddressableAssets.Settings.AddressableAssetGroup
|
m_EditorClassIdentifier: Unity.Addressables.Editor::UnityEditor.AddressableAssets.Settings.AddressableAssetGroup
|
||||||
m_GroupName: Audio
|
m_GroupName: Audio
|
||||||
m_GUID: 7e9d70e73e500eb9287683466ebf646f
|
m_GUID: 7e9d70e73e500eb9287683466ebf646f
|
||||||
m_SerializeEntries: []
|
m_SerializeEntries:
|
||||||
|
- m_GUID: 087d498be2e5a044f97f313a3fc0ae05
|
||||||
|
m_Address: Assets/Resources_moved/Audio/Enemies/ded_step.ogg
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: 144ab5188f8ad7a0a92c75703bd12e60
|
||||||
|
m_Address: launch_upmenu1
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: 1f79c7b1e492a4ea2a8d666cdead0c52
|
||||||
|
m_Address: Assets/Resources_moved/Audio/Dispatcher/take_damage4.ogg
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: 21c2eaf85c31d604395153b364970a7d
|
||||||
|
m_Address: Assets/Resources_moved/Audio/SFX/pl_plain2.ogg
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: 29bff8011973e4e519906b9da8fca0fc
|
||||||
|
m_Address: Assets/Resources_moved/Audio/Dispatcher/late3.ogg
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: 29ee630aab7bbef8799dc76ed0c239f7
|
||||||
|
m_Address: Assets/Resources_moved/Audio/Dispatcher/late4.ogg
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: 2ef564b38a3c6fb4a85c16adb33d095c
|
||||||
|
m_Address: Assets/Resources_moved/Audio/Enemies/rch_walk.ogg
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: 31f16c866d3224ab8a7e0fabf3745ec5
|
||||||
|
m_Address: Assets/Resources_moved/Audio/Dispatcher/late5.ogg
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: 4bd64d1fcecc9c6b09d81e78b7dcfebe
|
||||||
|
m_Address: Assets/Resources_moved/Audio/Dispatcher/take_damage1.ogg
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: 4c9661de6f76e8c48a0116840b1ac7fd
|
||||||
|
m_Address: Assets/Resources_moved/Audio/UI/launch_upmenu1 1.wav
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: 735f38402ea347fa381408293503a24e
|
||||||
|
m_Address: Assets/Resources_moved/Audio/Dispatcher/receiving_an_order1.ogg
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: 7accc805b4e5f404d9e777c0a662ede4
|
||||||
|
m_Address: Assets/Resources_moved/Audio/UI/launch_upmenu1 2.wav
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: 7c5caf3ceee44f71588860c5c1fbdbe0
|
||||||
|
m_Address: Assets/Resources_moved/Audio/Dispatcher/take_damage3.ogg
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: 8c2be26d359d54063825fedfad7a493b
|
||||||
|
m_Address: Assets/Resources_moved/Audio/Dispatcher/late2.ogg
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: 8fa89a492fc3a3768a0f0ba1bb7080e0
|
||||||
|
m_Address: Assets/Resources_moved/Audio/Dispatcher/late1.ogg
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: a306df57f348ce7cf900d0b9431739ee
|
||||||
|
m_Address: launch_selectmenu
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: aa138b2e21adfbf4bbbfa5bf9d54b8f2
|
||||||
|
m_Address: Assets/Resources_moved/Audio/UI/buttonclickrelease.wav
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: ae6ab2c88ae248ce1b6efca892f17659
|
||||||
|
m_Address: Assets/Resources_moved/Audio/Music/TestDeath.ogg
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: beea6ce1de81706478a700993b273000
|
||||||
|
m_Address: Assets/Resources_moved/Audio/Enemies/bc_bite2.ogg
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: cab4b1ff78dd6b1fba61aa165aa17b4d
|
||||||
|
m_Address: Assets/Resources_moved/Audio/Dispatcher/receiving_an_order2.ogg
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: e54541120fe1c5a4799a4698a689bb5c
|
||||||
|
m_Address: Assets/Resources_moved/Audio/SFX/pl_step1.ogg
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: f74a409bf11b25148ad305acc05b14f5
|
||||||
|
m_Address: Assets/Resources_moved/Audio/Dispatcher/take_damage2.ogg
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: fb8972b33f4c43749add9d98b439b447
|
||||||
|
m_Address: Assets/Resources_moved/Audio/SFX/pl_plain5.ogg
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
m_ReadOnly: 0
|
m_ReadOnly: 0
|
||||||
m_Settings: {fileID: 11400000, guid: 2588e84eb64800d0781c574a37fa48d8, type: 2}
|
m_Settings: {fileID: 11400000, guid: 2588e84eb64800d0781c574a37fa48d8, type: 2}
|
||||||
m_SchemaSet:
|
m_SchemaSet:
|
||||||
m_Schemas: []
|
m_Schemas:
|
||||||
|
- {fileID: 11400000, guid: 5a1eefed8456ba0479d7c04e6a5f4122, type: 2}
|
||||||
@@ -15,247 +15,38 @@ MonoBehaviour:
|
|||||||
m_GroupName: Default Local Group
|
m_GroupName: Default Local Group
|
||||||
m_GUID: d447fc60305c17a17bf20948ab295a45
|
m_GUID: d447fc60305c17a17bf20948ab295a45
|
||||||
m_SerializeEntries:
|
m_SerializeEntries:
|
||||||
- m_GUID: 144ab5188f8ad7a0a92c75703bd12e60
|
|
||||||
m_Address: launch_upmenu1
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: 16562a5c87213914cad415f10c65a3b0
|
|
||||||
m_Address: "Assets/Resources_moved/Audio/Music/LASKX3I - \u041F\u0440\u043E\u0442\u0438\u0432
|
|
||||||
\u0446\u0430\u0440\u044F (\u041A\u0430\u0440\u0430\u043E\u043A\u0435).mp3"
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: 170b1a70ddee4d948abea041b9b805e4
|
|
||||||
m_Address: Assets/Resources_moved/Audio/Music/Half Life Original Soundtrack -
|
|
||||||
Track 8 - Diabolical Adrenaline Guitar.mp3
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: 19bfe93240786974ea9d7cd70a7bb635
|
|
||||||
m_Address: Prefabs/Rooms/Level5
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: 1d4767c722c05b5d6b96bb226d378c65
|
- m_GUID: 1d4767c722c05b5d6b96bb226d378c65
|
||||||
m_Address: Assets/Resources_moved/Prefabs/Player/ArmsMesh.prefab
|
m_Address: Assets/Resources_moved/Prefabs/Player/ArmsMesh.prefab
|
||||||
m_ReadOnly: 0
|
m_ReadOnly: 0
|
||||||
m_SerializedLabels: []
|
m_SerializedLabels: []
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
- m_GUID: 1d7110a045075b22fa27d62bd5f2784e
|
|
||||||
m_Address: 357_shot1
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: 1f79c7b1e492a4ea2a8d666cdead0c52
|
|
||||||
m_Address: Audio/Dispatcher/take_damage4
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: 23e11d2c8a4f12f4ea9a7a43d1118464
|
|
||||||
m_Address: Gameplay
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: 28a6c7a4124141341ab7c2b7dfd3e95b
|
|
||||||
m_Address: Assets/Resources_moved/Prefabs/Levels/Level1 2.prefab
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: 29bff8011973e4e519906b9da8fca0fc
|
|
||||||
m_Address: Audio/Dispatcher/late3
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: 29ee630aab7bbef8799dc76ed0c239f7
|
|
||||||
m_Address: Audio/Dispatcher/late4
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: 2ed2d93a9f39d4edba511cb7396c7bb6
|
- m_GUID: 2ed2d93a9f39d4edba511cb7396c7bb6
|
||||||
m_Address: Assets/Resources_moved/Prefabs/Enemies/Cockroach.prefab
|
m_Address: Assets/Resources_moved/Prefabs/Enemies/Cockroach.prefab
|
||||||
m_ReadOnly: 0
|
m_ReadOnly: 0
|
||||||
m_SerializedLabels: []
|
m_SerializedLabels: []
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
- m_GUID: 2f6134357dc2a5641a846a7478ce4c2c
|
|
||||||
m_Address: bravo!
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: 31f16c866d3224ab8a7e0fabf3745ec5
|
|
||||||
m_Address: Audio/Dispatcher/late5
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: 3831a36e0c8e48f659517a6bb99378b6
|
|
||||||
m_Address: cbar_hit1
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: 4283d6553fc7f3f4583b9bb0be9d7979
|
|
||||||
m_Address: Prefabs/Rooms/Box1
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: 48aebfe8826dc0df79d047b5afbf8f5b
|
|
||||||
m_Address: Canvas
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: 4bd64d1fcecc9c6b09d81e78b7dcfebe
|
|
||||||
m_Address: Audio/Dispatcher/take_damage1
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: 7067a5248027e74478f4f0f53ddf06a4
|
|
||||||
m_Address: Prefabs/Rooms/Save1
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: 735f38402ea347fa381408293503a24e
|
|
||||||
m_Address: Audio/Dispatcher/receiving_an_order1
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: 751890caa1647ec6689f24933fbcb770
|
|
||||||
m_Address: "Prefabs/Furniture/\u0442\u0440\u0443\u0431\u0430"
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: 7c5caf3ceee44f71588860c5c1fbdbe0
|
|
||||||
m_Address: Audio/Dispatcher/take_damage3
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: 803e40b883c823b89a91aa8b9d9fc483
|
|
||||||
m_Address: valve_sound
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: 81844a99f5b786b41b831174f8fb6d3a
|
- m_GUID: 81844a99f5b786b41b831174f8fb6d3a
|
||||||
m_Address: Prefabs/Player/CharacterController
|
m_Address: Prefabs/Player/CharacterController
|
||||||
m_ReadOnly: 0
|
m_ReadOnly: 0
|
||||||
m_SerializedLabels: []
|
m_SerializedLabels: []
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
- m_GUID: 8187ea542d6ed824d81230966a3b7499
|
|
||||||
m_Address: Assets/Resources_moved/Audio/Music/Bauhaus - Bela Lugosi's Dead (No
|
|
||||||
Vocals Remix).mp3
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: 82c71411174bfa86ca1f676b9d389f94
|
|
||||||
m_Address: bastard!
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: 8c2be26d359d54063825fedfad7a493b
|
|
||||||
m_Address: Audio/Dispatcher/late2
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: 8fa89a492fc3a3768a0f0ba1bb7080e0
|
|
||||||
m_Address: Audio/Dispatcher/late1
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: 9293380a88bf6736889be29722b94269
|
- m_GUID: 9293380a88bf6736889be29722b94269
|
||||||
m_Address: Audio/AudioSource
|
m_Address: Audio/AudioSource
|
||||||
m_ReadOnly: 0
|
m_ReadOnly: 0
|
||||||
m_SerializedLabels: []
|
m_SerializedLabels: []
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
- m_GUID: 9d78f017876abed4c9cd8957f1e140cb
|
|
||||||
m_Address: Prefabs/Rooms/Level1_2
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: a1d9e5a04ac11a1468c744b27d442a00
|
|
||||||
m_Address: Prefabs/Rooms/Stars1
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: a306df57f348ce7cf900d0b9431739ee
|
|
||||||
m_Address: launch_selectmenu
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: ab5926b5200bedc49aec36c0afe6b028
|
|
||||||
m_Address: Prefabs/Rooms/Level3_Big
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: b2e8dc2aeb0311cd8a826b51cf8e94dc
|
|
||||||
m_Address: GameOver
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: b33855c694de89386a25c56cbe463a0e
|
- m_GUID: b33855c694de89386a25c56cbe463a0e
|
||||||
m_Address: Assets/Resources_moved/Prefabs/Enemies/DrunkenGrandpa.prefab
|
m_Address: Assets/Resources_moved/Prefabs/Enemies/DrunkenGrandpa.prefab
|
||||||
m_ReadOnly: 0
|
m_ReadOnly: 0
|
||||||
m_SerializedLabels: []
|
m_SerializedLabels: []
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
- m_GUID: b3471d165fe389f479380f61034bea57
|
|
||||||
m_Address: Assets/Resources_moved/Prefabs/Levels/Level1 1.prefab
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: c566fc932edefbbee9e53271eac3c560
|
|
||||||
m_Address: MainMenu
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: c938de3174f184741925c407a43a47f2
|
|
||||||
m_Address: Prefabs/Rooms/Level1
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: cab4b1ff78dd6b1fba61aa165aa17b4d
|
|
||||||
m_Address: Audio/Dispatcher/receiving_an_order2
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: d4eaf1439c2788c458127b9ba67e4fbf
|
|
||||||
m_Address: Prefabs/Levels/Level1
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: d5b22c0e6700543419ae667d77aadaa2
|
|
||||||
m_Address: Prefabs/Rooms/Level2_Down
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: dc328d8aadb0e8545978741d451e0544
|
|
||||||
m_Address: Prefabs/Rooms/Level4_Parkur
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: e3a3840a7963bf841872cddb02e90151
|
|
||||||
m_Address: Prefabs/Levels/MainMenu 1
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: ebe18293a5ef86704b23dad3a1786476
|
|
||||||
m_Address: Half-Life01
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: f23b9fce9594618e5b75845f1cae50de
|
|
||||||
m_Address: LoadingScreen
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
- m_GUID: f3d7dc64b34919ad7b50a3dd307a935b
|
- m_GUID: f3d7dc64b34919ad7b50a3dd307a935b
|
||||||
m_Address: Assets/Resources_moved/Prefabs/Enemies/Fog.prefab
|
m_Address: Assets/Resources_moved/Prefabs/Enemies/Fog.prefab
|
||||||
m_ReadOnly: 0
|
m_ReadOnly: 0
|
||||||
m_SerializedLabels: []
|
m_SerializedLabels: []
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
- m_GUID: f74a409bf11b25148ad305acc05b14f5
|
|
||||||
m_Address: Audio/Dispatcher/take_damage2
|
|
||||||
m_ReadOnly: 0
|
|
||||||
m_SerializedLabels: []
|
|
||||||
FlaggedDuringContentUpdateRestriction: 0
|
|
||||||
m_ReadOnly: 0
|
m_ReadOnly: 0
|
||||||
m_Settings: {fileID: 11400000, guid: 2588e84eb64800d0781c574a37fa48d8, type: 2}
|
m_Settings: {fileID: 11400000, guid: 2588e84eb64800d0781c574a37fa48d8, type: 2}
|
||||||
m_SchemaSet:
|
m_SchemaSet:
|
||||||
m_Schemas:
|
m_Schemas:
|
||||||
- {fileID: 11400000, guid: 75ffac7db08d9615c994048949431551, type: 2}
|
- {fileID: 11400000, guid: 75ffac7db08d9615c994048949431551, type: 2}
|
||||||
- {fileID: 11400000, guid: 6d6fed27b8c8a3eebb9bc5289b7a6956, type: 2}
|
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!114 &11400000
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: bbb281ee3bf0b054c82ac2347e9e782c, type: 3}
|
||||||
|
m_Name: Levels
|
||||||
|
m_EditorClassIdentifier: Unity.Addressables.Editor::UnityEditor.AddressableAssets.Settings.AddressableAssetGroup
|
||||||
|
m_GroupName: Levels
|
||||||
|
m_GUID: d7e4a8c4f2a42c64587c34ab7446f091
|
||||||
|
m_SerializeEntries:
|
||||||
|
- m_GUID: 28a6c7a4124141341ab7c2b7dfd3e95b
|
||||||
|
m_Address: Assets/Resources_moved/Prefabs/Levels/Level1 2.prefab
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: 2c6a984e4a1b42647b48e6b7bc69b158
|
||||||
|
m_Address: Prefabs/Levels/Level6
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: 3f8f2171cc252d953b82083cc16bd1ae
|
||||||
|
m_Address: Assets/Resources_moved/Prefabs/Levels/Level6_1.prefab
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: 7067a5248027e74478f4f0f53ddf06a4
|
||||||
|
m_Address: Prefabs/Rooms/Save1
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: 9d78f017876abed4c9cd8957f1e140cb
|
||||||
|
m_Address: Prefabs/Rooms/Level1_2
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: c938de3174f184741925c407a43a47f2
|
||||||
|
m_Address: Prefabs/Rooms/Level1
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: e3a3840a7963bf841872cddb02e90151
|
||||||
|
m_Address: Prefabs/Levels/MainMenu 1
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_Settings: {fileID: 11400000, guid: 2588e84eb64800d0781c574a37fa48d8, type: 2}
|
||||||
|
m_SchemaSet:
|
||||||
|
m_Schemas:
|
||||||
|
- {fileID: 11400000, guid: 41705eee932aeb341b6921d8a793acc3, type: 2}
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 5160d7af825d295229a3be611f44db76
|
guid: 6334e9a905fd7634a8c646d57a23968d
|
||||||
NativeFormatImporter:
|
NativeFormatImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
mainObjectFileID: 11400000
|
mainObjectFileID: 11400000
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!114 &11400000
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: bbb281ee3bf0b054c82ac2347e9e782c, type: 3}
|
||||||
|
m_Name: Music
|
||||||
|
m_EditorClassIdentifier: Unity.Addressables.Editor::UnityEditor.AddressableAssets.Settings.AddressableAssetGroup
|
||||||
|
m_GroupName: Music
|
||||||
|
m_GUID: 1e9bc7e1e4087c0488fccf896b0ed49f
|
||||||
|
m_SerializeEntries:
|
||||||
|
- m_GUID: 16562a5c87213914cad415f10c65a3b0
|
||||||
|
m_Address: "Assets/Resources_moved/Audio/Music/LASKX3I - \u041F\u0440\u043E\u0442\u0438\u0432
|
||||||
|
\u0446\u0430\u0440\u044F (\u041A\u0430\u0440\u0430\u043E\u043A\u0435).mp3"
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: 170b1a70ddee4d948abea041b9b805e4
|
||||||
|
m_Address: Assets/Resources_moved/Audio/Music/Half Life Original Soundtrack -
|
||||||
|
Track 8 - Diabolical Adrenaline Guitar.mp3
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: 414d8dcca794556478c1a79e705e138e
|
||||||
|
m_Address: Assets/Resources_moved/Audio/Music/soft_music.ogg
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: 803e40b883c823b89a91aa8b9d9fc483
|
||||||
|
m_Address: valve_sound
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: 8187ea542d6ed824d81230966a3b7499
|
||||||
|
m_Address: Assets/Resources_moved/Audio/Music/Bauhaus - Bela Lugosi's Dead (No
|
||||||
|
Vocals Remix).mp3
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: 8f913b505c805c74da84e00a22ff5fc2
|
||||||
|
m_Address: Assets/Resources_moved/Audio/Music/bedlam_music.ogg
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: 9ea414d55e6a0b94c944556ff0754c48
|
||||||
|
m_Address: Assets/Resources_moved/Audio/Music/order_music.ogg
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: ebe18293a5ef86704b23dad3a1786476
|
||||||
|
m_Address: Half-Life01
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: fc08098e6384c904aa0583859ee45ce5
|
||||||
|
m_Address: Assets/Resources_moved/Audio/Music/death_music.ogg
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_Settings: {fileID: 11400000, guid: 2588e84eb64800d0781c574a37fa48d8, type: 2}
|
||||||
|
m_SchemaSet:
|
||||||
|
m_Schemas:
|
||||||
|
- {fileID: 11400000, guid: ad1eba3497492f54c8ca95e03d446775, type: 2}
|
||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 1c47a9db23597b54b81c3148b0da9cb1
|
guid: df8f8d52915542e49a11fbc177f3cf2c
|
||||||
NativeFormatImporter:
|
NativeFormatImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
mainObjectFileID: 112000000
|
mainObjectFileID: 11400000
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
assetBundleVariant:
|
assetBundleVariant:
|
||||||
+48
@@ -0,0 +1,48 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!114 &11400000
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: e5d17a21594effb4e9591490b009e7aa, type: 3}
|
||||||
|
m_Name: Audio_BundledAssetGroupSchema
|
||||||
|
m_EditorClassIdentifier: Unity.Addressables.Editor::UnityEditor.AddressableAssets.Settings.GroupSchemas.BundledAssetGroupSchema
|
||||||
|
m_Group: {fileID: 11400000, guid: ba51c0b85beab267d8f41a72df4fb657, type: 2}
|
||||||
|
m_InternalBundleIdMode: 1
|
||||||
|
m_Compression: 1
|
||||||
|
m_IncludeAddressInCatalog: 1
|
||||||
|
m_IncludeGUIDInCatalog: 1
|
||||||
|
m_IncludeLabelsInCatalog: 1
|
||||||
|
m_InternalIdNamingMode: 0
|
||||||
|
m_CacheClearBehavior: 0
|
||||||
|
m_IncludeInBuild: 1
|
||||||
|
m_BundledAssetProviderType:
|
||||||
|
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||||
|
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider
|
||||||
|
m_StripDownloadOptions: 0
|
||||||
|
m_ForceUniqueProvider: 0
|
||||||
|
m_UseAssetBundleCache: 1
|
||||||
|
m_UseAssetBundleCrc: 1
|
||||||
|
m_UseAssetBundleCrcForCachedBundles: 1
|
||||||
|
m_UseUWRForLocalBundles: 0
|
||||||
|
m_Timeout: 0
|
||||||
|
m_ChunkedTransfer: 0
|
||||||
|
m_RedirectLimit: -1
|
||||||
|
m_RetryCount: 0
|
||||||
|
m_BuildPath:
|
||||||
|
m_Id: 3dfc1a15d30236e7a8856b2164e14280
|
||||||
|
m_LoadPath:
|
||||||
|
m_Id: 6c794a757c731a0319b43709731ad88b
|
||||||
|
m_BundleMode: 0
|
||||||
|
m_AssetBundleProviderType:
|
||||||
|
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||||
|
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider
|
||||||
|
m_UseDefaultSchemaSettings: 0
|
||||||
|
m_SelectedPathPairIndex: 0
|
||||||
|
m_BundleNaming: 0
|
||||||
|
m_AssetLoadMode: 0
|
||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 5a1eefed8456ba0479d7c04e6a5f4122
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
+1
-1
@@ -2,7 +2,7 @@ fileFormatVersion: 2
|
|||||||
guid: 6d6fed27b8c8a3eebb9bc5289b7a6956
|
guid: 6d6fed27b8c8a3eebb9bc5289b7a6956
|
||||||
NativeFormatImporter:
|
NativeFormatImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
mainObjectFileID: 11400000
|
mainObjectFileID: 0
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
assetBundleVariant:
|
assetBundleVariant:
|
||||||
+48
@@ -0,0 +1,48 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!114 &11400000
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: e5d17a21594effb4e9591490b009e7aa, type: 3}
|
||||||
|
m_Name: Levels_BundledAssetGroupSchema
|
||||||
|
m_EditorClassIdentifier: Unity.Addressables.Editor::UnityEditor.AddressableAssets.Settings.GroupSchemas.BundledAssetGroupSchema
|
||||||
|
m_Group: {fileID: 11400000, guid: 6334e9a905fd7634a8c646d57a23968d, type: 2}
|
||||||
|
m_InternalBundleIdMode: 1
|
||||||
|
m_Compression: 1
|
||||||
|
m_IncludeAddressInCatalog: 1
|
||||||
|
m_IncludeGUIDInCatalog: 1
|
||||||
|
m_IncludeLabelsInCatalog: 1
|
||||||
|
m_InternalIdNamingMode: 0
|
||||||
|
m_CacheClearBehavior: 0
|
||||||
|
m_IncludeInBuild: 1
|
||||||
|
m_BundledAssetProviderType:
|
||||||
|
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||||
|
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider
|
||||||
|
m_StripDownloadOptions: 0
|
||||||
|
m_ForceUniqueProvider: 0
|
||||||
|
m_UseAssetBundleCache: 1
|
||||||
|
m_UseAssetBundleCrc: 1
|
||||||
|
m_UseAssetBundleCrcForCachedBundles: 1
|
||||||
|
m_UseUWRForLocalBundles: 0
|
||||||
|
m_Timeout: 0
|
||||||
|
m_ChunkedTransfer: 0
|
||||||
|
m_RedirectLimit: -1
|
||||||
|
m_RetryCount: 0
|
||||||
|
m_BuildPath:
|
||||||
|
m_Id: 3dfc1a15d30236e7a8856b2164e14280
|
||||||
|
m_LoadPath:
|
||||||
|
m_Id: 6c794a757c731a0319b43709731ad88b
|
||||||
|
m_BundleMode: 0
|
||||||
|
m_AssetBundleProviderType:
|
||||||
|
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||||
|
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider
|
||||||
|
m_UseDefaultSchemaSettings: 0
|
||||||
|
m_SelectedPathPairIndex: 0
|
||||||
|
m_BundleNaming: 0
|
||||||
|
m_AssetLoadMode: 0
|
||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 41705eee932aeb341b6921d8a793acc3
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
+48
@@ -0,0 +1,48 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!114 &11400000
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: e5d17a21594effb4e9591490b009e7aa, type: 3}
|
||||||
|
m_Name: Music_BundledAssetGroupSchema
|
||||||
|
m_EditorClassIdentifier: Unity.Addressables.Editor::UnityEditor.AddressableAssets.Settings.GroupSchemas.BundledAssetGroupSchema
|
||||||
|
m_Group: {fileID: 11400000, guid: df8f8d52915542e49a11fbc177f3cf2c, type: 2}
|
||||||
|
m_InternalBundleIdMode: 1
|
||||||
|
m_Compression: 1
|
||||||
|
m_IncludeAddressInCatalog: 1
|
||||||
|
m_IncludeGUIDInCatalog: 1
|
||||||
|
m_IncludeLabelsInCatalog: 1
|
||||||
|
m_InternalIdNamingMode: 0
|
||||||
|
m_CacheClearBehavior: 0
|
||||||
|
m_IncludeInBuild: 1
|
||||||
|
m_BundledAssetProviderType:
|
||||||
|
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||||
|
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider
|
||||||
|
m_StripDownloadOptions: 0
|
||||||
|
m_ForceUniqueProvider: 0
|
||||||
|
m_UseAssetBundleCache: 1
|
||||||
|
m_UseAssetBundleCrc: 1
|
||||||
|
m_UseAssetBundleCrcForCachedBundles: 1
|
||||||
|
m_UseUWRForLocalBundles: 0
|
||||||
|
m_Timeout: 0
|
||||||
|
m_ChunkedTransfer: 0
|
||||||
|
m_RedirectLimit: -1
|
||||||
|
m_RetryCount: 0
|
||||||
|
m_BuildPath:
|
||||||
|
m_Id: 3dfc1a15d30236e7a8856b2164e14280
|
||||||
|
m_LoadPath:
|
||||||
|
m_Id: 6c794a757c731a0319b43709731ad88b
|
||||||
|
m_BundleMode: 0
|
||||||
|
m_AssetBundleProviderType:
|
||||||
|
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||||
|
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider
|
||||||
|
m_UseDefaultSchemaSettings: 0
|
||||||
|
m_SelectedPathPairIndex: 0
|
||||||
|
m_BundleNaming: 0
|
||||||
|
m_AssetLoadMode: 0
|
||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ad1eba3497492f54c8ca95e03d446775
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
+48
@@ -0,0 +1,48 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!114 &11400000
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: e5d17a21594effb4e9591490b009e7aa, type: 3}
|
||||||
|
m_Name: UI_BundledAssetGroupSchema
|
||||||
|
m_EditorClassIdentifier: Unity.Addressables.Editor::UnityEditor.AddressableAssets.Settings.GroupSchemas.BundledAssetGroupSchema
|
||||||
|
m_Group: {fileID: 11400000, guid: 3eb9af1699b33ee4fa3ddeb0a1a9f793, type: 2}
|
||||||
|
m_InternalBundleIdMode: 1
|
||||||
|
m_Compression: 1
|
||||||
|
m_IncludeAddressInCatalog: 1
|
||||||
|
m_IncludeGUIDInCatalog: 1
|
||||||
|
m_IncludeLabelsInCatalog: 1
|
||||||
|
m_InternalIdNamingMode: 0
|
||||||
|
m_CacheClearBehavior: 0
|
||||||
|
m_IncludeInBuild: 1
|
||||||
|
m_BundledAssetProviderType:
|
||||||
|
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||||
|
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider
|
||||||
|
m_StripDownloadOptions: 0
|
||||||
|
m_ForceUniqueProvider: 0
|
||||||
|
m_UseAssetBundleCache: 1
|
||||||
|
m_UseAssetBundleCrc: 1
|
||||||
|
m_UseAssetBundleCrcForCachedBundles: 1
|
||||||
|
m_UseUWRForLocalBundles: 0
|
||||||
|
m_Timeout: 0
|
||||||
|
m_ChunkedTransfer: 0
|
||||||
|
m_RedirectLimit: -1
|
||||||
|
m_RetryCount: 0
|
||||||
|
m_BuildPath:
|
||||||
|
m_Id: 3dfc1a15d30236e7a8856b2164e14280
|
||||||
|
m_LoadPath:
|
||||||
|
m_Id: 6c794a757c731a0319b43709731ad88b
|
||||||
|
m_BundleMode: 0
|
||||||
|
m_AssetBundleProviderType:
|
||||||
|
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||||
|
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider
|
||||||
|
m_UseDefaultSchemaSettings: 0
|
||||||
|
m_SelectedPathPairIndex: 0
|
||||||
|
m_BundleNaming: 0
|
||||||
|
m_AssetLoadMode: 0
|
||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 5b0e1794b785fb54988037373b6bb1f3
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!114 &11400000
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: bbb281ee3bf0b054c82ac2347e9e782c, type: 3}
|
||||||
|
m_Name: UI
|
||||||
|
m_EditorClassIdentifier: Unity.Addressables.Editor::UnityEditor.AddressableAssets.Settings.AddressableAssetGroup
|
||||||
|
m_GroupName: UI
|
||||||
|
m_GUID: 3f67261f611d8cd43a09d4d5cf638d8d
|
||||||
|
m_SerializeEntries:
|
||||||
|
- m_GUID: 23e11d2c8a4f12f4ea9a7a43d1118464
|
||||||
|
m_Address: Gameplay
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: 48aebfe8826dc0df79d047b5afbf8f5b
|
||||||
|
m_Address: Canvas
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: b2e8dc2aeb0311cd8a826b51cf8e94dc
|
||||||
|
m_Address: GameOver
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: c566fc932edefbbee9e53271eac3c560
|
||||||
|
m_Address: MainMenu
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
- m_GUID: f23b9fce9594618e5b75845f1cae50de
|
||||||
|
m_Address: LoadingScreen
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_SerializedLabels: []
|
||||||
|
FlaggedDuringContentUpdateRestriction: 0
|
||||||
|
m_ReadOnly: 0
|
||||||
|
m_Settings: {fileID: 11400000, guid: 2588e84eb64800d0781c574a37fa48d8, type: 2}
|
||||||
|
m_SchemaSet:
|
||||||
|
m_Schemas:
|
||||||
|
- {fileID: 11400000, guid: 5b0e1794b785fb54988037373b6bb1f3, type: 2}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3eb9af1699b33ee4fa3ddeb0a1a9f793
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: aa24c0d8a11438d4fb57332c144beab6
|
guid: d36aab6707c518f5abfd60065165eb35
|
||||||
folderAsset: yes
|
folderAsset: yes
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: bc9a23cef60c78e46924e5d40b0c2a16
|
guid: d982316b2b4c99747b9e953ae7b9b42f
|
||||||
folderAsset: yes
|
folderAsset: yes
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
using Code.App.StateMachine;
|
using Code.App.StateMachine;
|
||||||
|
using Code.Audio;
|
||||||
using Code.Gameplay.Player;
|
using Code.Gameplay.Player;
|
||||||
using Code.Input;
|
using Code.Input;
|
||||||
|
using Code.Scenes;
|
||||||
|
using Code.Scenes.SceneEnvironments;
|
||||||
using Code.StateMachine;
|
using Code.StateMachine;
|
||||||
using Code.UI;
|
using Code.UI;
|
||||||
using Cysharp.Threading.Tasks;
|
using Cysharp.Threading.Tasks;
|
||||||
@@ -30,7 +33,11 @@ namespace Code.App.AppStates
|
|||||||
Context.InputService.EnableMap(ActionMappings.UI);
|
Context.InputService.EnableMap(ActionMappings.UI);
|
||||||
Context.InputService.DebugBindAction((int)ActionMappings.UI,(int)UIActions.Continue, TryToExit);
|
Context.InputService.DebugBindAction((int)ActionMappings.UI,(int)UIActions.Continue, TryToExit);
|
||||||
|
|
||||||
GameOver();
|
Context.AudioService.PlayRandomMusicUntilHumanityWillBeDestroyedForTheySins(MusicType.Death);
|
||||||
|
|
||||||
|
Context.AudioService.ApplyStun(5000,0.5f);
|
||||||
|
|
||||||
|
GameOver().Forget();
|
||||||
|
|
||||||
base.EnterState();
|
base.EnterState();
|
||||||
}
|
}
|
||||||
@@ -45,7 +52,7 @@ namespace Code.App.AppStates
|
|||||||
await Context.UIService.AsyncSwitchPanelTo(UIPanel.GameOver);
|
await Context.UIService.AsyncSwitchPanelTo(UIPanel.GameOver);
|
||||||
|
|
||||||
_gameOverPanel = (GameOverPanel)Context.UIService.CurrentPanel;
|
_gameOverPanel = (GameOverPanel)Context.UIService.CurrentPanel;
|
||||||
|
_gameOverPanel.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ToMainMenu()
|
private void ToMainMenu()
|
||||||
@@ -71,6 +78,8 @@ namespace Code.App.AppStates
|
|||||||
Context.InputService.DisableMap(ActionMappings.UI);
|
Context.InputService.DisableMap(ActionMappings.UI);
|
||||||
Context.InputService.DebugUnbindAction((int)ActionMappings.UI,(int)UIActions.Continue, TryToExit);
|
Context.InputService.DebugUnbindAction((int)ActionMappings.UI,(int)UIActions.Continue, TryToExit);
|
||||||
|
|
||||||
|
Context.AudioService.GladlyAskToStopMusic(MusicType.Death, callback: Context.AudioFactory.ReleaseDeathMusic);
|
||||||
|
Context.AudioService.TransitToSnapshot(AudioSnapshotState.None);
|
||||||
base.ExitState();
|
base.ExitState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,10 +13,12 @@ using Code.StateMachine;
|
|||||||
using Code.UI;
|
using Code.UI;
|
||||||
using Code.UI.Panels;
|
using Code.UI.Panels;
|
||||||
using Cysharp.Threading.Tasks;
|
using Cysharp.Threading.Tasks;
|
||||||
|
using DG.Tweening;
|
||||||
using Reflex.Core;
|
using Reflex.Core;
|
||||||
using Reflex.Extensions;
|
using Reflex.Extensions;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.InputSystem;
|
using UnityEngine.InputSystem;
|
||||||
|
using UnityEngine.Rendering;
|
||||||
using UnityEngine.SceneManagement;
|
using UnityEngine.SceneManagement;
|
||||||
|
|
||||||
namespace Code.App.AppStates
|
namespace Code.App.AppStates
|
||||||
@@ -43,25 +45,17 @@ namespace Code.App.AppStates
|
|||||||
.RegisterLoading(LoadingWork.LoadModelResource)
|
.RegisterLoading(LoadingWork.LoadModelResource)
|
||||||
.RegisterLoading(LoadingWork.LoadAudio);
|
.RegisterLoading(LoadingWork.LoadAudio);
|
||||||
|
|
||||||
//_playerHealth = Context.PlayerFactory.CreatePlayerHealth();
|
|
||||||
|
|
||||||
//_playerHealth.OnDamage += PlayerDamageTaken;
|
|
||||||
//_playerHealth.OnDeath += EndGame;
|
|
||||||
|
|
||||||
Context.AudioService.TransitToSnapshot(AudioSnapshotState.None);
|
Context.AudioService.TransitToSnapshot(AudioSnapshotState.None);
|
||||||
|
|
||||||
Context.InputService.EnableMap(ActionMappings.Gameplay);
|
Context.InputService.EnableMap(ActionMappings.Gameplay);
|
||||||
|
|
||||||
Context.InputService.DebugBindAction((int)ActionMappings.Debug, (int)DebugActions.Debug1, InstaKillDEBUG);
|
Context.InputService.DebugBindAction((int)ActionMappings.Debug, (int)DebugActions.Debug1, InstaKillDEBUG);
|
||||||
Context.InputService.DebugBindAction((int)ActionMappings.Debug, (int)DebugActions.Debug4, RoomPassedDEBUG);
|
Context.InputService.DebugBindAction((int)ActionMappings.Debug, (int)DebugActions.Debug4, TakeGamageDEBUG);
|
||||||
Context.InputService.DebugBindAction((int)ActionMappings.Debug, (int)DebugActions.Debug5, Tube);
|
|
||||||
|
|
||||||
Context.SceneLoaderService.LoadSceneAsyncAwaitable((int)SceneIds.DevGen);
|
Context.SceneLoaderService.LoadSceneAsyncAwaitable((int)SceneIds.DevGen);
|
||||||
Context.LoadingManager.OnLoadingEnded += AfterSceneLoaded;
|
Context.LoadingManager.OnLoadingEnded += AfterSceneLoaded;
|
||||||
|
|
||||||
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
|
WaitForLoad().Forget();
|
||||||
WaitForLoad();
|
|
||||||
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
|
|
||||||
}
|
}
|
||||||
private async UniTask WaitForPlayerCharacterLoad() => _playerCharacter = await Context.PlayerFactory.CreatePlayer();
|
private async UniTask WaitForPlayerCharacterLoad() => _playerCharacter = await Context.PlayerFactory.CreatePlayer();
|
||||||
|
|
||||||
@@ -70,8 +64,11 @@ namespace Code.App.AppStates
|
|||||||
await UniTask.WhenAll(
|
await UniTask.WhenAll(
|
||||||
Context.UIService.AsyncSwitchPanelTo(UIPanel.Gameplay),
|
Context.UIService.AsyncSwitchPanelTo(UIPanel.Gameplay),
|
||||||
Context.AudioFactory.WarmGameplayMusic(),
|
Context.AudioFactory.WarmGameplayMusic(),
|
||||||
Context.AudioFactory.WarmSFX(),
|
Context.AudioFactory.WarmDeathMusic(),
|
||||||
Context.AudioFactory.WarmDispatcher()
|
// Context.AudioFactory.WarmSFX(),
|
||||||
|
Context.AudioFactory.WarmDispatcher(),
|
||||||
|
Context.AudioFactory.WarmEnemies(),
|
||||||
|
Context.AudioFactory.WarmCourier()
|
||||||
);
|
);
|
||||||
|
|
||||||
Context.LoadingManager
|
Context.LoadingManager
|
||||||
@@ -91,6 +88,9 @@ namespace Code.App.AppStates
|
|||||||
Context.LoadingManager.OnLoadingEnded -= AfterSceneLoaded;
|
Context.LoadingManager.OnLoadingEnded -= AfterSceneLoaded;
|
||||||
Context.LoadingManager.OnLoadingEnded += AfterPlayerLoaded;
|
Context.LoadingManager.OnLoadingEnded += AfterPlayerLoaded;
|
||||||
|
|
||||||
|
Context.PlayerProvider = SceneManager.GetActiveScene().GetSceneContainer().Resolve<IPlayerProvider>();
|
||||||
|
Context.PlayerFactory = SceneManager.GetActiveScene().GetSceneContainer().Resolve<IPlayerFactory>();
|
||||||
|
|
||||||
await UniTask.WhenAll(
|
await UniTask.WhenAll(
|
||||||
WaitForPlayerArmsToInitialize(),
|
WaitForPlayerArmsToInitialize(),
|
||||||
WaitForPlayerCharacterLoad()
|
WaitForPlayerCharacterLoad()
|
||||||
@@ -112,6 +112,8 @@ namespace Code.App.AppStates
|
|||||||
|
|
||||||
GameplaySceneEnvironment sceneEnvironment = SceneEnvironmentVariables(sceneContainer);
|
GameplaySceneEnvironment sceneEnvironment = SceneEnvironmentVariables(sceneContainer);
|
||||||
|
|
||||||
|
_volume = sceneEnvironment.volume;
|
||||||
|
|
||||||
PlayerInitialize(sceneEnvironment);
|
PlayerInitialize(sceneEnvironment);
|
||||||
|
|
||||||
CameraInitialize();
|
CameraInitialize();
|
||||||
@@ -153,21 +155,30 @@ namespace Code.App.AppStates
|
|||||||
private void PlayerDamageTaken(int damage, PlayerHealth health)
|
private void PlayerDamageTaken(int damage, PlayerHealth health)
|
||||||
{
|
{
|
||||||
Context.AudioService.PlayDispatcher((DispatcherSounds)Random.Range((int)DispatcherSounds.TakeDamage1,(int)DispatcherSounds.TakeDamage4));
|
Context.AudioService.PlayDispatcher((DispatcherSounds)Random.Range((int)DispatcherSounds.TakeDamage1,(int)DispatcherSounds.TakeDamage4));
|
||||||
|
Context.AudioService.PlayCourier((CourierSounds)Random.Range((int)CourierSounds.Damage1,(int)CourierSounds.Damage2));
|
||||||
|
DamageEffectProcess().Forget();
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO В конфиг
|
||||||
|
private async UniTaskVoid DamageEffectProcess()
|
||||||
|
{
|
||||||
|
_damagePanel.Show();
|
||||||
|
Context.AudioService.ApplyStun(200, 0.5f);
|
||||||
|
|
||||||
|
DOTween.To(() => _volume.weight, x => _volume.weight = x, 1f, 0.5f);
|
||||||
|
await UniTask.WaitForSeconds(3f);
|
||||||
|
DOTween.To(() => _volume.weight, x => _volume.weight = x, 0f, 1f);
|
||||||
|
Context.AudioService.ApplyStun(5000, 1f);
|
||||||
|
_damagePanel.Hide();
|
||||||
}
|
}
|
||||||
// DEBUG
|
// DEBUG
|
||||||
private void InstaKillDEBUG(InputAction.CallbackContext context)
|
private void InstaKillDEBUG(InputAction.CallbackContext context)
|
||||||
{
|
{
|
||||||
_playerHealth.InstaKill();
|
_playerHealth.InstaKill();
|
||||||
}
|
}
|
||||||
private void RoomPassedDEBUG(InputAction.CallbackContext context)
|
private void TakeGamageDEBUG(InputAction.CallbackContext context)
|
||||||
{
|
{
|
||||||
_orderService.RoomPassed();
|
_playerHealth.GetDamage(1);
|
||||||
}
|
|
||||||
private OrderDispenser _debugTube;
|
|
||||||
|
|
||||||
private void Tube(InputAction.CallbackContext context)
|
|
||||||
{
|
|
||||||
_debugTube.ThrowOrder();
|
|
||||||
}
|
}
|
||||||
// DEBUG
|
// DEBUG
|
||||||
private bool _tickEnabled;
|
private bool _tickEnabled;
|
||||||
@@ -201,13 +212,16 @@ namespace Code.App.AppStates
|
|||||||
Context.AudioService.OnDispatcherEnded -= _gameplayPanel.CloseDispatcher;
|
Context.AudioService.OnDispatcherEnded -= _gameplayPanel.CloseDispatcher;
|
||||||
|
|
||||||
Context.InputService.DisableMap(ActionMappings.Gameplay);
|
Context.InputService.DisableMap(ActionMappings.Gameplay);
|
||||||
Context.AudioService.GladlyAskToStopMusic(MusicType.Action, callback: Context.AudioFactory.ReleaseActionMusic);
|
Context.AudioService.GladlyAskToStopMusic(MusicType.Action, time: 0f, callback: Context.AudioFactory.ReleaseActionMusic);
|
||||||
Context.AudioService.GladlyAskToStopMusic(MusicType.Peaceful, callback: Context.AudioFactory.ReleasePeacefulMusic);
|
Context.AudioService.GladlyAskToStopMusic(MusicType.Peaceful, time: 0f, callback: Context.AudioFactory.ReleasePeacefulMusic);
|
||||||
|
Context.AudioFactory.ReleaseCourier();
|
||||||
|
Context.AudioFactory.ReleaseDispatcher();
|
||||||
|
Context.AudioFactory.ReleaseEnemies();
|
||||||
|
// Context.AudioFactory.ReleaseSFX();
|
||||||
|
|
||||||
|
|
||||||
Context.InputService.DebugUnbindAction((int)ActionMappings.Debug, (int)DebugActions.Debug1, InstaKillDEBUG);
|
Context.InputService.DebugUnbindAction((int)ActionMappings.Debug, (int)DebugActions.Debug1, InstaKillDEBUG);
|
||||||
Context.InputService.DebugUnbindAction((int)ActionMappings.Debug, (int)DebugActions.Debug4, RoomPassedDEBUG);
|
Context.InputService.DebugUnbindAction((int)ActionMappings.Debug, (int)DebugActions.Debug4, TakeGamageDEBUG);
|
||||||
Context.InputService.DebugUnbindAction((int)ActionMappings.Debug, (int)DebugActions.Debug5, Tube);
|
|
||||||
|
|
||||||
base.ExitState();
|
base.ExitState();
|
||||||
}
|
}
|
||||||
@@ -224,13 +238,15 @@ namespace Code.App.AppStates
|
|||||||
|
|
||||||
private GameplayPanel _gameplayPanel;
|
private GameplayPanel _gameplayPanel;
|
||||||
private ArmsMeshProvider _armsMesh;
|
private ArmsMeshProvider _armsMesh;
|
||||||
|
private DamagePanel _damagePanel;
|
||||||
private void UIInitialize()
|
private void UIInitialize()
|
||||||
{
|
{
|
||||||
_gameplayPanel = (GameplayPanel)Context.UIService.CurrentPanel;
|
_gameplayPanel = (GameplayPanel)Context.UIService.CurrentPanel;
|
||||||
_gameplayPanel.Initialize(_playerScore, _playerHealth, _orderService);
|
_gameplayPanel.Initialize(_playerScore, _playerHealth, _orderService);
|
||||||
Context.AudioService.OnDispatcherStarted += _gameplayPanel.SummonDispatcher;
|
Context.AudioService.OnDispatcherStarted += _gameplayPanel.SummonDispatcher;
|
||||||
Context.AudioService.OnDispatcherEnded += _gameplayPanel.CloseDispatcher;
|
Context.AudioService.OnDispatcherEnded += _gameplayPanel.CloseDispatcher;
|
||||||
|
|
||||||
|
_damagePanel = _gameplayPanel.DamagePanel;
|
||||||
}
|
}
|
||||||
private void MusicInitialize()
|
private void MusicInitialize()
|
||||||
{
|
{
|
||||||
@@ -252,11 +268,12 @@ namespace Code.App.AppStates
|
|||||||
_orderService.OnOrderDelivered += OrderDelivered;
|
_orderService.OnOrderDelivered += OrderDelivered;
|
||||||
_orderService.OnOrderFailure += OrderFailure;
|
_orderService.OnOrderFailure += OrderFailure;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Volume _volume;
|
||||||
private GameplaySceneEnvironment SceneEnvironmentVariables(Container sceneContainer)
|
private GameplaySceneEnvironment SceneEnvironmentVariables(Container sceneContainer)
|
||||||
{
|
{
|
||||||
var sceneEnvironment = (GameplaySceneEnvironment)sceneContainer.Resolve<CurrentSceneEnvironment>();
|
var sceneEnvironment = (GameplaySceneEnvironment)sceneContainer.Resolve<CurrentSceneEnvironment>();
|
||||||
|
|
||||||
|
|
||||||
return sceneEnvironment;
|
return sceneEnvironment;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,11 +33,7 @@ namespace Code.App
|
|||||||
containerBuilder.AddSingleton(typeof(LoadingManager), typeof(ILoadingManager));
|
containerBuilder.AddSingleton(typeof(LoadingManager), typeof(ILoadingManager));
|
||||||
|
|
||||||
containerBuilder.AddSingleton(typeof(InputService), typeof(IInputService));
|
containerBuilder.AddSingleton(typeof(InputService), typeof(IInputService));
|
||||||
// Перенести нахуй в контейнер геймплея
|
|
||||||
containerBuilder.AddSingleton(typeof(PlayerFactory), typeof(IPlayerFactory));
|
|
||||||
containerBuilder.AddSingleton(typeof(EnemyFactory), typeof(IEnemyFactory));
|
|
||||||
containerBuilder.AddSingleton(typeof(PlayerProvider), typeof(IPlayerProvider));
|
|
||||||
//
|
|
||||||
InitializeCamera(containerBuilder, staticDataService);
|
InitializeCamera(containerBuilder, staticDataService);
|
||||||
|
|
||||||
containerBuilder.AddSingleton(typeof(UIFactory), typeof(IUIFactory));
|
containerBuilder.AddSingleton(typeof(UIFactory), typeof(IUIFactory));
|
||||||
@@ -71,6 +67,7 @@ namespace Code.App
|
|||||||
containerBuilder.AddSingleton(infrastructureUnit.AddComponent<CameraStateMachine>());
|
containerBuilder.AddSingleton(infrastructureUnit.AddComponent<CameraStateMachine>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO Часть в сцены
|
||||||
private void InstallStaticData(ContainerBuilder containerBuilder, out IStaticDataService staticDataService)
|
private void InstallStaticData(ContainerBuilder containerBuilder, out IStaticDataService staticDataService)
|
||||||
{
|
{
|
||||||
staticDataService = new StaticDataService();
|
staticDataService = new StaticDataService();
|
||||||
@@ -97,10 +94,13 @@ namespace Code.App
|
|||||||
containerBuilder.AddSingleton(staticDataService.SoundtrackListConfig, typeof(SoundtrackListConfig));
|
containerBuilder.AddSingleton(staticDataService.SoundtrackListConfig, typeof(SoundtrackListConfig));
|
||||||
containerBuilder.AddSingleton(staticDataService.AudioTestClipsConfig, typeof(AudioTestClipsConfig));
|
containerBuilder.AddSingleton(staticDataService.AudioTestClipsConfig, typeof(AudioTestClipsConfig));
|
||||||
containerBuilder.AddSingleton(staticDataService.SFXListConfig, typeof(SFXListConfig));
|
containerBuilder.AddSingleton(staticDataService.SFXListConfig, typeof(SFXListConfig));
|
||||||
|
containerBuilder.AddSingleton(staticDataService.CourierSoundListConfig, typeof(CourierSoundListConfig));
|
||||||
containerBuilder.AddSingleton(staticDataService.DispatcherSoundListConfig, typeof(DispatcherSoundListConfig));
|
containerBuilder.AddSingleton(staticDataService.DispatcherSoundListConfig, typeof(DispatcherSoundListConfig));
|
||||||
containerBuilder.AddSingleton(staticDataService.EnemiesSoundListConfig, typeof(EnemiesSoundListConfig));
|
containerBuilder.AddSingleton(staticDataService.EnemiesSoundListConfig, typeof(EnemiesSoundListConfig));
|
||||||
containerBuilder.AddSingleton(staticDataService.AudioSourceSettingsConfigs, typeof(Dictionary<AudioSourceType, AudioSourceSettingsConfig>));
|
containerBuilder.AddSingleton(staticDataService.AudioSourceSettingsConfigs, typeof(Dictionary<AudioSourceType, AudioSourceSettingsConfig>));
|
||||||
|
|
||||||
|
containerBuilder.AddSingleton(staticDataService.DefaultAudioSettingsConfig, typeof(DefaultAudioSettingsConfig));
|
||||||
|
|
||||||
containerBuilder.AddSingleton(staticDataService.OrderServiceConfig, typeof(OrderServiceConfig));
|
containerBuilder.AddSingleton(staticDataService.OrderServiceConfig, typeof(OrderServiceConfig));
|
||||||
containerBuilder.AddSingleton(staticDataService.OrderBoxConfig, typeof(OrderBoxConfig));
|
containerBuilder.AddSingleton(staticDataService.OrderBoxConfig, typeof(OrderBoxConfig));
|
||||||
|
|
||||||
@@ -119,9 +119,7 @@ namespace Code.App
|
|||||||
AttributeInjector.Inject(cameraStateMachine.StateMachineContext, container);
|
AttributeInjector.Inject(cameraStateMachine.StateMachineContext, container);
|
||||||
cameraStateMachine.Initialize();
|
cameraStateMachine.Initialize();
|
||||||
|
|
||||||
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
|
BootstrapFinish(container).Forget();
|
||||||
BootstrapFinish(container);
|
|
||||||
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
|
|
||||||
}
|
}
|
||||||
private async UniTaskVoid BootstrapFinish(Container container)
|
private async UniTaskVoid BootstrapFinish(Container container)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Code.App.Debug
|
||||||
|
{
|
||||||
|
public class Logger : MonoBehaviour
|
||||||
|
{
|
||||||
|
//#if !UNITY_EDITOR
|
||||||
|
static string myLog = "";
|
||||||
|
private string output;
|
||||||
|
private string stack;
|
||||||
|
|
||||||
|
void OnEnable()
|
||||||
|
{
|
||||||
|
Application.logMessageReceived += Log;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnDisable()
|
||||||
|
{
|
||||||
|
Application.logMessageReceived -= Log;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Log(string logString, string stackTrace, LogType type)
|
||||||
|
{
|
||||||
|
output = logString;
|
||||||
|
stack = stackTrace;
|
||||||
|
myLog = output + " " + myLog;
|
||||||
|
if (myLog.Length > 5000)
|
||||||
|
{
|
||||||
|
myLog = myLog.Substring(0, 4000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnGUI()
|
||||||
|
{
|
||||||
|
//if (!Application.isEditor) //Do not display in editor ( or you can use the UNITY_EDITOR macro to also disable the rest)
|
||||||
|
{
|
||||||
|
myLog = GUI.TextArea(new Rect(10, 10, Screen.width - 10, Screen.height - 10), myLog);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: dc474668ede54a9aa1e0f29c59f067f5
|
||||||
|
timeCreated: 1764915992
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using Code.App.Loading;
|
using Code.App.Loading;
|
||||||
|
using Code.Gameplay.Enemies;
|
||||||
using Code.Gameplay.Orders.Order;
|
using Code.Gameplay.Orders.Order;
|
||||||
using Code.Gameplay.Player;
|
using Code.Gameplay.Player;
|
||||||
using Code.Generator;
|
using Code.Generator;
|
||||||
@@ -21,6 +22,9 @@ namespace Code.App.SceneInstallers
|
|||||||
containerBuilder.AddScoped(typeof(PlayerScore), typeof(IPlayerScore));
|
containerBuilder.AddScoped(typeof(PlayerScore), typeof(IPlayerScore));
|
||||||
containerBuilder.AddScoped(typeof(OrderService), typeof(IOrderService));
|
containerBuilder.AddScoped(typeof(OrderService), typeof(IOrderService));
|
||||||
containerBuilder.AddScoped(typeof(RoomGeneratorFactory), typeof(IRoomGeneratorFactory));
|
containerBuilder.AddScoped(typeof(RoomGeneratorFactory), typeof(IRoomGeneratorFactory));
|
||||||
|
containerBuilder.AddScoped(typeof(PlayerProvider), typeof(IPlayerProvider));
|
||||||
|
containerBuilder.AddScoped(typeof(PlayerFactory), typeof(IPlayerFactory));
|
||||||
|
containerBuilder.AddScoped(typeof(EnemyFactory), typeof(IEnemyFactory));
|
||||||
containerBuilder.AddScoped(typeof(RoomGenerator));
|
containerBuilder.AddScoped(typeof(RoomGenerator));
|
||||||
|
|
||||||
containerBuilder.OnContainerBuilt += Initialize;
|
containerBuilder.OnContainerBuilt += Initialize;
|
||||||
@@ -37,14 +41,14 @@ namespace Code.App.SceneInstallers
|
|||||||
loadingManager
|
loadingManager
|
||||||
.UnregisterLoading(LoadingWork.LoadScene);
|
.UnregisterLoading(LoadingWork.LoadScene);
|
||||||
|
|
||||||
LoadRooms(container,loadingManager);
|
LoadRooms(container,loadingManager).Forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async UniTaskVoid LoadRooms(Container container, ILoadingManager loadingManager)
|
private async UniTaskVoid LoadRooms(Container container, ILoadingManager loadingManager)
|
||||||
{
|
{
|
||||||
await container.Resolve<IRoomGeneratorFactory>().PreloadRooms(container.Resolve<IOrderService>());
|
// await container.Resolve<IRoomGeneratorFactory>().PreloadRooms(container.Resolve<IOrderService>());
|
||||||
|
|
||||||
container.Resolve<RoomGenerator>().Initialize();
|
// container.Resolve<RoomGenerator>().Initialize();
|
||||||
|
|
||||||
loadingManager.UnregisterLoading(LoadingWork.LoadModelResource);
|
loadingManager.UnregisterLoading(LoadingWork.LoadModelResource);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,10 +19,10 @@ namespace Code.App.StateMachine
|
|||||||
[Inject] public AppStateMachine StateMachine { get; private set; }
|
[Inject] public AppStateMachine StateMachine { get; private set; }
|
||||||
[Inject] public CameraStateMachine CameraStateMachine { get; private set; }
|
[Inject] public CameraStateMachine CameraStateMachine { get; private set; }
|
||||||
[Inject] public IUIService UIService { get; private set; }
|
[Inject] public IUIService UIService { get; private set; }
|
||||||
[Inject] public IPlayerFactory PlayerFactory { get; private set; }
|
|
||||||
[Inject] public IPlayerProvider PlayerProvider { get; private set; }
|
|
||||||
[Inject] public IAudioFactory AudioFactory { get; private set; }
|
[Inject] public IAudioFactory AudioFactory { get; private set; }
|
||||||
[Inject] public IAudioService AudioService { get; private set; }
|
[Inject] public IAudioService AudioService { get; private set; }
|
||||||
[Inject] public IEnemyFactory EnemyFactory { get; private set; }
|
/*[Inject]*/public IPlayerFactory PlayerFactory { get; set; }
|
||||||
|
/*[Inject]*/public IPlayerProvider PlayerProvider { get; set; }
|
||||||
|
// [Inject] public IEnemyFactory EnemyFactory { get; private set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,17 +2,16 @@ namespace Code.Audio
|
|||||||
{
|
{
|
||||||
public enum SFXSounds
|
public enum SFXSounds
|
||||||
{
|
{
|
||||||
Crowbar,
|
|
||||||
Shot357
|
|
||||||
}
|
}
|
||||||
public enum UISounds
|
public enum UISounds
|
||||||
{
|
{
|
||||||
Crowbar
|
|
||||||
}
|
}
|
||||||
public enum EnemiesSounds
|
public enum EnemiesSounds
|
||||||
{
|
{
|
||||||
Bastard,
|
GrandpaAttack,
|
||||||
Bravo
|
GrandpaStep,
|
||||||
|
RoachAttack,
|
||||||
|
RoachStep
|
||||||
}
|
}
|
||||||
public enum DispatcherSounds
|
public enum DispatcherSounds
|
||||||
{
|
{
|
||||||
@@ -28,4 +27,10 @@ namespace Code.Audio
|
|||||||
Late4,
|
Late4,
|
||||||
Late5
|
Late5
|
||||||
}
|
}
|
||||||
|
public enum CourierSounds
|
||||||
|
{
|
||||||
|
Step,
|
||||||
|
Damage1,
|
||||||
|
Damage2
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -19,24 +19,28 @@ namespace Code.Audio
|
|||||||
private AssetReference[] _audioTestClipsReferences;
|
private AssetReference[] _audioTestClipsReferences;
|
||||||
private AssetReference[] _peacefulSoundtrack;
|
private AssetReference[] _peacefulSoundtrack;
|
||||||
private AssetReference[] _actionSoundtrack;
|
private AssetReference[] _actionSoundtrack;
|
||||||
|
private AssetReference[] _deathSoundtrack;
|
||||||
private AssetReference[] _menuSoundtrack;
|
private AssetReference[] _menuSoundtrack;
|
||||||
private AssetReference[] _SFX;
|
private AssetReference[] _SFX;
|
||||||
private AssetReference[] _enemies;
|
private AssetReference[] _enemies;
|
||||||
private AssetReference[] _dispatcher;
|
private AssetReference[] _dispatcher;
|
||||||
private AssetReference[] _character;
|
private AssetReference[] _courier;
|
||||||
|
|
||||||
private AsyncOperationHandle<IList<AudioClip>> _audioTestClipsHandle;
|
private AsyncOperationHandle<IList<AudioClip>> _audioTestClipsHandle;
|
||||||
private AsyncOperationHandle<IList<AudioClip>> _menuMusicHandle;
|
private AsyncOperationHandle<IList<AudioClip>> _menuMusicHandle;
|
||||||
|
private AsyncOperationHandle<IList<AudioClip>> _deathMusicHandle;
|
||||||
private AsyncOperationHandle<IList<AudioClip>> _actionMusicHandle;
|
private AsyncOperationHandle<IList<AudioClip>> _actionMusicHandle;
|
||||||
private AsyncOperationHandle<IList<AudioClip>> _peacefulMusicHandle;
|
private AsyncOperationHandle<IList<AudioClip>> _peacefulMusicHandle;
|
||||||
private AsyncOperationHandle<IList<AudioClip>> _SFXHandle;
|
private AsyncOperationHandle<IList<AudioClip>> _SFXHandle;
|
||||||
private AsyncOperationHandle<IList<AudioClip>> _enemiesHandle;
|
private AsyncOperationHandle<IList<AudioClip>> _enemiesHandle;
|
||||||
private AsyncOperationHandle<IList<AudioClip>> _dispatcherHandle;
|
private AsyncOperationHandle<IList<AudioClip>> _dispatcherHandle;
|
||||||
|
private AsyncOperationHandle<IList<AudioClip>> _courierHandle;
|
||||||
|
|
||||||
public Dictionary<AudioType, AudioClip> AudioTestClips { get; private set; } = new();
|
public Dictionary<AudioType, AudioClip> AudioTestClips { get; private set; } = new();
|
||||||
public Dictionary<MusicType, List<AudioClip>> MusicDictionary { get; private set; } = new();
|
public Dictionary<MusicType, List<AudioClip>> MusicDictionary { get; private set; } = new();
|
||||||
public List<AudioClip> SFXAudios { get; private set; } = new();
|
public List<AudioClip> SFXAudios { get; private set; } = new();
|
||||||
public List<AudioClip> EnemiesAudios { get; private set; } = new();
|
public List<AudioClip> EnemiesAudios { get; private set; } = new();
|
||||||
|
public List<AudioClip> CourierAudios { get; private set; } = new();
|
||||||
public List<AudioClip> DispatcherAudios { get; private set; } = new();
|
public List<AudioClip> DispatcherAudios { get; private set; } = new();
|
||||||
|
|
||||||
public AudioFactory(AudioMixerConfig audioMixerConfig,
|
public AudioFactory(AudioMixerConfig audioMixerConfig,
|
||||||
@@ -44,7 +48,8 @@ namespace Code.Audio
|
|||||||
SFXListConfig sfxListConfig,
|
SFXListConfig sfxListConfig,
|
||||||
EnemiesSoundListConfig enemiesSoundListConfig,
|
EnemiesSoundListConfig enemiesSoundListConfig,
|
||||||
DispatcherSoundListConfig dispatcherSoundListConfig,
|
DispatcherSoundListConfig dispatcherSoundListConfig,
|
||||||
AudioTestClipsConfig audioTestClipsConfig
|
AudioTestClipsConfig audioTestClipsConfig,
|
||||||
|
CourierSoundListConfig courierSoundListConfig
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
AudioMixer = audioMixerConfig.audioMixerAsset;
|
AudioMixer = audioMixerConfig.audioMixerAsset;
|
||||||
@@ -52,15 +57,18 @@ namespace Code.Audio
|
|||||||
|
|
||||||
_peacefulSoundtrack = soundtrackListConfig.peacefulSoundtrack;
|
_peacefulSoundtrack = soundtrackListConfig.peacefulSoundtrack;
|
||||||
_actionSoundtrack = soundtrackListConfig.actionSoundtrack;
|
_actionSoundtrack = soundtrackListConfig.actionSoundtrack;
|
||||||
|
_deathSoundtrack = soundtrackListConfig.deathSoundtrack;
|
||||||
_menuSoundtrack = soundtrackListConfig.menuSoundtrack;
|
_menuSoundtrack = soundtrackListConfig.menuSoundtrack;
|
||||||
_SFX = sfxListConfig.SFX;
|
_SFX = sfxListConfig.SFX;
|
||||||
_enemies = enemiesSoundListConfig.enemies;
|
_enemies = enemiesSoundListConfig.enemies;
|
||||||
_dispatcher = dispatcherSoundListConfig.dispatcher;
|
_dispatcher = dispatcherSoundListConfig.dispatcher;
|
||||||
|
_courier = courierSoundListConfig.courierSounds;
|
||||||
_audioTestClipsReferences = audioTestClipsConfig.audioTestClips;
|
_audioTestClipsReferences = audioTestClipsConfig.audioTestClips;
|
||||||
|
|
||||||
MusicDictionary.Add(MusicType.Menu, new ());
|
MusicDictionary.Add(MusicType.Menu, new ());
|
||||||
MusicDictionary.Add(MusicType.Peaceful, new ());
|
MusicDictionary.Add(MusicType.Death, new ());
|
||||||
MusicDictionary.Add(MusicType.Action, new ());
|
MusicDictionary.Add(MusicType.Action, new ());
|
||||||
|
MusicDictionary.Add(MusicType.Peaceful, new ());
|
||||||
}
|
}
|
||||||
|
|
||||||
public async UniTask LoadAudioSourcePrefab(Action<GameObject> callback) =>
|
public async UniTask LoadAudioSourcePrefab(Action<GameObject> callback) =>
|
||||||
@@ -112,6 +120,29 @@ namespace Code.Audio
|
|||||||
// foreach (var assetReference in _menuSoundtrack) assetReference.ReleaseAsset();
|
// foreach (var assetReference in _menuSoundtrack) assetReference.ReleaseAsset();
|
||||||
_menuMusicHandle.Release();
|
_menuMusicHandle.Release();
|
||||||
}
|
}
|
||||||
|
public async UniTask WarmCourier()
|
||||||
|
{
|
||||||
|
// _courierHandle = Addressables.LoadAssetsAsync<AudioClip>(_courier, OnCourierLoaded, Addressables.MergeMode.Union);
|
||||||
|
foreach (var assetReference in _courier) CourierAudios.Add(await Addressables.LoadAssetAsync<AudioClip>(assetReference));
|
||||||
|
// await _courierHandle.ToUniTask();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ReleaseCourier()
|
||||||
|
{
|
||||||
|
foreach (var assetReference in CourierAudios) Addressables.Release(assetReference);
|
||||||
|
CourierAudios.Clear();
|
||||||
|
// _courierHandle.Release();
|
||||||
|
}
|
||||||
|
public async UniTask WarmDeathMusic()
|
||||||
|
{
|
||||||
|
_deathMusicHandle = Addressables.LoadAssetsAsync<AudioClip>(_deathSoundtrack, OnDeathTrackLoaded, Addressables.MergeMode.Union);
|
||||||
|
await _deathMusicHandle.ToUniTask();
|
||||||
|
}
|
||||||
|
public void ReleaseDeathMusic()
|
||||||
|
{
|
||||||
|
MusicDictionary[MusicType.Death].Clear();
|
||||||
|
_deathMusicHandle.Release();
|
||||||
|
}
|
||||||
public async UniTask WarmSFX( )
|
public async UniTask WarmSFX( )
|
||||||
{
|
{
|
||||||
_SFXHandle = Addressables.LoadAssetsAsync<AudioClip>(_SFX, OnSFXLoaded, Addressables.MergeMode.Union);
|
_SFXHandle = Addressables.LoadAssetsAsync<AudioClip>(_SFX, OnSFXLoaded, Addressables.MergeMode.Union);
|
||||||
@@ -156,6 +187,10 @@ namespace Code.Audio
|
|||||||
{
|
{
|
||||||
MusicDictionary[MusicType.Menu].Add(audioClip);
|
MusicDictionary[MusicType.Menu].Add(audioClip);
|
||||||
}
|
}
|
||||||
|
private void OnDeathTrackLoaded(AudioClip audioClip)
|
||||||
|
{
|
||||||
|
MusicDictionary[MusicType.Death].Add(audioClip);
|
||||||
|
}
|
||||||
|
|
||||||
// private int _audioTestClipCounter;
|
// private int _audioTestClipCounter;
|
||||||
private void OnAudioTestClipLoaded(AudioClip audioClip)
|
private void OnAudioTestClipLoaded(AudioClip audioClip)
|
||||||
@@ -182,5 +217,9 @@ namespace Code.Audio
|
|||||||
{
|
{
|
||||||
DispatcherAudios.Add(audioClip);
|
DispatcherAudios.Add(audioClip);
|
||||||
}
|
}
|
||||||
|
private void OnCourierLoaded(AudioClip audioClip)
|
||||||
|
{
|
||||||
|
CourierAudios.Add(audioClip);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -22,134 +22,104 @@ namespace Code.Audio
|
|||||||
private AudioSource _actionMusicSource;
|
private AudioSource _actionMusicSource;
|
||||||
private AudioSource _peacefulMusicSource;
|
private AudioSource _peacefulMusicSource;
|
||||||
|
|
||||||
private AudioMixerGroup _masterGroup,
|
private Dictionary<AudioType, AudioMixerGroup> _audioMixerGroups = new();
|
||||||
// _musicGroup,
|
|
||||||
_actionMusicGroup,
|
|
||||||
_menuMusicGroup,
|
|
||||||
_peacefulMusicGroup,
|
|
||||||
_SFXGroup,
|
|
||||||
_creaturesGroup,
|
|
||||||
_dispatcherGroup,
|
|
||||||
_courierGroup,
|
|
||||||
_enemiesGroup;
|
|
||||||
|
|
||||||
private readonly AudioSourcePool _audioSourcePool;
|
private readonly AudioSourcePool _audioSourcePool;
|
||||||
|
|
||||||
private Dictionary<AudioSnapshotState, AudioMixerSnapshot> _snapshots = new();
|
// Юнити не может - говнокод поможет.
|
||||||
|
private Dictionary<AudioSnapshotState, Dictionary<AudioType, float>> _snapshotsVolumes = new();
|
||||||
private Dictionary<AudioSourceType, AudioSourceSettingsConfig> _settings;
|
private Dictionary<AudioSourceType, AudioSourceSettingsConfig> _settings;
|
||||||
|
|
||||||
public AudioService(IAudioFactory audioFactory, Dictionary<AudioSourceType, AudioSourceSettingsConfig> settings)
|
public AudioService(IAudioFactory audioFactory,
|
||||||
|
Dictionary<AudioSourceType, AudioSourceSettingsConfig> settings,
|
||||||
|
DefaultAudioSettingsConfig defaultAudioSettingsConfig)
|
||||||
{
|
{
|
||||||
_audioFactory = audioFactory;
|
_audioFactory = audioFactory;
|
||||||
_audioSourcePool = new(settings);
|
_audioSourcePool = new(settings);
|
||||||
_settings = settings;
|
_settings = settings;
|
||||||
|
|
||||||
|
_snapshotsVolumes.Add(AudioSnapshotState.None,defaultAudioSettingsConfig.noneVolume);
|
||||||
|
_snapshotsVolumes.Add(AudioSnapshotState.Menu,defaultAudioSettingsConfig.menuVolume);
|
||||||
|
_snapshotsVolumes.Add(AudioSnapshotState.Action,defaultAudioSettingsConfig.actionVolume);
|
||||||
|
_snapshotsVolumes.Add(AudioSnapshotState.Peaceful,defaultAudioSettingsConfig.peacefulVolume);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO Грязно, убрать снапшоты НАХУЙ
|
|
||||||
public float GetSetting(AudioType type)
|
public float GetSetting(AudioType type)
|
||||||
{
|
{
|
||||||
float value;
|
_mixer.GetFloat(_audioMixerGroups[type].name, out float value);
|
||||||
switch (type)
|
|
||||||
{
|
|
||||||
case AudioType.SFX:
|
|
||||||
_snapshots[AudioSnapshotState.Peaceful].audioMixer.GetFloat(_SFXGroup.name, out value);
|
|
||||||
break;
|
|
||||||
case AudioType.Master:
|
|
||||||
_snapshots[AudioSnapshotState.Menu].audioMixer.GetFloat(_masterGroup.name, out value);
|
|
||||||
break;
|
|
||||||
case AudioType.Creatures:
|
|
||||||
_snapshots[AudioSnapshotState.Peaceful].audioMixer.GetFloat(_creaturesGroup.name, out value);
|
|
||||||
break;
|
|
||||||
case AudioType.GameplayMusic:
|
|
||||||
_snapshots[AudioSnapshotState.Peaceful].audioMixer.GetFloat(_peacefulMusicGroup.name, out value);
|
|
||||||
break;
|
|
||||||
case AudioType.MenuMusic:
|
|
||||||
_snapshots[AudioSnapshotState.Menu].audioMixer.GetFloat(_menuMusicGroup.name, out value);
|
|
||||||
break;
|
|
||||||
case AudioType.DispatcherSounds:
|
|
||||||
_snapshots[AudioSnapshotState.Action].audioMixer.GetFloat(_dispatcherGroup.name, out value);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
value = 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
value = Mathf.Pow(10f, value / 20);
|
value = Mathf.Pow(10f, value / 20);
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO Грязно, убрать снапшоты НАХУЙ
|
|
||||||
public void ChangeSetting(AudioType type, float value)
|
public void ChangeSetting(AudioType type, float value)
|
||||||
{
|
{
|
||||||
float volume = Mathf.Log10(value) * 20;
|
float volume = Mathf.Log10(value) * 20;
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case AudioType.SFX:
|
case AudioType.DeathMusic:
|
||||||
_snapshots[AudioSnapshotState.Peaceful].audioMixer.SetFloat(_SFXGroup.name, volume);
|
|
||||||
_snapshots[AudioSnapshotState.Action].audioMixer.SetFloat(_SFXGroup.name, volume);
|
|
||||||
break;
|
|
||||||
case AudioType.Master:
|
case AudioType.Master:
|
||||||
_snapshots[AudioSnapshotState.Menu].audioMixer.SetFloat(_masterGroup.name, volume);
|
_snapshotsVolumes[AudioSnapshotState.Menu][type] = value;
|
||||||
_snapshots[AudioSnapshotState.Peaceful].audioMixer.SetFloat(_masterGroup.name, volume);
|
_snapshotsVolumes[AudioSnapshotState.Action][type] = value;
|
||||||
_snapshots[AudioSnapshotState.Action].audioMixer.SetFloat(_masterGroup.name, volume);
|
_snapshotsVolumes[AudioSnapshotState.Peaceful][type] = value;
|
||||||
|
_mixer.SetFloat(_audioMixerGroups[type].name, volume);
|
||||||
break;
|
break;
|
||||||
case AudioType.Creatures:
|
case AudioType.ActionMusic:
|
||||||
_snapshots[AudioSnapshotState.Peaceful].audioMixer.SetFloat(_creaturesGroup.name, volume);
|
_snapshotsVolumes[AudioSnapshotState.Action][type] = value;
|
||||||
_snapshots[AudioSnapshotState.Action].audioMixer.SetFloat(_creaturesGroup.name, volume);
|
_mixer.SetFloat(_audioMixerGroups[type].name, volume);
|
||||||
break;
|
break;
|
||||||
case AudioType.GameplayMusic:
|
case AudioType.PeacefulMusic:
|
||||||
_snapshots[AudioSnapshotState.Peaceful].audioMixer.SetFloat(_peacefulMusicGroup.name, volume);
|
_snapshotsVolumes[AudioSnapshotState.Peaceful][type] = value;
|
||||||
_snapshots[AudioSnapshotState.Action].audioMixer.SetFloat(_actionMusicGroup.name, volume);
|
_mixer.SetFloat(_audioMixerGroups[type].name, volume);
|
||||||
break;
|
break;
|
||||||
case AudioType.MenuMusic:
|
case AudioType.MenuMusic:
|
||||||
_snapshots[AudioSnapshotState.Menu].audioMixer.SetFloat(_menuMusicGroup.name, volume);
|
_snapshotsVolumes[AudioSnapshotState.Menu][type] = value;
|
||||||
|
_mixer.SetFloat(_audioMixerGroups[type].name, volume);
|
||||||
break;
|
break;
|
||||||
case AudioType.DispatcherSounds:
|
case AudioType.SFX:
|
||||||
_snapshots[AudioSnapshotState.Peaceful].audioMixer.SetFloat(_dispatcherGroup.name, volume);
|
case AudioType.Dispatcher:
|
||||||
_snapshots[AudioSnapshotState.Action].audioMixer.SetFloat(_dispatcherGroup.name, volume);
|
case AudioType.Courier:
|
||||||
|
case AudioType.Enemies:
|
||||||
|
_snapshotsVolumes[AudioSnapshotState.Action][type] = value;
|
||||||
|
_snapshotsVolumes[AudioSnapshotState.Peaceful][type] = value;
|
||||||
|
_mixer.SetFloat(_audioMixerGroups[type].name, volume);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// _mixer.FindSnapshot("Action").audioMixer.SetFloat("music", volume);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async UniTask Initialize()
|
public async UniTask Initialize()
|
||||||
{
|
{
|
||||||
// _mixer = await _audioFactory.CreateMixer();
|
|
||||||
_mixer = _audioFactory.AudioMixer;
|
_mixer = _audioFactory.AudioMixer;
|
||||||
|
|
||||||
_masterGroup = _mixer.FindMatchingGroups(AudioGroups.MasterGroup)[0];
|
|
||||||
_menuMusicGroup = _mixer.FindMatchingGroups(AudioGroups.MenuMusicGroup)[0];
|
|
||||||
_actionMusicGroup = _mixer.FindMatchingGroups(AudioGroups.ActionMusicGroup)[0];
|
|
||||||
_peacefulMusicGroup = _mixer.FindMatchingGroups(AudioGroups.PeacefulMusicGroup)[0];
|
|
||||||
// _musicGroup = _mixer.FindMatchingGroups(AudioGroups.MusicGroup)[0];
|
|
||||||
_musicAudioGroups.Add(MusicType.Menu, _mixer.FindMatchingGroups(AudioGroups.MenuMusicGroup)[0]);
|
_musicAudioGroups.Add(MusicType.Menu, _mixer.FindMatchingGroups(AudioGroups.MenuMusicGroup)[0]);
|
||||||
|
_musicAudioGroups.Add(MusicType.Death, _mixer.FindMatchingGroups(AudioGroups.DeathMusicGroup)[0]);
|
||||||
_musicAudioGroups.Add(MusicType.Action, _mixer.FindMatchingGroups(AudioGroups.ActionMusicGroup)[0]);
|
_musicAudioGroups.Add(MusicType.Action, _mixer.FindMatchingGroups(AudioGroups.ActionMusicGroup)[0]);
|
||||||
_musicAudioGroups.Add(MusicType.Peaceful, _mixer.FindMatchingGroups(AudioGroups.PeacefulMusicGroup)[0]);
|
_musicAudioGroups.Add(MusicType.Peaceful, _mixer.FindMatchingGroups(AudioGroups.PeacefulMusicGroup)[0]);
|
||||||
|
|
||||||
_cancellationTokenSources.Add(MusicType.Menu, new());
|
_cancellationTokenSources.Add(MusicType.Menu, new());
|
||||||
|
_cancellationTokenSources.Add(MusicType.Death, new());
|
||||||
_cancellationTokenSources.Add(MusicType.Action, new());
|
_cancellationTokenSources.Add(MusicType.Action, new());
|
||||||
_cancellationTokenSources.Add(MusicType.Peaceful, new());
|
_cancellationTokenSources.Add(MusicType.Peaceful, new());
|
||||||
|
|
||||||
_musicAudioSources.Add(MusicType.Menu, null);
|
_musicAudioSources.Add(MusicType.Menu, null);
|
||||||
|
_musicAudioSources.Add(MusicType.Death, null);
|
||||||
_musicAudioSources.Add(MusicType.Action, null);
|
_musicAudioSources.Add(MusicType.Action, null);
|
||||||
_musicAudioSources.Add(MusicType.Peaceful, null);
|
_musicAudioSources.Add(MusicType.Peaceful, null);
|
||||||
|
|
||||||
_SFXGroup = _mixer.FindMatchingGroups(AudioGroups.SFXGroup)[0];
|
_audioMixerGroups.Add(AudioType.Master, _mixer.FindMatchingGroups(AudioGroups.MasterGroup)[0]);
|
||||||
_creaturesGroup = _mixer.FindMatchingGroups(AudioGroups.CreaturesGroup)[0];
|
_audioMixerGroups.Add(AudioType.SFX, _mixer.FindMatchingGroups(AudioGroups.SFXGroup)[0]);
|
||||||
_dispatcherGroup = _mixer.FindMatchingGroups(AudioGroups.DispatcherMusicGroup)[0];
|
_audioMixerGroups.Add(AudioType.Dispatcher, _mixer.FindMatchingGroups(AudioGroups.DispatcherMusicGroup)[0]);
|
||||||
_courierGroup = _mixer.FindMatchingGroups(AudioGroups.CourierMusicGroup)[0];
|
_audioMixerGroups.Add(AudioType.Courier, _mixer.FindMatchingGroups(AudioGroups.CourierGroup)[0]);
|
||||||
_enemiesGroup = _mixer.FindMatchingGroups(AudioGroups.EnemiesMusicGroup)[0];
|
_audioMixerGroups.Add(AudioType.Enemies, _mixer.FindMatchingGroups(AudioGroups.EnemiesGroup)[0]);
|
||||||
|
_audioMixerGroups.Add(AudioType.MenuMusic, _musicAudioGroups[MusicType.Menu]);
|
||||||
|
_audioMixerGroups.Add(AudioType.DeathMusic, _musicAudioGroups[MusicType.Death]);
|
||||||
|
_audioMixerGroups.Add(AudioType.ActionMusic, _musicAudioGroups[MusicType.Action]);
|
||||||
|
_audioMixerGroups.Add(AudioType.PeacefulMusic, _musicAudioGroups[MusicType.Peaceful]);
|
||||||
|
|
||||||
_snapshots[AudioSnapshotState.None] = _mixer.FindSnapshot(AudioGroups.NoneSnapshot);
|
|
||||||
_snapshots[AudioSnapshotState.Peaceful] = _mixer.FindSnapshot(AudioGroups.PeacefulSnapshot);
|
|
||||||
_snapshots[AudioSnapshotState.Action] = _mixer.FindSnapshot(AudioGroups.ActionSnapshot);
|
|
||||||
_snapshots[AudioSnapshotState.Menu] = _mixer.FindSnapshot(AudioGroups.MenuSnapshot);
|
|
||||||
|
|
||||||
await _audioFactory.LoadAudioSourcePrefab(_audioSourcePool.Initialize);
|
await _audioFactory.LoadAudioSourcePrefab(_audioSourcePool.Initialize);
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
|
|
||||||
private Dictionary<MusicType, CancellationTokenSource> _cancellationTokenSources = new();
|
private Dictionary<MusicType, CancellationTokenSource> _cancellationTokenSources = new();
|
||||||
private Dictionary<MusicType, AudioSource> _musicAudioSources = new();
|
private Dictionary<MusicType, AudioSource> _musicAudioSources = new();
|
||||||
private Dictionary<MusicType, AudioMixerGroup> _musicAudioGroups = new();
|
private Dictionary<MusicType, AudioMixerGroup> _musicAudioGroups = new();
|
||||||
@@ -169,19 +139,13 @@ namespace Code.Audio
|
|||||||
|
|
||||||
_musicAudioSources[musicType].Play();
|
_musicAudioSources[musicType].Play();
|
||||||
|
|
||||||
// await UniTask.WaitUntilValueChanged(_musicAudioSources[musicType],
|
|
||||||
// _ => !_musicAudioSources[musicType].isPlaying,
|
|
||||||
// cancellationToken: _cancellationTokenSources[musicType].Token);
|
|
||||||
await UniTask.NextFrame();
|
await UniTask.NextFrame();
|
||||||
// Debug.Log($"Playing {musicType}");
|
|
||||||
var (isCanceled, _) = await UniTask.WaitUntilValueChanged(_musicAudioSources[musicType],
|
var (isCanceled, _) = await UniTask.WaitUntilValueChanged(_musicAudioSources[musicType],
|
||||||
_ => !_musicAudioSources[musicType].isPlaying,
|
_ => !_musicAudioSources[musicType].isPlaying,
|
||||||
cancellationToken: _cancellationTokenSources[musicType].Token).SuppressCancellationThrow();
|
cancellationToken: _cancellationTokenSources[musicType].Token).SuppressCancellationThrow();
|
||||||
// Debug.Log($"Finished {musicType}");
|
Debug.LogError("Music skipping");
|
||||||
|
|
||||||
if (isCanceled)
|
if (isCanceled)
|
||||||
{
|
{
|
||||||
// Debug.Log($"Cancelled {musicType}");
|
|
||||||
_cancellationTokenSources[musicType].Dispose();
|
_cancellationTokenSources[musicType].Dispose();
|
||||||
_cancellationTokenSources[musicType] = new();
|
_cancellationTokenSources[musicType] = new();
|
||||||
|
|
||||||
@@ -191,13 +155,13 @@ namespace Code.Audio
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayRandomMusicUntilHumanityWillBeDestroyedForTheySins(musicType);
|
PlayRandomMusicUntilHumanityWillBeDestroyedForTheySins(musicType).Forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async UniTaskVoid GladlyAskToStopMusic(MusicType musicType,
|
public async UniTaskVoid GladlyAskToStopMusic(MusicType musicType,
|
||||||
AudioSnapshotState audioSnapshotState = AudioSnapshotState.None, float time = 1f, Action callback = null)
|
AudioSnapshotState audioSnapshotState = AudioSnapshotState.None, float time = 1f, Action callback = null)
|
||||||
{
|
{
|
||||||
TransitToSnapshot(audioSnapshotState, time);
|
//TransitToSnapshot(audioSnapshotState, time);
|
||||||
|
|
||||||
await UniTask.WaitForSeconds(time);
|
await UniTask.WaitForSeconds(time);
|
||||||
|
|
||||||
@@ -205,39 +169,56 @@ namespace Code.Audio
|
|||||||
|
|
||||||
callback?.Invoke();
|
callback?.Invoke();
|
||||||
}
|
}
|
||||||
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
|
|
||||||
|
|
||||||
public void StopMusic()
|
public void StopMusic()
|
||||||
{
|
{
|
||||||
_peacefulMusicSource.Stop();
|
_peacefulMusicSource.Stop();
|
||||||
_actionMusicSource.Stop();
|
_actionMusicSource.Stop();
|
||||||
|
_cancellationTokenSources[MusicType.Peaceful].Cancel();
|
||||||
|
_cancellationTokenSources[MusicType.Action].Cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void GladlyAskToStopMusic(Action callback = null)
|
public void GladlyAskToStopMusic(Action callback = null)
|
||||||
{
|
{
|
||||||
TransitToSnapshot(AudioSnapshotState.None);
|
// TransitToSnapshot(AudioSnapshotState.None);
|
||||||
_peacefulMusicSource.Stop();
|
_peacefulMusicSource.Stop();
|
||||||
_actionMusicSource.Stop();
|
_actionMusicSource.Stop();
|
||||||
|
|
||||||
callback?.Invoke();
|
callback?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void TransitToSnapshot(AudioSnapshotState state, float time = 1f)
|
public void TransitToSnapshot(AudioSnapshotState state, float time = 1)
|
||||||
{
|
{
|
||||||
_snapshots[state].TransitionTo(time);
|
foreach (var key in _audioMixerGroups.Keys)
|
||||||
|
_mixer.DOSetFloat(_audioMixerGroups[key].name, Mathf.Log10(_snapshotsVolumes[state][key]) * 20, time);
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
|
|
||||||
public void PlaySFX(SFXSounds sfxId, Vector3 position)
|
public void PlaySFX(SFXSounds sfxId, Vector3 position)
|
||||||
{
|
{
|
||||||
_audioSourcePool.PlayOneShot(_audioFactory.SFXAudios[(int)sfxId], position, _SFXGroup);
|
_audioSourcePool
|
||||||
|
.PlayOneShot(_audioFactory.SFXAudios[(int)sfxId], position, _audioMixerGroups[AudioType.SFX]).Forget();
|
||||||
|
}
|
||||||
|
public void ApplyStun(float value, float time)
|
||||||
|
{
|
||||||
|
_mixer.DOSetFloat("Stun", value, time);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PlayEnemy(EnemiesSounds enemySoundId, Vector3 position)
|
public void PlayEnemy(EnemiesSounds enemySoundId, Vector3 position)
|
||||||
{
|
{
|
||||||
_audioSourcePool.PlayOneShot(_audioFactory.EnemiesAudios[(int)enemySoundId], position, _enemiesGroup);
|
_audioSourcePool.PlayOneShot(_audioFactory.EnemiesAudios[(int)enemySoundId], position,
|
||||||
|
_audioMixerGroups[AudioType.Enemies]).Forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AudioSource GetSourceOfGroup(AudioType group)
|
||||||
|
{
|
||||||
|
AudioSource source = _audioSourcePool.GetSource();
|
||||||
|
source.outputAudioMixerGroup = _audioMixerGroups[group];
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ReleaseSourceOfGroup(AudioSource source) => _audioSourcePool.ReleaseSource(source);
|
||||||
|
|
||||||
// Чинить долго и дорого пусть Артёмов будет много, ведь он наш друг
|
// Чинить долго и дорого пусть Артёмов будет много, ведь он наш друг
|
||||||
public event IAudioService.OnAudioPlayingDelegate OnDispatcherStarted;
|
public event IAudioService.OnAudioPlayingDelegate OnDispatcherStarted;
|
||||||
public event IAudioService.OnAudioPlayingDelegate OnDispatcherEnded;
|
public event IAudioService.OnAudioPlayingDelegate OnDispatcherEnded;
|
||||||
@@ -245,12 +226,22 @@ namespace Code.Audio
|
|||||||
public void PlayDispatcher(DispatcherSounds dispatcherSoundId)
|
public void PlayDispatcher(DispatcherSounds dispatcherSoundId)
|
||||||
{
|
{
|
||||||
OnDispatcherStarted?.Invoke();
|
OnDispatcherStarted?.Invoke();
|
||||||
_audioSourcePool.PlayOneShot(_audioFactory.DispatcherAudios[(int)dispatcherSoundId], _dispatcherGroup,
|
_audioSourcePool.PlayOneShot(_audioFactory.DispatcherAudios[(int)dispatcherSoundId],
|
||||||
AudioSourceType.NoBlend, () => OnDispatcherEnded?.Invoke());
|
_audioMixerGroups[AudioType.Dispatcher],
|
||||||
|
AudioSourceType.NoBlend, () => OnDispatcherEnded?.Invoke()).Forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void PlayCourier(CourierSounds courierSounds)
|
||||||
|
{
|
||||||
|
_audioSourcePool.PlayOneShot(_audioFactory.CourierAudios[(int)courierSounds],
|
||||||
|
_audioMixerGroups[AudioType.Courier],
|
||||||
|
AudioSourceType.NoBlend).Forget();
|
||||||
|
}
|
||||||
private CancellationTokenSource _testClipCancellationTokenSource = new();
|
private CancellationTokenSource _testClipCancellationTokenSource = new();
|
||||||
private void ResetCurrentTestAudioSource() => _currentTestClipAudioType = AudioType.Master;
|
private void ResetCurrentTestAudioSource() => _currentTestClipAudioType = AudioType.Master;
|
||||||
|
|
||||||
|
private AudioType _currentTestClipAudioType;
|
||||||
|
|
||||||
// TODO Засунуть в словарь
|
// TODO Засунуть в словарь
|
||||||
public void PlayTestClip(AudioType audioType)
|
public void PlayTestClip(AudioType audioType)
|
||||||
{
|
{
|
||||||
@@ -261,92 +252,9 @@ namespace Code.Audio
|
|||||||
|
|
||||||
_currentTestClipAudioType = audioType;
|
_currentTestClipAudioType = audioType;
|
||||||
|
|
||||||
switch (audioType)
|
|
||||||
{
|
|
||||||
case AudioType.SFX:
|
|
||||||
_audioSourcePool.PlayOneShot(_audioFactory.AudioTestClips[audioType],
|
_audioSourcePool.PlayOneShot(_audioFactory.AudioTestClips[audioType],
|
||||||
_SFXGroup, _testClipCancellationTokenSource,
|
_audioMixerGroups[audioType], _testClipCancellationTokenSource,
|
||||||
AudioSourceType.NoBlend, ResetCurrentTestAudioSource);
|
AudioSourceType.NoBlend, ResetCurrentTestAudioSource).Forget();
|
||||||
break;
|
|
||||||
case AudioType.Master:
|
|
||||||
_audioSourcePool.PlayOneShot(_audioFactory.AudioTestClips[audioType],
|
|
||||||
_masterGroup, _testClipCancellationTokenSource,
|
|
||||||
AudioSourceType.NoBlend, ResetCurrentTestAudioSource);
|
|
||||||
break;
|
|
||||||
case AudioType.Creatures:
|
|
||||||
_audioSourcePool.PlayOneShot( _audioFactory.AudioTestClips[audioType],
|
|
||||||
_creaturesGroup, _testClipCancellationTokenSource,
|
|
||||||
AudioSourceType.NoBlend, ResetCurrentTestAudioSource);
|
|
||||||
break;
|
|
||||||
case AudioType.GameplayMusic:
|
|
||||||
_audioSourcePool.PlayOneShot(_audioFactory.AudioTestClips[audioType],
|
|
||||||
_actionMusicGroup, _testClipCancellationTokenSource,
|
|
||||||
AudioSourceType.NoBlend, ResetCurrentTestAudioSource);
|
|
||||||
break;
|
|
||||||
case AudioType.MenuMusic:
|
|
||||||
_audioSourcePool.PlayOneShot(_audioFactory.AudioTestClips[audioType],
|
|
||||||
_menuMusicGroup, _testClipCancellationTokenSource,
|
|
||||||
AudioSourceType.NoBlend, ResetCurrentTestAudioSource);
|
|
||||||
break;
|
|
||||||
case AudioType.DispatcherSounds:
|
|
||||||
_audioSourcePool.PlayOneShot(_audioFactory.AudioTestClips[audioType],
|
|
||||||
_dispatcherGroup, _testClipCancellationTokenSource,
|
|
||||||
AudioSourceType.NoBlend, ResetCurrentTestAudioSource);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private AudioSource _testClipAudioSource;
|
|
||||||
private AudioType _currentTestClipAudioType;
|
|
||||||
|
|
||||||
// Эффективно и просто, может не так хитровыебано
|
|
||||||
private void ReleaseTestAudioClipSource()
|
|
||||||
{
|
|
||||||
_testClipAudioSource = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO Засунуть в словарь
|
|
||||||
public void PlayTestClipDeprecated(AudioType audioType)
|
|
||||||
{
|
|
||||||
if (!_testClipAudioSource) _testClipAudioSource = _audioSourcePool.GetSource();
|
|
||||||
else if (_currentTestClipAudioType != audioType) _testClipAudioSource.Stop();
|
|
||||||
else return;
|
|
||||||
|
|
||||||
_currentTestClipAudioType = audioType;
|
|
||||||
|
|
||||||
switch (audioType)
|
|
||||||
{
|
|
||||||
case AudioType.SFX:
|
|
||||||
_audioSourcePool.PlayOneShot(_testClipAudioSource, _audioFactory.AudioTestClips[audioType],
|
|
||||||
_SFXGroup,
|
|
||||||
AudioSourceType.NoBlend, ReleaseTestAudioClipSource);
|
|
||||||
break;
|
|
||||||
case AudioType.Master:
|
|
||||||
_audioSourcePool.PlayOneShot(_testClipAudioSource, _audioFactory.AudioTestClips[audioType],
|
|
||||||
_masterGroup,
|
|
||||||
AudioSourceType.NoBlend, ReleaseTestAudioClipSource);
|
|
||||||
break;
|
|
||||||
case AudioType.Creatures:
|
|
||||||
_audioSourcePool.PlayOneShot(_testClipAudioSource, _audioFactory.AudioTestClips[audioType],
|
|
||||||
_creaturesGroup,
|
|
||||||
AudioSourceType.NoBlend, ReleaseTestAudioClipSource);
|
|
||||||
break;
|
|
||||||
case AudioType.GameplayMusic:
|
|
||||||
_audioSourcePool.PlayOneShot(_testClipAudioSource, _audioFactory.AudioTestClips[audioType],
|
|
||||||
_actionMusicGroup,
|
|
||||||
AudioSourceType.NoBlend, ReleaseTestAudioClipSource);
|
|
||||||
break;
|
|
||||||
case AudioType.MenuMusic:
|
|
||||||
_audioSourcePool.PlayOneShot(_testClipAudioSource, _audioFactory.AudioTestClips[audioType],
|
|
||||||
_menuMusicGroup,
|
|
||||||
AudioSourceType.NoBlend, ReleaseTestAudioClipSource);
|
|
||||||
break;
|
|
||||||
case AudioType.DispatcherSounds:
|
|
||||||
_audioSourcePool.PlayOneShot(_testClipAudioSource, _audioFactory.AudioTestClips[audioType],
|
|
||||||
_dispatcherGroup,
|
|
||||||
AudioSourceType.NoBlend, ReleaseTestAudioClipSource);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -14,6 +14,7 @@ namespace Code.Audio
|
|||||||
List<AudioClip> SFXAudios { get; }
|
List<AudioClip> SFXAudios { get; }
|
||||||
List<AudioClip> EnemiesAudios { get; }
|
List<AudioClip> EnemiesAudios { get; }
|
||||||
List<AudioClip> DispatcherAudios { get; }
|
List<AudioClip> DispatcherAudios { get; }
|
||||||
|
List<AudioClip> CourierAudios { get; }
|
||||||
UniTask LoadAudioSourcePrefab(Action<GameObject> callback);
|
UniTask LoadAudioSourcePrefab(Action<GameObject> callback);
|
||||||
UniTask WarmGameplayMusic( );
|
UniTask WarmGameplayMusic( );
|
||||||
void ReleaseActionMusic();
|
void ReleaseActionMusic();
|
||||||
@@ -28,5 +29,9 @@ namespace Code.Audio
|
|||||||
void ReleaseEnemies();
|
void ReleaseEnemies();
|
||||||
UniTask WarmDispatcher( );
|
UniTask WarmDispatcher( );
|
||||||
void ReleaseDispatcher();
|
void ReleaseDispatcher();
|
||||||
|
UniTask WarmCourier();
|
||||||
|
void ReleaseCourier();
|
||||||
|
UniTask WarmDeathMusic( );
|
||||||
|
void ReleaseDeathMusic();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -23,5 +23,9 @@ namespace Code.Audio
|
|||||||
void ChangeSetting(AudioType type, float value);
|
void ChangeSetting(AudioType type, float value);
|
||||||
float GetSetting(AudioType type);
|
float GetSetting(AudioType type);
|
||||||
void PlayTestClip(AudioType audioType);
|
void PlayTestClip(AudioType audioType);
|
||||||
|
AudioSource GetSourceOfGroup(AudioType group);
|
||||||
|
void ReleaseSourceOfGroup(AudioSource source);
|
||||||
|
void PlayCourier(CourierSounds range);
|
||||||
|
void ApplyStun(float value, float time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,15 +4,19 @@ namespace Code.Audio
|
|||||||
{
|
{
|
||||||
Menu,
|
Menu,
|
||||||
Peaceful,
|
Peaceful,
|
||||||
Action
|
Action,
|
||||||
|
Death
|
||||||
}
|
}
|
||||||
public enum AudioType
|
public enum AudioType
|
||||||
{
|
{
|
||||||
Master,
|
Master,
|
||||||
MenuMusic,
|
MenuMusic,
|
||||||
GameplayMusic,
|
Dispatcher,
|
||||||
Creatures,
|
SFX,
|
||||||
DispatcherSounds,
|
Courier,
|
||||||
SFX
|
Enemies,
|
||||||
|
ActionMusic,
|
||||||
|
PeacefulMusic,
|
||||||
|
DeathMusic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,31 +5,49 @@ namespace Code.Configs
|
|||||||
[CreateAssetMenu(fileName = "CharacterConfig", menuName = "Config/CharacterConfig")]
|
[CreateAssetMenu(fileName = "CharacterConfig", menuName = "Config/CharacterConfig")]
|
||||||
public class CharacterConfig : ScriptableObject
|
public class CharacterConfig : ScriptableObject
|
||||||
{
|
{
|
||||||
// Основное движение по земле
|
|
||||||
public float
|
public float
|
||||||
maxStableMoveSpeed = 8f, // Максимальная скорость движения по устойчивой поверхности
|
maxStableMoveSpeed = 12f,
|
||||||
stableMovementSharpness = 15f, // Резкость изменения скорости движения (чем выше - тем резче)
|
stableMovementSharpness = 15f,
|
||||||
orientationSharpness = 10f, // Резкость изменения вращения персонажа (чем выше - тем резче)
|
orientationSharpness = 10f;
|
||||||
jumpSpeed = 10f; // Скорость прыжка
|
|
||||||
|
|
||||||
// Спринт
|
|
||||||
public float
|
public float
|
||||||
sprintMoveSpeed = 12f, // Максимальная скорость спринта
|
jumpSpeed = 10f,
|
||||||
sprintAngleThreshold = 90f; // Максимальный угол (в градусах) от направления вперёд, при котором разрешён спринт
|
jumpCooldown = 0.4f;
|
||||||
|
|
||||||
// Слайд
|
|
||||||
public float
|
public float
|
||||||
slideSpeed = 20f, // Скорость слайда
|
dashSpeed = 20f,
|
||||||
slideDuration = 0.8f, // Длительность слайда в секундах
|
dashDuration = 0.35f,
|
||||||
slideCooldown = 1.5f; // Время перезарядки слайда в секундах
|
dashCooldown = 1.2f;
|
||||||
|
|
||||||
|
public AnimationCurve slideVelocityCurve = new(
|
||||||
|
new Keyframe(0.0f, 1.0f),
|
||||||
|
new Keyframe(0.3f, 1.4f),
|
||||||
|
new Keyframe(1.0f, 0.2f)
|
||||||
|
);
|
||||||
|
public float
|
||||||
|
slideMinVelocityThreshold = 3f,
|
||||||
|
slideCooldown = 1.5f,
|
||||||
|
slideColliderHeightScale = 0.5f,
|
||||||
|
slideCameraOffsetY = -0.5f,
|
||||||
|
slideEnterDuration = 0.2f,
|
||||||
|
slideExitDuration = 0.25f;
|
||||||
|
|
||||||
// Наклон при залазании на стены
|
|
||||||
public float
|
public float
|
||||||
leanAngle = 25f,
|
leanAngle = 25f,
|
||||||
leanThreshold = 0.3f,
|
leanThreshold = 0.3f,
|
||||||
leanSmoothSpeed = 10f;
|
leanSmoothSpeed = 10f;
|
||||||
|
|
||||||
// Гравитация
|
public Vector3 gravity = new(0f, -30f, 0f);
|
||||||
public Vector3 gravity = new(0f, -30f, 0f); // Вектор, отвечающий за применение гравитации
|
public float
|
||||||
|
maxAirSpeed = 10f,
|
||||||
|
airControlSharpness = 8f;
|
||||||
|
|
||||||
|
public float
|
||||||
|
wallRunMaxTime = 1.75f,
|
||||||
|
wallRunSpeed = 15f,
|
||||||
|
wallRunAcceleration = 25f,
|
||||||
|
wallRunGravityScale = 0.25f,
|
||||||
|
wallDetachImpulse = 7f,
|
||||||
|
wallContactAngleThreshold = 45f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
using UnityEngine;
|
|
||||||
using UnityEngine.AddressableAssets;
|
|
||||||
|
|
||||||
namespace Code.Configs
|
|
||||||
{
|
|
||||||
[CreateAssetMenu(menuName = "Config/Audio/CharacterSoundList", fileName = "CharacterSoundListConfig")]
|
|
||||||
public class CharacterSoundListConfig : ScriptableObject
|
|
||||||
{
|
|
||||||
public AssetReference[] character;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.AddressableAssets;
|
||||||
|
|
||||||
|
namespace Code.Configs
|
||||||
|
{
|
||||||
|
[CreateAssetMenu(menuName = "Config/Audio/CourierSoundListConfig", fileName = "CourierSoundListConfig")]
|
||||||
|
public class CourierSoundListConfig : ScriptableObject
|
||||||
|
{
|
||||||
|
public AssetReference[] courierSounds;
|
||||||
|
}
|
||||||
|
}
|
||||||
File renamed without changes.
@@ -0,0 +1,27 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using AYellowpaper.SerializedCollections;
|
||||||
|
using UnityEngine;
|
||||||
|
using AudioType = Code.Audio.AudioType;
|
||||||
|
|
||||||
|
namespace Code.Configs
|
||||||
|
{
|
||||||
|
[CreateAssetMenu(fileName = "DefaultAudioSettingsConfig", menuName = "Audio/DefaultAudioSettings")]
|
||||||
|
public class DefaultAudioSettingsConfig : ScriptableObject
|
||||||
|
{
|
||||||
|
[Header("Menu")]
|
||||||
|
[SerializedDictionary("AudioType", "Volume")]
|
||||||
|
public SerializedDictionary<Audio.AudioType, float> menuVolume = new();
|
||||||
|
|
||||||
|
[Header("Action")]
|
||||||
|
[SerializedDictionary("AudioType", "Volume")]
|
||||||
|
public SerializedDictionary<Audio.AudioType, float> actionVolume = new();
|
||||||
|
|
||||||
|
[Header("Peaceful")]
|
||||||
|
[SerializedDictionary("AudioType", "Volume")]
|
||||||
|
public SerializedDictionary<Audio.AudioType, float> peacefulVolume = new();
|
||||||
|
|
||||||
|
[Header("None")]
|
||||||
|
[SerializedDictionary("AudioType", "Volume")]
|
||||||
|
public SerializedDictionary<Audio.AudioType, float> noneVolume = new();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 36d35c52933d4d4ba836f75b05c4810f
|
||||||
|
timeCreated: 1764754933
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Code.Configs
|
||||||
|
{
|
||||||
|
[CreateAssetMenu(menuName = "Config/Audio/MusicPlayer", fileName = "MusicPlayerConfig")]
|
||||||
|
public class MusicPlayerConfig : ScriptableObject
|
||||||
|
{
|
||||||
|
public float threshold = 0.5f;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8708e3c129d241b08563f1a170bd3a44
|
||||||
|
timeCreated: 1764585060
|
||||||
@@ -8,6 +8,7 @@ namespace Code.Configs
|
|||||||
{
|
{
|
||||||
public AssetReference[] peacefulSoundtrack;
|
public AssetReference[] peacefulSoundtrack;
|
||||||
public AssetReference[] actionSoundtrack;
|
public AssetReference[] actionSoundtrack;
|
||||||
|
public AssetReference[] deathSoundtrack;
|
||||||
public AssetReference[] menuSoundtrack;
|
public AssetReference[] menuSoundtrack;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -19,13 +19,14 @@ namespace Code.Constants
|
|||||||
public const string PeacefulMusicGroup = "Peaceful";
|
public const string PeacefulMusicGroup = "Peaceful";
|
||||||
public const string ActionMusicGroup = "Action";
|
public const string ActionMusicGroup = "Action";
|
||||||
public const string DispatcherMusicGroup = "Dispatcher";
|
public const string DispatcherMusicGroup = "Dispatcher";
|
||||||
public const string CourierMusicGroup = "Courier";
|
public const string CourierGroup = "Courier";
|
||||||
public const string EnemiesMusicGroup = "Enemies";
|
public const string EnemiesGroup = "Enemies";
|
||||||
|
|
||||||
public const string PeacefulSnapshot = "Peaceful";
|
public const string PeacefulSnapshot = "Peaceful";
|
||||||
public const string ActionSnapshot = "Action";
|
public const string ActionSnapshot = "Action";
|
||||||
public const string NoneSnapshot = "None";
|
public const string NoneSnapshot = "None";
|
||||||
public const string MenuSnapshot = "Menu";
|
public const string MenuSnapshot = "Menu";
|
||||||
public const string MenuMusicGroup = "Menu";
|
public const string MenuMusicGroup = "Menu";
|
||||||
|
public const string DeathMusicGroup = "Death";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -24,6 +24,8 @@ namespace Code.Gameplay.Camera.CameraStates
|
|||||||
CurrentDistance = 0f;
|
CurrentDistance = 0f;
|
||||||
|
|
||||||
Camera.fieldOfView = Context.CameraSettingsConfigs[CameraMode.FirstPerson].fov;
|
Camera.fieldOfView = Context.CameraSettingsConfigs[CameraMode.FirstPerson].fov;
|
||||||
|
|
||||||
|
Cursor.lockState = CursorLockMode.Locked;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void HandlePosition(float deltaTime, float zoomInput, Quaternion targetRotation)
|
protected override void HandlePosition(float deltaTime, float zoomInput, Quaternion targetRotation)
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ namespace Code.Gameplay.Camera.CameraStates
|
|||||||
base.EnterState();
|
base.EnterState();
|
||||||
|
|
||||||
Camera.fieldOfView = Context.CameraSettingsConfigs[CameraMode.MainMenu].fov;
|
Camera.fieldOfView = Context.CameraSettingsConfigs[CameraMode.MainMenu].fov;
|
||||||
|
Cursor.lockState = CursorLockMode.None;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void HandlePosition(float deltaTime, float zoomInput, Quaternion targetRotation)
|
protected override void HandlePosition(float deltaTime, float zoomInput, Quaternion targetRotation)
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ namespace Code.Gameplay.Camera.CameraStates
|
|||||||
base.EnterState();
|
base.EnterState();
|
||||||
|
|
||||||
Camera.fieldOfView = Context.CameraSettingsConfigs[CameraMode.Static].fov;
|
Camera.fieldOfView = Context.CameraSettingsConfigs[CameraMode.Static].fov;
|
||||||
|
Cursor.lockState = CursorLockMode.None;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void HandlePosition(float deltaTime, float zoomInput, Quaternion targetRotation)
|
protected override void HandlePosition(float deltaTime, float zoomInput, Quaternion targetRotation)
|
||||||
|
|||||||
@@ -0,0 +1,82 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using Code.Gameplay.Camera;
|
||||||
|
using KinematicCharacterController;
|
||||||
|
|
||||||
|
namespace Code.Gameplay.Character.Controller.Abilities
|
||||||
|
{
|
||||||
|
public class DashMechanic
|
||||||
|
{
|
||||||
|
private readonly float _dashSpeed;
|
||||||
|
private readonly float _dashDuration;
|
||||||
|
private readonly float _dashCooldown;
|
||||||
|
|
||||||
|
private float _dashTimer;
|
||||||
|
private float _dashCooldownTimer;
|
||||||
|
private Vector3 _dashDirection;
|
||||||
|
private bool _dashRequested;
|
||||||
|
|
||||||
|
public bool IsDashing { get; private set; }
|
||||||
|
|
||||||
|
public DashMechanic(float dashSpeed, float dashDuration, float dashCooldown)
|
||||||
|
{
|
||||||
|
_dashSpeed = dashSpeed;
|
||||||
|
_dashDuration = dashDuration;
|
||||||
|
_dashCooldown = dashCooldown;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void TickCooldown(float deltaTime)
|
||||||
|
{
|
||||||
|
if (_dashCooldownTimer > 0f) _dashCooldownTimer -= deltaTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RequestDash(bool dashPressed)
|
||||||
|
{
|
||||||
|
if (dashPressed && !_dashRequested && _dashCooldownTimer <= 0f)
|
||||||
|
_dashRequested = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void TryStartDash(KinematicCharacterMotor motor,
|
||||||
|
CameraMode currentCameraMode,
|
||||||
|
Quaternion firstPersonCameraRotation,
|
||||||
|
Vector3 lookInputVector)
|
||||||
|
{
|
||||||
|
if (!_dashRequested || !motor.GroundingStatus.IsStableOnGround || _dashCooldownTimer > 0f)
|
||||||
|
{
|
||||||
|
_dashRequested = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
IsDashing = true;
|
||||||
|
_dashTimer = _dashDuration;
|
||||||
|
|
||||||
|
var dir = currentCameraMode == CameraMode.FirstPerson
|
||||||
|
? firstPersonCameraRotation * Vector3.forward
|
||||||
|
: lookInputVector;
|
||||||
|
|
||||||
|
_dashDirection = Vector3.ProjectOnPlane(dir, motor.CharacterUp).normalized;
|
||||||
|
if (_dashDirection.sqrMagnitude < 0.01f) _dashDirection = motor.CharacterForward;
|
||||||
|
|
||||||
|
_dashCooldownTimer = _dashCooldown;
|
||||||
|
_dashRequested = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void HandleDash(ref Vector3 currentVelocity, float deltaTime, KinematicCharacterMotor motor)
|
||||||
|
{
|
||||||
|
_dashTimer -= deltaTime;
|
||||||
|
if (_dashTimer <= 0f || !motor.GroundingStatus.IsStableOnGround)
|
||||||
|
{
|
||||||
|
EndDash();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
currentVelocity = _dashDirection * _dashSpeed;
|
||||||
|
currentVelocity += motor.CharacterUp * 1.5f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void EndDash()
|
||||||
|
{
|
||||||
|
IsDashing = false;
|
||||||
|
_dashTimer = 0f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6d62efb53e0c4d49be9fc658484e2575
|
||||||
|
timeCreated: 1764856437
|
||||||
+36
-67
@@ -1,122 +1,91 @@
|
|||||||
|
using UnityEngine;
|
||||||
using Code.Gameplay.Camera;
|
using Code.Gameplay.Camera;
|
||||||
using KinematicCharacterController;
|
using KinematicCharacterController;
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace Code.Gameplay.Character.Controller.Abilities
|
namespace Code.Gameplay.Character.Controller.Abilities
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
* Механика слайда для персонажа
|
|
||||||
* Отвечает за управление состоянием, таймерами и скоростью слайда
|
|
||||||
*/
|
|
||||||
public class SlideMechanic
|
public class SlideMechanic
|
||||||
{
|
{
|
||||||
// Скорость слайда
|
private readonly AnimationCurve _velocityCurve;
|
||||||
private readonly float _slideSpeed;
|
private readonly float _minVelocityThreshold;
|
||||||
// Длительность слайда в секундах
|
private readonly float _cooldown;
|
||||||
private readonly float _slideDuration;
|
|
||||||
// Время перезарядки слайда
|
|
||||||
private readonly float _slideCooldown;
|
|
||||||
|
|
||||||
// Таймер слайда
|
private float _slideTime;
|
||||||
private float _slideTimer;
|
private float _cooldownTimer;
|
||||||
// Таймер перезарядки слайда
|
|
||||||
private float _slideCooldownTimer;
|
|
||||||
// Направление слайда
|
|
||||||
private Vector3 _slideDirection;
|
private Vector3 _slideDirection;
|
||||||
// Флаг запроса слайда
|
|
||||||
private bool _slideRequested;
|
private bool _slideRequested;
|
||||||
|
private float _initialSpeed;
|
||||||
|
|
||||||
// Свойство-флаг, активен ли слайд
|
|
||||||
public bool IsSliding { get; private set; }
|
public bool IsSliding { get; private set; }
|
||||||
|
|
||||||
// Конструктор механики слайда
|
public SlideMechanic(AnimationCurve velocityCurve, float minVelocityThreshold, float cooldown)
|
||||||
public SlideMechanic(float slideSpeed, float slideDuration, float slideCooldown)
|
|
||||||
{
|
{
|
||||||
_slideSpeed = slideSpeed;
|
_velocityCurve = velocityCurve;
|
||||||
_slideDuration = slideDuration;
|
_minVelocityThreshold = minVelocityThreshold;
|
||||||
_slideCooldown = slideCooldown;
|
_cooldown = cooldown;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Обновляем таймер перезарядки слайда
|
|
||||||
public void TickCooldown(float deltaTime)
|
public void TickCooldown(float deltaTime)
|
||||||
{
|
{
|
||||||
if (_slideCooldownTimer > 0f)
|
if (_cooldownTimer > 0f) _cooldownTimer -= deltaTime;
|
||||||
{
|
|
||||||
_slideCooldownTimer -= deltaTime;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Обработка слайда
|
|
||||||
public void RequestSlide(bool slidePressed)
|
public void RequestSlide(bool slidePressed)
|
||||||
{
|
{
|
||||||
if (slidePressed && !_slideRequested && _slideCooldownTimer <= 0f)
|
if (slidePressed && !_slideRequested && _cooldownTimer <= 0f)
|
||||||
{
|
|
||||||
_slideRequested = true;
|
_slideRequested = true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Начало слайда
|
|
||||||
public void TryStartSlide(KinematicCharacterMotor motor,
|
public void TryStartSlide(KinematicCharacterMotor motor,
|
||||||
CameraMode currentCameraMode,
|
CameraMode currentCameraMode,
|
||||||
Quaternion firstPersonCameraRotation,
|
Quaternion firstPersonCameraRotation,
|
||||||
Vector3 lookInputVector)
|
Vector3 lookInputVector)
|
||||||
{
|
{
|
||||||
// Проверяем условия для старта слайда
|
if (!_slideRequested || !motor.GroundingStatus.IsStableOnGround || _cooldownTimer > 0f)
|
||||||
if (!_slideRequested || !motor.GroundingStatus.IsStableOnGround || _slideCooldownTimer > 0f)
|
|
||||||
{
|
{
|
||||||
_slideRequested = false;
|
_slideRequested = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
IsSliding = true;
|
IsSliding = true;
|
||||||
_slideTimer = _slideDuration;
|
_slideTime = 0f;
|
||||||
|
|
||||||
// НАПРАВЛЕНИЕ СЛАЙДА - ВСЕГДА ВПЕРЕД ПО КАМЕРЕ
|
var dir = currentCameraMode == CameraMode.FirstPerson
|
||||||
// Используем направление камеры, но проецируем на горизонтальную плоскость
|
? firstPersonCameraRotation * Vector3.forward
|
||||||
var slideDir = currentCameraMode == CameraMode.FirstPerson ?
|
: lookInputVector;
|
||||||
firstPersonCameraRotation * Vector3.forward :
|
|
||||||
lookInputVector;
|
|
||||||
|
|
||||||
// Проецируем на горизонтальную плоскость и нормализуем
|
_slideDirection = Vector3.ProjectOnPlane(dir, motor.CharacterUp).normalized;
|
||||||
_slideDirection = Vector3.ProjectOnPlane(slideDir, motor.CharacterUp).normalized;
|
if (_slideDirection.sqrMagnitude < 0.01f) _slideDirection = motor.CharacterForward;
|
||||||
|
|
||||||
// Если направление нулевое (персонаж стоит на месте), используем направление вперед
|
_initialSpeed = motor.Velocity.magnitude;
|
||||||
if (_slideDirection.sqrMagnitude < 0.01f)
|
if (_initialSpeed < 12f) _initialSpeed = 12f; // fallback
|
||||||
{
|
|
||||||
_slideDirection = motor.CharacterForward;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Устанавливаем перезарядку
|
_cooldownTimer = _cooldown;
|
||||||
_slideCooldownTimer = _slideCooldown;
|
|
||||||
_slideRequested = false;
|
_slideRequested = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Обработка слайда
|
|
||||||
public void HandleSlide(ref Vector3 currentVelocity, float deltaTime, KinematicCharacterMotor motor)
|
public void HandleSlide(ref Vector3 currentVelocity, float deltaTime, KinematicCharacterMotor motor)
|
||||||
{
|
{
|
||||||
// Уменьшаем таймер слайда
|
if (!IsSliding) return;
|
||||||
_slideTimer -= deltaTime;
|
|
||||||
|
|
||||||
// Если время слайда вышло, персонаж в воздухе - заканчиваем слайд
|
_slideTime += deltaTime;
|
||||||
if (_slideTimer <= 0f || !motor.GroundingStatus.IsStableOnGround)
|
|
||||||
{
|
var t = Mathf.Clamp01(_slideTime / 2.5f);
|
||||||
|
var speedMult = _velocityCurve.Evaluate(t);
|
||||||
|
|
||||||
|
var targetSpeed = _initialSpeed * speedMult;
|
||||||
|
currentVelocity = _slideDirection * targetSpeed;
|
||||||
|
|
||||||
|
currentVelocity += motor.CharacterUp * 1f;
|
||||||
|
|
||||||
|
if (targetSpeed < _minVelocityThreshold || !motor.GroundingStatus.IsStableOnGround)
|
||||||
EndSlide();
|
EndSlide();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Устанавливаем скорость слайда вперед
|
|
||||||
// Используем прямую установку скорости вместо сложных вычислений
|
|
||||||
currentVelocity = _slideDirection * _slideSpeed;
|
|
||||||
|
|
||||||
// Добавляем небольшую вертикальную компоненту для лучшего скольжения по неровностям
|
|
||||||
currentVelocity += motor.CharacterUp * 2f;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Завершение слайда
|
|
||||||
public void EndSlide()
|
public void EndSlide()
|
||||||
{
|
{
|
||||||
IsSliding = false;
|
IsSliding = false;
|
||||||
_slideTimer = 0f;
|
_slideTime = 0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+97
-116
@@ -1,4 +1,3 @@
|
|||||||
using Code.Gameplay.Character.Controller.Input;
|
|
||||||
using Code.Gameplay.Character.Core;
|
using Code.Gameplay.Character.Core;
|
||||||
using KinematicCharacterController;
|
using KinematicCharacterController;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@@ -7,14 +6,13 @@ namespace Code.Gameplay.Character.Controller.Abilities
|
|||||||
{
|
{
|
||||||
public class WallRunningMechanic
|
public class WallRunningMechanic
|
||||||
{
|
{
|
||||||
public float MaxWallRunTime = 1.75f;
|
private readonly float _maxWallRunTime;
|
||||||
public float WallRunSpeed = 8.0f;
|
private readonly float _wallRunSpeed;
|
||||||
public float WallRunAcceleration = 25.0f;
|
private readonly float _wallRunAcceleration;
|
||||||
public float WallRunGravityScale = 0.25f;
|
private readonly float _wallRunGravityScale;
|
||||||
public float WallDetachImpulse = 7.0f;
|
private readonly float _wallDetachImpulse;
|
||||||
public float WallContactAngleThreshold = 45.0f;
|
private readonly float _wallContactAngleThreshold;
|
||||||
|
|
||||||
private bool _isWallRunning;
|
|
||||||
private float _wallRunTimer;
|
private float _wallRunTimer;
|
||||||
private Vector3 _wallNormal;
|
private Vector3 _wallNormal;
|
||||||
private Vector3 _wallTangentRight;
|
private Vector3 _wallTangentRight;
|
||||||
@@ -24,53 +22,56 @@ namespace Code.Gameplay.Character.Controller.Abilities
|
|||||||
|
|
||||||
private float _surfaceAngleCos;
|
private float _surfaceAngleCos;
|
||||||
private bool _canWallRun;
|
private bool _canWallRun;
|
||||||
public float WallContactHeight { get; private set; }
|
|
||||||
|
|
||||||
public Vector3 WallRunStartForward { get; private set; }
|
|
||||||
|
|
||||||
private KinematicCharacterMotor _motor;
|
private KinematicCharacterMotor _motor;
|
||||||
private CharacterInputHandler _inputHandler;
|
|
||||||
|
|
||||||
public bool IsWallRunning => _isWallRunning;
|
public bool IsWallRunning { get; private set; }
|
||||||
|
|
||||||
public void Initialize(KinematicCharacterMotor motor, CharacterInputHandler inputHandler)
|
public WallRunningMechanic(
|
||||||
|
float maxWallRunTime,
|
||||||
|
float wallRunSpeed,
|
||||||
|
float wallRunAcceleration,
|
||||||
|
float wallRunGravityScale,
|
||||||
|
float wallDetachImpulse,
|
||||||
|
float wallContactAngleThreshold)
|
||||||
{
|
{
|
||||||
_motor = motor;
|
_maxWallRunTime = maxWallRunTime;
|
||||||
_inputHandler = inputHandler;
|
_wallRunSpeed = wallRunSpeed;
|
||||||
_surfaceAngleCos = Mathf.Cos(Mathf.Deg2Rad * WallContactAngleThreshold);
|
_wallRunAcceleration = wallRunAcceleration;
|
||||||
|
_wallRunGravityScale = wallRunGravityScale;
|
||||||
|
_wallDetachImpulse = wallDetachImpulse;
|
||||||
|
_wallContactAngleThreshold = wallContactAngleThreshold;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Reset()
|
public void Initialize(KinematicCharacterMotor motor)
|
||||||
{
|
{
|
||||||
_isWallRunning = false;
|
_motor = motor;
|
||||||
_wallRunTimer = 0f;
|
_surfaceAngleCos = Mathf.Cos(Mathf.Deg2Rad * _wallContactAngleThreshold);
|
||||||
_wallNormal = Vector3.zero;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Tick(float deltaTime)
|
public void Tick(float deltaTime)
|
||||||
{
|
{
|
||||||
if (_isWallRunning)
|
if (!IsWallRunning) return;
|
||||||
{
|
|
||||||
_wallRunTimer += deltaTime;
|
_wallRunTimer += deltaTime;
|
||||||
if (_wallRunTimer > MaxWallRunTime)
|
if (_wallRunTimer > _maxWallRunTime)
|
||||||
{
|
{
|
||||||
DetachFromWall(false);
|
DetachFromWall(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public bool TryStartWallRun(Vector3 hitNormal, Vector3 hitPoint)
|
public bool TryStartWallRun(Vector3 hitNormal, Vector3 hitPoint)
|
||||||
{
|
{
|
||||||
if (_isWallRunning) return false;
|
if (IsWallRunning) return false;
|
||||||
|
|
||||||
float dotWithUp = Vector3.Dot(hitNormal, _motor.CharacterUp);
|
var dotWithUp = Vector3.Dot(hitNormal, _motor.CharacterUp);
|
||||||
bool isWall = Mathf.Abs(dotWithUp) < _surfaceAngleCos;
|
var isWall = Mathf.Abs(dotWithUp) < _surfaceAngleCos;
|
||||||
|
|
||||||
if (!isWall) return false;
|
if (!isWall) return false;
|
||||||
|
|
||||||
if (_motor.GroundingStatus.IsStableOnGround) return false;
|
if (_motor.GroundingStatus.IsStableOnGround) return false;
|
||||||
|
|
||||||
float velocityIntoWall = Vector3.Dot(_motor.Velocity, -hitNormal);
|
var velocityIntoWall = Vector3.Dot(_motor.Velocity, -hitNormal);
|
||||||
if (velocityIntoWall < 1f) return false;
|
if (velocityIntoWall < 1f) return false;
|
||||||
|
|
||||||
StartWallRun(hitNormal, hitPoint);
|
StartWallRun(hitNormal, hitPoint);
|
||||||
@@ -79,57 +80,58 @@ namespace Code.Gameplay.Character.Controller.Abilities
|
|||||||
|
|
||||||
private void StartWallRun(Vector3 wallNormal, Vector3 contactPoint)
|
private void StartWallRun(Vector3 wallNormal, Vector3 contactPoint)
|
||||||
{
|
{
|
||||||
_isWallRunning = true;
|
IsWallRunning = true;
|
||||||
_wallRunTimer = 0f;
|
_wallRunTimer = 0f;
|
||||||
_wallNormal = wallNormal.normalized;
|
_wallNormal = wallNormal.normalized;
|
||||||
_wallContactPoint = contactPoint;
|
_wallContactPoint = contactPoint;
|
||||||
WallContactHeight = contactPoint.y;
|
|
||||||
|
|
||||||
//_wallTangentUp = Vector3.ProjectOnPlane(_motor.CharacterUp, _wallNormal).normalized;
|
var forwardInWallPlane = Vector3.ProjectOnPlane(_motor.CharacterForward, _wallNormal).normalized;
|
||||||
if (_wallTangentUp.sqrMagnitude < 0.01f) _wallTangentUp = Vector3.up;
|
if (forwardInWallPlane.sqrMagnitude < 0.01f)
|
||||||
|
{
|
||||||
|
var candidateRight = Vector3.Cross(_wallNormal, _motor.CharacterUp);
|
||||||
|
candidateRight = Vector3.ProjectOnPlane(candidateRight, _wallNormal).normalized;
|
||||||
|
|
||||||
_wallTangentRight = Vector3.Cross(_wallNormal, _wallTangentUp).normalized;
|
if (candidateRight.sqrMagnitude < 0.01f)
|
||||||
|
{
|
||||||
|
candidateRight = Vector3.Cross(_wallNormal, Vector3.up);
|
||||||
|
candidateRight = Vector3.ProjectOnPlane(candidateRight, _wallNormal).normalized;
|
||||||
|
}
|
||||||
|
|
||||||
_wallTangentUp = Vector3.Cross(_wallTangentRight, _wallNormal).normalized;
|
if (candidateRight.sqrMagnitude < 0.01f)
|
||||||
if (Vector3.Dot(_wallTangentUp, Vector3.up) < 0)
|
{
|
||||||
_wallTangentUp = -_wallTangentUp;
|
candidateRight = Vector3.Cross(_wallNormal, Vector3.right).normalized;
|
||||||
|
}
|
||||||
|
|
||||||
|
var dotWithRight = Vector3.Dot(_motor.CharacterRight, _wallNormal);
|
||||||
|
forwardInWallPlane = dotWithRight < 0 ? candidateRight : -candidateRight;
|
||||||
|
}
|
||||||
|
|
||||||
|
_wallTangentRight = forwardInWallPlane.normalized;
|
||||||
|
_wallTangentUp = Vector3.Cross(_wallTangentRight, -_wallNormal).normalized;
|
||||||
|
|
||||||
WallRunStartForward = _motor.CharacterForward;
|
|
||||||
_motor.ForceUnground();
|
_motor.ForceUnground();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void HandleWallRun(ref Vector3 currentVelocity, CharacterInputs inputs, float deltaTime)
|
public void HandleWallRun(ref Vector3 currentVelocity, CharacterInputs inputs, float deltaTime)
|
||||||
{
|
{
|
||||||
if (!_isWallRunning) return;
|
if (!IsWallRunning) return;
|
||||||
if (!IsWallStillPresent()) { DetachFromWall(false); return; }
|
if (!IsWallStillPresent()) { DetachFromWall(false); return; }
|
||||||
|
|
||||||
Vector3 moveInputWorld = _inputHandler.MoveInputVector;
|
var forwardInput = inputs.MoveAxisForward;
|
||||||
Vector3 moveInWallPlane = Vector3.ProjectOnPlane(moveInputWorld, _wallNormal);
|
var moveDirection = _wallTangentRight * forwardInput;
|
||||||
|
|
||||||
Vector3 wsMove = Vector3.Project(moveInWallPlane, _wallTangentRight);
|
var targetSpeed = moveDirection.sqrMagnitude > 0.01f ? _wallRunSpeed : currentVelocity.magnitude;
|
||||||
|
var targetVelocity = moveDirection.normalized * targetSpeed;
|
||||||
float ad = inputs.MoveAxisRight;
|
|
||||||
|
|
||||||
float sideDot = Vector3.Dot(_wallNormal, _motor.CharacterRight);
|
|
||||||
if (sideDot < 0)
|
|
||||||
ad = -ad;
|
|
||||||
|
|
||||||
Vector3 adMove = _wallTangentUp * (-ad);
|
|
||||||
|
|
||||||
Vector3 finalMove = wsMove + adMove;
|
|
||||||
finalMove = finalMove.normalized * moveInputWorld.magnitude;
|
|
||||||
|
|
||||||
Vector3 targetVelocity = finalMove * WallRunSpeed;
|
|
||||||
|
|
||||||
currentVelocity = Vector3.Lerp(
|
currentVelocity = Vector3.Lerp(
|
||||||
currentVelocity,
|
currentVelocity,
|
||||||
targetVelocity,
|
targetVelocity,
|
||||||
1f - Mathf.Exp(-WallRunAcceleration * deltaTime)
|
1f - Mathf.Exp(-_wallRunAcceleration * deltaTime)
|
||||||
);
|
);
|
||||||
|
|
||||||
currentVelocity += Physics.gravity * (WallRunGravityScale * deltaTime);
|
currentVelocity += Physics.gravity * (_wallRunGravityScale * deltaTime);
|
||||||
|
|
||||||
float distanceToWall = Vector3.Dot(_motor.TransientPosition - _wallContactPoint, _wallNormal);
|
var distanceToWall = Vector3.Dot(_motor.TransientPosition - _wallContactPoint, _wallNormal);
|
||||||
if (Mathf.Abs(distanceToWall) > 0.8f)
|
if (Mathf.Abs(distanceToWall) > 0.8f)
|
||||||
{
|
{
|
||||||
DetachFromWall(false);
|
DetachFromWall(false);
|
||||||
@@ -144,16 +146,17 @@ namespace Code.Gameplay.Character.Controller.Abilities
|
|||||||
|
|
||||||
private bool IsWallStillPresent()
|
private bool IsWallStillPresent()
|
||||||
{
|
{
|
||||||
if (_motor == null) return false;
|
if (!_motor) return false;
|
||||||
|
|
||||||
Vector3 characterCenter = _motor.TransientPosition;
|
if (_motor.GroundingStatus.IsStableOnGround) return false;
|
||||||
Vector3 characterForward = _motor.CharacterForward;
|
|
||||||
Vector3 characterRight = _motor.CharacterRight;
|
|
||||||
Vector3 characterUp = _motor.CharacterUp;
|
|
||||||
|
|
||||||
float checkDistance = 0.45f;
|
var characterCenter = _motor.TransientPosition;
|
||||||
Vector3 rayOrigin = characterCenter + characterUp * 0.2f;
|
var characterRight = _motor.CharacterRight;
|
||||||
Vector3 rayDir = -_wallNormal;
|
var characterUp = _motor.CharacterUp;
|
||||||
|
|
||||||
|
const float checkDistance = 0.45f;
|
||||||
|
var rayOrigin = characterCenter + characterUp * 0.2f;
|
||||||
|
var rayDir = -_wallNormal;
|
||||||
|
|
||||||
Vector3[] offsets = {
|
Vector3[] offsets = {
|
||||||
Vector3.zero,
|
Vector3.zero,
|
||||||
@@ -165,92 +168,70 @@ namespace Code.Gameplay.Character.Controller.Abilities
|
|||||||
|
|
||||||
foreach (var offset in offsets)
|
foreach (var offset in offsets)
|
||||||
{
|
{
|
||||||
if (Physics.Raycast(rayOrigin + offset, rayDir, out RaycastHit hit, checkDistance,
|
if (!Physics.Raycast(rayOrigin + offset, rayDir, out var hit, checkDistance,
|
||||||
_motor.CollidableLayers, QueryTriggerInteraction.Ignore))
|
_motor.CollidableLayers, QueryTriggerInteraction.Ignore)) continue;
|
||||||
{
|
|
||||||
float dotWithUp = Mathf.Abs(Vector3.Dot(hit.normal, characterUp));
|
var dotWithUp = Mathf.Abs(Vector3.Dot(hit.normal, characterUp));
|
||||||
if (dotWithUp < _surfaceAngleCos)
|
|
||||||
{
|
if (!(dotWithUp < _surfaceAngleCos)) continue;
|
||||||
|
|
||||||
_wallNormal = hit.normal.normalized;
|
_wallNormal = hit.normal.normalized;
|
||||||
_wallContactPoint = hit.point;
|
_wallContactPoint = hit.point;
|
||||||
|
|
||||||
/*_wallTangentUp = Vector3.ProjectOnPlane(_motor.CharacterUp, _wallNormal).normalized;
|
|
||||||
if (_wallTangentUp.sqrMagnitude < 0.01f) _wallTangentUp = Vector3.up;
|
|
||||||
_wallTangentRight = Vector3.Cross(_wallNormal, _wallTangentUp).normalized;
|
|
||||||
*/
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DetachFromWall(bool withImpulse)
|
private void DetachFromWall(bool withImpulse)
|
||||||
{
|
{
|
||||||
if (!_isWallRunning) return;
|
if (!IsWallRunning) return;
|
||||||
|
|
||||||
_isWallRunning = false;
|
IsWallRunning = false;
|
||||||
|
|
||||||
if (withImpulse && _motor != null)
|
if (!withImpulse || !_motor) return;
|
||||||
{
|
|
||||||
Vector3 detachImpulse = -_wallNormal * WallDetachImpulse;
|
var detachImpulse = -_wallNormal * _wallDetachImpulse;
|
||||||
_motor.BaseVelocity += detachImpulse;
|
_motor.BaseVelocity += detachImpulse;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public Vector3 GetWallNormal() => _wallNormal;
|
public Vector3 GetWallNormal() => _wallNormal;
|
||||||
public bool TryGetWallTangents(out Vector3 up, out Vector3 right)
|
|
||||||
{
|
|
||||||
if (!_isWallRunning)
|
|
||||||
{
|
|
||||||
up = right = Vector3.zero;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
up = _wallTangentUp;
|
|
||||||
right = _wallTangentRight;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool CanWallRun()
|
|
||||||
{
|
|
||||||
return !_isWallRunning && !_motor.GroundingStatus.IsStableOnGround;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void PerformWallJump(CharacterInputs inputs, Quaternion cameraRotation)
|
public void PerformWallJump(CharacterInputs inputs, Quaternion cameraRotation)
|
||||||
{
|
{
|
||||||
if (!_isWallRunning || _motor == null) return;
|
if (!IsWallRunning || !_motor) return;
|
||||||
|
|
||||||
_isWallRunning = false;
|
if (_motor.CharacterController is not CustomCharacterController { CanJump: true } controller)
|
||||||
|
return;
|
||||||
|
|
||||||
Vector3 wallAway = _wallNormal;
|
IsWallRunning = false;
|
||||||
Vector3 wallUp = _wallTangentUp;
|
|
||||||
|
|
||||||
Vector3 playerForward = cameraRotation * Vector3.forward;
|
var wallAway = _wallNormal;
|
||||||
|
var wallUp = Vector3.ProjectOnPlane(_motor.CharacterUp, _wallNormal).normalized;
|
||||||
|
|
||||||
Vector3 forwardInWallPlane = Vector3.ProjectOnPlane(playerForward, _wallNormal).normalized;
|
var playerForward = cameraRotation * Vector3.forward;
|
||||||
|
|
||||||
|
var forwardInWallPlane = Vector3.ProjectOnPlane(playerForward, _wallNormal).normalized;
|
||||||
if (forwardInWallPlane.sqrMagnitude < 0.01f) forwardInWallPlane = _wallTangentRight;
|
if (forwardInWallPlane.sqrMagnitude < 0.01f) forwardInWallPlane = _wallTangentRight;
|
||||||
|
|
||||||
Vector3 jumpDirection =
|
var jumpDirection =
|
||||||
forwardInWallPlane * 0.2f +
|
forwardInWallPlane * 0.2f +
|
||||||
wallAway * 0.4f +
|
wallAway * 0.6f +
|
||||||
wallUp * 0.4f;
|
wallUp * 0.2f;
|
||||||
|
|
||||||
jumpDirection = jumpDirection.normalized;
|
jumpDirection = jumpDirection.normalized;
|
||||||
|
|
||||||
float wallJumpForce = WallDetachImpulse * 2f;
|
var wallJumpForce = _wallDetachImpulse * 2f;
|
||||||
|
|
||||||
Vector3 jumpImpulse = jumpDirection * wallJumpForce;
|
var jumpImpulse = jumpDirection * wallJumpForce;
|
||||||
|
|
||||||
_motor.BaseVelocity += jumpImpulse;
|
_motor.BaseVelocity += jumpImpulse;
|
||||||
|
|
||||||
_motor.SetPosition(_motor.TransientPosition + wallAway * 0.07f);
|
_motor.SetPosition(_motor.TransientPosition + wallAway * 0.07f);
|
||||||
|
|
||||||
if (_motor.CharacterController is CustomCharacterController controller)
|
controller.TriggerJump();
|
||||||
{
|
|
||||||
controller.BlockAbilities(0.12f);
|
controller.BlockAbilities(0.12f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
+205
-40
@@ -25,8 +25,28 @@ namespace Code.Gameplay.Character.Controller
|
|||||||
|
|
||||||
[SerializeField] private Transform characterTransform; // Трансформ персонажа (с точкой отслеживания камеры)
|
[SerializeField] private Transform characterTransform; // Трансформ персонажа (с точкой отслеживания камеры)
|
||||||
|
|
||||||
|
[SerializeField] private CapsuleCollider _capsuleCollider;
|
||||||
|
[SerializeField] private Transform _cameraFollowPoint;
|
||||||
|
private Vector3 _originalColliderCenter;
|
||||||
|
private float _originalColliderHeight;
|
||||||
|
private Vector3 _originalFollowPointLocalPosition;
|
||||||
|
private bool _isEnteringSlide;
|
||||||
|
private bool _isExitingSlide;
|
||||||
|
private float _slideTransitionTime;
|
||||||
|
private float _slideTransitionDuration;
|
||||||
|
private float _currentColliderHeight;
|
||||||
|
private Vector3 _currentColliderCenter;
|
||||||
|
private Vector3 _currentFollowPointLocalPosition;
|
||||||
|
private bool _wasSlidingLastFrame;
|
||||||
|
|
||||||
|
private float _jumpCooldownTimer;
|
||||||
|
private float _jumpCooldownDuration => _characterConfig.jumpCooldown;
|
||||||
|
|
||||||
|
public bool CanJump => !isAbilitiesBlocked && _jumpCooldownTimer <= 0f;
|
||||||
|
|
||||||
// Подсистемы
|
// Подсистемы
|
||||||
private CharacterInputHandler _inputHandler;
|
private CharacterInputHandler _inputHandler;
|
||||||
|
private DashMechanic _dashMechanic;
|
||||||
private SlideMechanic _slideMechanic;
|
private SlideMechanic _slideMechanic;
|
||||||
// private WallClimbMechanic _wallClimbMechanic;
|
// private WallClimbMechanic _wallClimbMechanic;
|
||||||
private WallRunningMechanic _wallRunningMechanic;
|
private WallRunningMechanic _wallRunningMechanic;
|
||||||
@@ -35,6 +55,7 @@ namespace Code.Gameplay.Character.Controller
|
|||||||
private AirMovementSystem _airMovement;
|
private AirMovementSystem _airMovement;
|
||||||
|
|
||||||
public bool IsSliding => _slideMechanic.IsSliding;
|
public bool IsSliding => _slideMechanic.IsSliding;
|
||||||
|
public bool IsDashing => _dashMechanic.IsDashing;
|
||||||
public bool IsWallRunning => _wallRunningMechanic.IsWallRunning;
|
public bool IsWallRunning => _wallRunningMechanic.IsWallRunning;
|
||||||
|
|
||||||
private float abilityBlockTimer;
|
private float abilityBlockTimer;
|
||||||
@@ -50,28 +71,25 @@ namespace Code.Gameplay.Character.Controller
|
|||||||
{
|
{
|
||||||
_characterConfig = characterConfig;
|
_characterConfig = characterConfig;
|
||||||
// Инициализация подсистем с параметрами из конфига
|
// Инициализация подсистем с параметрами из конфига
|
||||||
_inputHandler = new CharacterInputHandler(
|
_inputHandler = new CharacterInputHandler();
|
||||||
_characterConfig.sprintAngleThreshold
|
_dashMechanic = new DashMechanic(
|
||||||
|
_characterConfig.dashSpeed,
|
||||||
|
_characterConfig.dashDuration,
|
||||||
|
_characterConfig.dashCooldown
|
||||||
);
|
);
|
||||||
_slideMechanic = new SlideMechanic(
|
_slideMechanic = new SlideMechanic(
|
||||||
_characterConfig.slideSpeed,
|
_characterConfig.slideVelocityCurve,
|
||||||
_characterConfig.slideDuration,
|
_characterConfig.slideMinVelocityThreshold,
|
||||||
_characterConfig.slideCooldown
|
_characterConfig.slideCooldown
|
||||||
);
|
);
|
||||||
// _wallClimbMechanic = new WallClimbMechanic(
|
_wallRunningMechanic = new WallRunningMechanic(
|
||||||
// _characterConfig.wallClimbSpeedFactor,
|
_characterConfig.wallRunMaxTime,
|
||||||
// _characterConfig.minWallClimbSpeed,
|
_characterConfig.wallRunSpeed,
|
||||||
// _characterConfig.wallDetectionAngleThreshold
|
_characterConfig.wallRunAcceleration,
|
||||||
// );
|
_characterConfig.wallRunGravityScale,
|
||||||
_wallRunningMechanic = new WallRunningMechanic();
|
_characterConfig.wallDetachImpulse,
|
||||||
// Настройка параметров WallRunningMechanic (можно вынести в конфиг позже)
|
_characterConfig.wallContactAngleThreshold
|
||||||
_wallRunningMechanic.MaxWallRunTime = 1.75f;
|
);
|
||||||
_wallRunningMechanic.WallRunSpeed = 15.0f;
|
|
||||||
_wallRunningMechanic.WallRunAcceleration = 25.0f;
|
|
||||||
_wallRunningMechanic.WallRunGravityScale = 0.25f;
|
|
||||||
_wallRunningMechanic.WallDetachImpulse = 7.0f;
|
|
||||||
_wallRunningMechanic.WallContactAngleThreshold = 45.0f;
|
|
||||||
|
|
||||||
_wallLeanMechanic = new WallLeanMechanic(
|
_wallLeanMechanic = new WallLeanMechanic(
|
||||||
_characterConfig.leanAngle,
|
_characterConfig.leanAngle,
|
||||||
_characterConfig.leanThreshold,
|
_characterConfig.leanThreshold,
|
||||||
@@ -79,18 +97,28 @@ namespace Code.Gameplay.Character.Controller
|
|||||||
);
|
);
|
||||||
_groundMovement = new GroundMovementSystem(
|
_groundMovement = new GroundMovementSystem(
|
||||||
_characterConfig.maxStableMoveSpeed,
|
_characterConfig.maxStableMoveSpeed,
|
||||||
_characterConfig.sprintMoveSpeed,
|
|
||||||
_characterConfig.stableMovementSharpness,
|
_characterConfig.stableMovementSharpness,
|
||||||
_characterConfig.jumpSpeed
|
_characterConfig.jumpSpeed
|
||||||
);
|
);
|
||||||
_airMovement = new AirMovementSystem(_characterConfig.gravity);
|
_airMovement = new AirMovementSystem(
|
||||||
|
_characterConfig.gravity,
|
||||||
|
_characterConfig.maxAirSpeed,
|
||||||
|
_characterConfig.airControlSharpness
|
||||||
|
);
|
||||||
|
|
||||||
motor.CharacterController = this; // Регистрация этого контроллера в движке
|
motor.CharacterController = this; // Регистрация этого контроллера в движке
|
||||||
_inputHandler.FirstPersonCameraRotation =
|
_inputHandler.FirstPersonCameraRotation =
|
||||||
motor.Transform.rotation; // Начальное вращение совпадает с персонажемс
|
motor.Transform.rotation; // Начальное вращение совпадает с персонажемс
|
||||||
_wallLeanMechanic.SetModel(characterTransform);
|
_wallLeanMechanic.SetModel(characterTransform);
|
||||||
_wallRunningMechanic.Initialize(motor, _inputHandler);
|
_wallRunningMechanic.Initialize(motor);
|
||||||
|
|
||||||
|
_originalColliderCenter = _capsuleCollider.center;
|
||||||
|
_originalColliderHeight = _capsuleCollider.height;
|
||||||
|
_originalFollowPointLocalPosition = _cameraFollowPoint.localPosition;
|
||||||
|
|
||||||
|
_currentColliderHeight = _originalColliderHeight;
|
||||||
|
_currentColliderCenter = _originalColliderCenter;
|
||||||
|
_currentFollowPointLocalPosition = _originalFollowPointLocalPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Текущий режим камеры для адаптации поведения
|
// Текущий режим камеры для адаптации поведения
|
||||||
@@ -99,17 +127,15 @@ namespace Code.Gameplay.Character.Controller
|
|||||||
public void SetInputs(ref CharacterInputs inputs)
|
public void SetInputs(ref CharacterInputs inputs)
|
||||||
{
|
{
|
||||||
_lastInputs = inputs;
|
_lastInputs = inputs;
|
||||||
// Обновляем таймеры механик
|
_dashMechanic.TickCooldown(Time.deltaTime);
|
||||||
_slideMechanic.TickCooldown(Time.deltaTime);
|
_slideMechanic.TickCooldown(Time.deltaTime);
|
||||||
// _wallClimbMechanic.TickCooldown(Time.deltaTime);
|
|
||||||
_wallRunningMechanic.Tick(Time.deltaTime);
|
_wallRunningMechanic.Tick(Time.deltaTime);
|
||||||
|
|
||||||
// Если активен слайд - игнорируем весь остальной ввод
|
// Если активен слайд - игнорируем весь остальной ввод
|
||||||
if (_slideMechanic.IsSliding)
|
if (_dashMechanic.IsDashing || _slideMechanic.IsSliding)
|
||||||
{
|
{
|
||||||
_inputHandler.MoveInputVector = Vector3.zero;
|
_inputHandler.MoveInputVector = Vector3.zero;
|
||||||
_inputHandler.LookInputVector = Vector3.one;
|
_inputHandler.LookInputVector = Vector3.one;
|
||||||
_inputHandler.IsSprinting = false;
|
|
||||||
_groundMovement.RequestJump(inputs.JumpPressed);
|
_groundMovement.RequestJump(inputs.JumpPressed);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -125,19 +151,28 @@ namespace Code.Gameplay.Character.Controller
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
inputs.SprintPressed = false;
|
inputs.DashPressed = false;
|
||||||
inputs.SlidePressed = false;
|
inputs.SlidePressed = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Обработка слайда
|
_dashMechanic.RequestDash(inputs.DashPressed);
|
||||||
_slideMechanic.RequestSlide(inputs.SlidePressed);
|
_slideMechanic.RequestSlide(inputs.SlidePressed);
|
||||||
|
|
||||||
// Обработка остального ввода
|
// Обработка остального ввода
|
||||||
_inputHandler.ProcessInputs(ref inputs, motor);
|
_inputHandler.ProcessInputs(ref inputs, motor);
|
||||||
|
|
||||||
// Передаём запрос прыжка
|
// Передаём запрос прыжка
|
||||||
_groundMovement.RequestJump(inputs.JumpPressed);
|
var jumpInput = inputs.JumpPressed;
|
||||||
|
|
||||||
|
if (jumpInput && CanJump)
|
||||||
|
{
|
||||||
|
_groundMovement.RequestJump(true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_groundMovement.RequestJump(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateRotation(ref Quaternion currentRotation, float deltaTime)
|
public void UpdateRotation(ref Quaternion currentRotation, float deltaTime)
|
||||||
@@ -172,22 +207,45 @@ namespace Code.Gameplay.Character.Controller
|
|||||||
|
|
||||||
public void UpdateVelocity(ref Vector3 currentVelocity, float deltaTime)
|
public void UpdateVelocity(ref Vector3 currentVelocity, float deltaTime)
|
||||||
{
|
{
|
||||||
|
if (_dashMechanic.IsDashing && _groundMovement.JumpRequested)
|
||||||
|
_dashMechanic.EndDash();
|
||||||
if (_slideMechanic.IsSliding && _groundMovement.JumpRequested)
|
if (_slideMechanic.IsSliding && _groundMovement.JumpRequested)
|
||||||
{
|
|
||||||
_slideMechanic.EndSlide();
|
_slideMechanic.EndSlide();
|
||||||
}
|
|
||||||
|
|
||||||
if (!_slideMechanic.IsSliding)
|
if (!_dashMechanic.IsDashing)
|
||||||
{
|
_dashMechanic.TryStartDash(motor, _currentCameraMode, _inputHandler.FirstPersonCameraRotation, _inputHandler.LookInputVector);
|
||||||
_slideMechanic.TryStartSlide(motor, _currentCameraMode, _inputHandler.FirstPersonCameraRotation,
|
|
||||||
_inputHandler.LookInputVector);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_slideMechanic.HandleSlide(ref currentVelocity, deltaTime, motor);
|
_dashMechanic.HandleDash(ref currentVelocity, deltaTime, motor);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var wasSliding = _wasSlidingLastFrame;
|
||||||
|
var isSlidingNow = _slideMechanic.IsSliding;
|
||||||
|
|
||||||
|
if (!isSlidingNow)
|
||||||
|
{
|
||||||
|
_slideMechanic.TryStartSlide(motor, _currentCameraMode, _inputHandler.FirstPersonCameraRotation, _inputHandler.LookInputVector);
|
||||||
|
isSlidingNow = _slideMechanic.IsSliding;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (isSlidingNow)
|
||||||
|
{
|
||||||
|
case true when !wasSliding:
|
||||||
|
EnterSlideState();
|
||||||
|
break;
|
||||||
|
case false when wasSliding:
|
||||||
|
ExitSlideState();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isSlidingNow)
|
||||||
|
{
|
||||||
|
_slideMechanic.HandleSlide(ref currentVelocity, deltaTime, motor);
|
||||||
|
}
|
||||||
|
|
||||||
|
_wasSlidingLastFrame = isSlidingNow;
|
||||||
|
|
||||||
// === WALL RUNNING: обработка состояния ===
|
// === WALL RUNNING: обработка состояния ===
|
||||||
if (_wallRunningMechanic.IsWallRunning)
|
if (_wallRunningMechanic.IsWallRunning)
|
||||||
{
|
{
|
||||||
@@ -212,7 +270,7 @@ namespace Code.Gameplay.Character.Controller
|
|||||||
// Если персонаж не на земле — стандартное воздушное движение
|
// Если персонаж не на земле — стандартное воздушное движение
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_airMovement.UpdateVelocity(ref currentVelocity, deltaTime);
|
_airMovement.UpdateVelocity(ref currentVelocity, _inputHandler, motor, deltaTime);
|
||||||
_groundMovement.CancelJumpRequest();
|
_groundMovement.CancelJumpRequest();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -223,20 +281,127 @@ namespace Code.Gameplay.Character.Controller
|
|||||||
abilityBlockTimer = duration;
|
abilityBlockTimer = duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void EnterSlideState()
|
||||||
|
{
|
||||||
|
_isEnteringSlide = true;
|
||||||
|
_isExitingSlide = false;
|
||||||
|
_slideTransitionTime = 0f;
|
||||||
|
_slideTransitionDuration = _characterConfig.slideEnterDuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ExitSlideState()
|
||||||
|
{
|
||||||
|
_isExitingSlide = true;
|
||||||
|
_isEnteringSlide = false;
|
||||||
|
_slideTransitionTime = 0f;
|
||||||
|
_slideTransitionDuration = _characterConfig.slideExitDuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateSlideTransition(float deltaTime)
|
||||||
|
{
|
||||||
|
if (!_isEnteringSlide && !_isExitingSlide) return;
|
||||||
|
|
||||||
|
_slideTransitionTime += deltaTime;
|
||||||
|
var t = Mathf.Clamp01(_slideTransitionTime / _slideTransitionDuration);
|
||||||
|
|
||||||
|
t = Mathf.SmoothStep(0f, 1f, t);
|
||||||
|
|
||||||
|
if (_isEnteringSlide)
|
||||||
|
{
|
||||||
|
var targetHeight = _originalColliderHeight * _characterConfig.slideColliderHeightScale;
|
||||||
|
var targetCenterY = targetHeight * 0.5f - _originalColliderHeight * 0.5f;
|
||||||
|
var targetCenter = _originalColliderCenter + Vector3.up * targetCenterY;
|
||||||
|
|
||||||
|
var targetFollowPos = _originalFollowPointLocalPosition + Vector3.up * _characterConfig.slideCameraOffsetY;
|
||||||
|
|
||||||
|
_currentColliderHeight = Mathf.Lerp(_originalColliderHeight, targetHeight, t);
|
||||||
|
_currentColliderCenter = Vector3.Lerp(_originalColliderCenter, targetCenter, t);
|
||||||
|
_currentFollowPointLocalPosition = Vector3.Lerp(_originalFollowPointLocalPosition, targetFollowPos, t);
|
||||||
|
}
|
||||||
|
else if (_isExitingSlide)
|
||||||
|
{
|
||||||
|
_currentColliderHeight = Mathf.Lerp(_originalColliderHeight * _characterConfig.slideColliderHeightScale, _originalColliderHeight, t);
|
||||||
|
|
||||||
|
var prevHeight = _originalColliderHeight * _characterConfig.slideColliderHeightScale;
|
||||||
|
var prevCenterY = prevHeight * 0.5f - _originalColliderHeight * 0.5f;
|
||||||
|
var prevCenter = _originalColliderCenter + Vector3.up * prevCenterY;
|
||||||
|
|
||||||
|
var prevFollowPos = _originalFollowPointLocalPosition + Vector3.up * _characterConfig.slideCameraOffsetY;
|
||||||
|
|
||||||
|
_currentColliderCenter = Vector3.Lerp(prevCenter, _originalColliderCenter, t);
|
||||||
|
_currentFollowPointLocalPosition = Vector3.Lerp(prevFollowPos, _originalFollowPointLocalPosition, t);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_capsuleCollider)
|
||||||
|
{
|
||||||
|
_capsuleCollider.height = _currentColliderHeight;
|
||||||
|
_capsuleCollider.center = _currentColliderCenter;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_cameraFollowPoint)
|
||||||
|
{
|
||||||
|
_cameraFollowPoint.localPosition = _currentFollowPointLocalPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(t >= 1f)) return;
|
||||||
|
|
||||||
|
if (_isEnteringSlide)
|
||||||
|
{
|
||||||
|
_isEnteringSlide = false;
|
||||||
|
if (_capsuleCollider)
|
||||||
|
{
|
||||||
|
_capsuleCollider.height = _originalColliderHeight * _characterConfig.slideColliderHeightScale;
|
||||||
|
var h = _capsuleCollider.height;
|
||||||
|
_capsuleCollider.center = _originalColliderCenter + Vector3.up * (h * 0.5f - _originalColliderHeight * 0.5f);
|
||||||
|
}
|
||||||
|
if (_cameraFollowPoint)
|
||||||
|
{
|
||||||
|
_cameraFollowPoint.localPosition = _originalFollowPointLocalPosition + Vector3.up * _characterConfig.slideCameraOffsetY;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (_isExitingSlide)
|
||||||
|
{
|
||||||
|
_isExitingSlide = false;
|
||||||
|
if (_capsuleCollider)
|
||||||
|
{
|
||||||
|
_capsuleCollider.height = _originalColliderHeight;
|
||||||
|
_capsuleCollider.center = _originalColliderCenter;
|
||||||
|
}
|
||||||
|
if (_cameraFollowPoint)
|
||||||
|
{
|
||||||
|
_cameraFollowPoint.localPosition = _originalFollowPointLocalPosition;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_currentColliderHeight = _capsuleCollider ? _capsuleCollider.height : _originalColliderHeight;
|
||||||
|
_currentColliderCenter = _capsuleCollider ? _capsuleCollider.center : _originalColliderCenter;
|
||||||
|
_currentFollowPointLocalPosition = _cameraFollowPoint ? _cameraFollowPoint.localPosition : _originalFollowPointLocalPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void TriggerJump()
|
||||||
|
{
|
||||||
|
_jumpCooldownTimer = _jumpCooldownDuration;
|
||||||
|
}
|
||||||
|
|
||||||
public void BeforeCharacterUpdate(float deltaTime)
|
public void BeforeCharacterUpdate(float deltaTime)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PostGroundingUpdate(float deltaTime)
|
public void PostGroundingUpdate(float deltaTime)
|
||||||
{
|
{
|
||||||
|
if (_dashMechanic.IsDashing && !motor.GroundingStatus.IsStableOnGround)
|
||||||
|
_dashMechanic.EndDash();
|
||||||
if (_slideMechanic.IsSliding && !motor.GroundingStatus.IsStableOnGround)
|
if (_slideMechanic.IsSliding && !motor.GroundingStatus.IsStableOnGround)
|
||||||
{
|
|
||||||
_slideMechanic.EndSlide();
|
_slideMechanic.EndSlide();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void AfterCharacterUpdate(float deltaTime)
|
public void AfterCharacterUpdate(float deltaTime)
|
||||||
{
|
{
|
||||||
|
UpdateSlideTransition(deltaTime);
|
||||||
|
|
||||||
|
_jumpCooldownTimer -= deltaTime;
|
||||||
|
if (_jumpCooldownTimer < 0f) _jumpCooldownTimer = 0f;
|
||||||
|
|
||||||
_wallLeanMechanic.Update(
|
_wallLeanMechanic.Update(
|
||||||
_wallRunningMechanic.IsWallRunning,
|
_wallRunningMechanic.IsWallRunning,
|
||||||
_wallRunningMechanic.GetWallNormal(),
|
_wallRunningMechanic.GetWallNormal(),
|
||||||
|
|||||||
-17
@@ -11,40 +11,23 @@ namespace Code.Gameplay.Character.Controller.Input
|
|||||||
*/
|
*/
|
||||||
public class CharacterInputHandler
|
public class CharacterInputHandler
|
||||||
{
|
{
|
||||||
// Косинус порогового угла для спринта (предвычислен)
|
|
||||||
private readonly float _sprintAngleThresholdCos;
|
|
||||||
|
|
||||||
// Векторы движения и направления взгляда
|
// Векторы движения и направления взгляда
|
||||||
public Vector3 MoveInputVector { get; set; }
|
public Vector3 MoveInputVector { get; set; }
|
||||||
public Vector3 LookInputVector { get; set; }
|
public Vector3 LookInputVector { get; set; }
|
||||||
|
|
||||||
// Флаг-свойство указывающий, что активен режим спринта
|
|
||||||
public bool IsSprinting { get; set; }
|
|
||||||
|
|
||||||
// Вращение камеры в FirstPerson режиме для синхронизации (только горизонтальная компонента)
|
// Вращение камеры в FirstPerson режиме для синхронизации (только горизонтальная компонента)
|
||||||
public Quaternion FirstPersonCameraRotation { get; set; }
|
public Quaternion FirstPersonCameraRotation { get; set; }
|
||||||
|
|
||||||
// Флаг-свойство указывающий, что нужно применить вращение камеры к персонажу
|
// Флаг-свойство указывающий, что нужно применить вращение камеры к персонажу
|
||||||
public bool ShouldApplyCameraRotation { get; private set; }
|
public bool ShouldApplyCameraRotation { get; private set; }
|
||||||
|
|
||||||
// Конструктор с пороговым углом
|
|
||||||
public CharacterInputHandler(float sprintAngleThreshold)
|
|
||||||
{
|
|
||||||
// Предвычисляем косинус порогового угла для эффективности
|
|
||||||
// Угол в градусах → радианы → косинус
|
|
||||||
// Чем меньше угол — тем строже условие
|
|
||||||
_sprintAngleThresholdCos = Mathf.Cos(Mathf.Deg2Rad * sprintAngleThreshold);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Обработка и преобразование входных данных от персонажа
|
// Обработка и преобразование входных данных от персонажа
|
||||||
public void ProcessInputs(ref CharacterInputs inputs, KinematicCharacterMotor motor)
|
public void ProcessInputs(ref CharacterInputs inputs, KinematicCharacterMotor motor)
|
||||||
{
|
{
|
||||||
// Сохраняем текущий режим камеры
|
// Сохраняем текущий режим камеры
|
||||||
var currentCameraMode = inputs.CameraMode;
|
var currentCameraMode = inputs.CameraMode;
|
||||||
|
|
||||||
// Обработка спринта
|
|
||||||
IsSprinting = inputs.SprintPressed && inputs.MoveAxisForward > _sprintAngleThresholdCos; // Спринт только при движении на заданный в конфиге угол
|
|
||||||
|
|
||||||
// Нормализация вектора движения и ограничение его величины до 1
|
// Нормализация вектора движения и ограничение его величины до 1
|
||||||
var moveInputVector =
|
var moveInputVector =
|
||||||
Vector3.ClampMagnitude(new Vector3(inputs.MoveAxisRight, 0, inputs.MoveAxisForward), 1f);
|
Vector3.ClampMagnitude(new Vector3(inputs.MoveAxisRight, 0, inputs.MoveAxisForward), 1f);
|
||||||
|
|||||||
+21
-9
@@ -1,26 +1,38 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using Code.Gameplay.Character.Controller.Input;
|
||||||
|
using KinematicCharacterController;
|
||||||
|
|
||||||
namespace Code.Gameplay.Character.Controller.Movement
|
namespace Code.Gameplay.Character.Controller.Movement
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
* Система движения персонажа в воздухе
|
|
||||||
*/
|
|
||||||
public class AirMovementSystem
|
public class AirMovementSystem
|
||||||
{
|
{
|
||||||
// Вектор, отвечающий за применение гравитации
|
|
||||||
private readonly Vector3 _gravity;
|
private readonly Vector3 _gravity;
|
||||||
|
private readonly float _maxAirSpeed;
|
||||||
|
private readonly float _airControlSharpness;
|
||||||
|
|
||||||
// Конструктор системы движения в воздухе
|
public AirMovementSystem(Vector3 gravity, float maxAirSpeed, float airControlSharpness)
|
||||||
public AirMovementSystem(Vector3 gravity)
|
|
||||||
{
|
{
|
||||||
_gravity = gravity;
|
_gravity = gravity;
|
||||||
|
_maxAirSpeed = maxAirSpeed;
|
||||||
|
_airControlSharpness = airControlSharpness;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Обновление скорости движения персонажа в воздухе
|
public void UpdateVelocity(ref Vector3 currentVelocity, CharacterInputHandler inputHandler, KinematicCharacterMotor motor, float deltaTime)
|
||||||
public void UpdateVelocity(ref Vector3 currentVelocity, float deltaTime)
|
|
||||||
{
|
{
|
||||||
// Применяем гравитацию
|
|
||||||
currentVelocity += _gravity * deltaTime;
|
currentVelocity += _gravity * deltaTime;
|
||||||
|
|
||||||
|
var horizontalVelocity = Vector3.ProjectOnPlane(currentVelocity, motor.CharacterUp);
|
||||||
|
var verticalVelocity = Vector3.Dot(currentVelocity, motor.CharacterUp) * motor.CharacterUp;
|
||||||
|
|
||||||
|
var desiredHorizontalMovement = Vector3.ProjectOnPlane(inputHandler.MoveInputVector, motor.CharacterUp).normalized * _maxAirSpeed;
|
||||||
|
|
||||||
|
horizontalVelocity = Vector3.Lerp(
|
||||||
|
horizontalVelocity,
|
||||||
|
desiredHorizontalMovement,
|
||||||
|
1f - Mathf.Exp(-_airControlSharpness * deltaTime)
|
||||||
|
);
|
||||||
|
|
||||||
|
currentVelocity = horizontalVelocity + verticalVelocity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+8
-7
@@ -11,8 +11,6 @@ namespace Code.Gameplay.Character.Controller.Movement
|
|||||||
{
|
{
|
||||||
// Максимальная скорость движения по устойчивой поверхности
|
// Максимальная скорость движения по устойчивой поверхности
|
||||||
private readonly float _maxStableMoveSpeed;
|
private readonly float _maxStableMoveSpeed;
|
||||||
// Максимальная скорость спринта
|
|
||||||
private readonly float _sprintMoveSpeed;
|
|
||||||
// Резкость изменения скорости движения (чем выше - тем резче)
|
// Резкость изменения скорости движения (чем выше - тем резче)
|
||||||
private readonly float _stableMovementSharpness;
|
private readonly float _stableMovementSharpness;
|
||||||
// Скорость прыжка
|
// Скорость прыжка
|
||||||
@@ -22,10 +20,9 @@ namespace Code.Gameplay.Character.Controller.Movement
|
|||||||
public bool JumpRequested { get; private set; }
|
public bool JumpRequested { get; private set; }
|
||||||
|
|
||||||
// Конструктор системы движения на земле
|
// Конструктор системы движения на земле
|
||||||
public GroundMovementSystem(float maxStableMoveSpeed, float sprintMoveSpeed, float stableMovementSharpness, float jumpSpeed)
|
public GroundMovementSystem(float maxStableMoveSpeed, float stableMovementSharpness, float jumpSpeed)
|
||||||
{
|
{
|
||||||
_maxStableMoveSpeed = maxStableMoveSpeed;
|
_maxStableMoveSpeed = maxStableMoveSpeed;
|
||||||
_sprintMoveSpeed = sprintMoveSpeed;
|
|
||||||
_stableMovementSharpness = stableMovementSharpness;
|
_stableMovementSharpness = stableMovementSharpness;
|
||||||
_jumpSpeed = jumpSpeed;
|
_jumpSpeed = jumpSpeed;
|
||||||
}
|
}
|
||||||
@@ -66,8 +63,7 @@ namespace Code.Gameplay.Character.Controller.Movement
|
|||||||
inputHandler.MoveInputVector.magnitude;
|
inputHandler.MoveInputVector.magnitude;
|
||||||
|
|
||||||
// Расчет целевой скорости движения с учетом ограничения максимальной скорости и спринта
|
// Расчет целевой скорости движения с учетом ограничения максимальной скорости и спринта
|
||||||
var targetSpeed = inputHandler.IsSprinting ? _sprintMoveSpeed : _maxStableMoveSpeed;
|
var targetMovementVelocity = reorientedInput * _maxStableMoveSpeed;
|
||||||
var targetMovementVelocity = reorientedInput * targetSpeed;
|
|
||||||
|
|
||||||
// Плавная интерполяция текущей скорости к целевой с экспоненциальным сглаживанием
|
// Плавная интерполяция текущей скорости к целевой с экспоненциальным сглаживанием
|
||||||
currentVelocity = Vector3.Lerp(
|
currentVelocity = Vector3.Lerp(
|
||||||
@@ -80,8 +76,13 @@ namespace Code.Gameplay.Character.Controller.Movement
|
|||||||
if (JumpRequested)
|
if (JumpRequested)
|
||||||
{
|
{
|
||||||
currentVelocity += motor.CharacterUp * _jumpSpeed - Vector3.Project(currentVelocity, motor.CharacterUp);
|
currentVelocity += motor.CharacterUp * _jumpSpeed - Vector3.Project(currentVelocity, motor.CharacterUp);
|
||||||
JumpRequested = false; // Сброс сразу после применения
|
JumpRequested = false;
|
||||||
motor.ForceUnground();
|
motor.ForceUnground();
|
||||||
|
|
||||||
|
if (motor.CharacterController is CustomCharacterController controller)
|
||||||
|
{
|
||||||
|
controller.TriggerJump();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,8 +45,8 @@ namespace Code.Gameplay.Character.Core
|
|||||||
inputs.MoveAxisForward = moveInput.y; // Vertical ось (W/S или Up/Down)
|
inputs.MoveAxisForward = moveInput.y; // Vertical ось (W/S или Up/Down)
|
||||||
inputs.MoveAxisRight = moveInput.x; // Horizontal ось (A/D или Left/Right)
|
inputs.MoveAxisRight = moveInput.x; // Horizontal ось (A/D или Left/Right)
|
||||||
inputs.JumpPressed = _inputService.JumpPressed; // Прыжки (Space)
|
inputs.JumpPressed = _inputService.JumpPressed; // Прыжки (Space)
|
||||||
inputs.SprintPressed = _inputService.SprintPressed; // Спринт (Shift)
|
|
||||||
inputs.SlidePressed = _inputService.SlidePressed; // Слайд (Ctrl)
|
inputs.SlidePressed = _inputService.SlidePressed; // Слайд (Ctrl)
|
||||||
|
inputs.DashPressed = _inputService.DashPressed; // Слайд (Ctrl)
|
||||||
inputs.CameraMode = ((ICameraState)_cameraStateMachine.CurrentBaseState).GetCameraMode();
|
inputs.CameraMode = ((ICameraState)_cameraStateMachine.CurrentBaseState).GetCameraMode();
|
||||||
|
|
||||||
// Передаем информацию о камере для адаптивного поведения
|
// Передаем информацию о камере для адаптивного поведения
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace Code.Gameplay.Character.Core
|
|||||||
public CameraMode CameraMode; // Текущий режим камеры для адаптации поведения
|
public CameraMode CameraMode; // Текущий режим камеры для адаптации поведения
|
||||||
public Vector3 CameraPlanarDirection; // Направление камеры в горизонтальной плоскости
|
public Vector3 CameraPlanarDirection; // Направление камеры в горизонтальной плоскости
|
||||||
public bool JumpPressed; // Флаг указывающий, нажата ли кнопка прыжка
|
public bool JumpPressed; // Флаг указывающий, нажата ли кнопка прыжка
|
||||||
public bool SprintPressed; // Флаг указывающий, нажата ли кнопка спринта
|
public bool DashPressed;
|
||||||
public bool SlidePressed; // Флаг указывающий, нажата ли кнопка слайда
|
public bool SlidePressed; // Флаг указывающий, нажата ли кнопка слайда
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -38,7 +38,7 @@ namespace Code.Gameplay.Character.Core
|
|||||||
inputs.MoveAxisForward = moveInput.y; // Vertical ось (W/S или Up/Down)
|
inputs.MoveAxisForward = moveInput.y; // Vertical ось (W/S или Up/Down)
|
||||||
inputs.MoveAxisRight = moveInput.x; // Horizontal ось (A/D или Left/Right)
|
inputs.MoveAxisRight = moveInput.x; // Horizontal ось (A/D или Left/Right)
|
||||||
inputs.JumpPressed = _inputService.JumpPressed; // Прыжки (Space)
|
inputs.JumpPressed = _inputService.JumpPressed; // Прыжки (Space)
|
||||||
inputs.SprintPressed = true;//_inputService.SprintPressed; // Спринт (Shift)
|
inputs.DashPressed = _inputService.DashPressed;
|
||||||
inputs.SlidePressed = _inputService.SlidePressed; // Слайд (Ctrl)
|
inputs.SlidePressed = _inputService.SlidePressed; // Слайд (Ctrl)
|
||||||
inputs.CameraMode = ((ICameraState)_cameraStateMachine.CurrentBaseState).GetCameraMode();
|
inputs.CameraMode = ((ICameraState)_cameraStateMachine.CurrentBaseState).GetCameraMode();
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
|
using DG.Tweening;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Code.Gameplay.Door
|
namespace Code.Gameplay.Door
|
||||||
{
|
{
|
||||||
public class Door : MonoBehaviour
|
public class Door : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
[SerializeField] private Transform doorPolotno;
|
||||||
|
private Vector3 _doorInitialPosition;
|
||||||
|
private Quaternion _doorInitialRotation;
|
||||||
[SerializeField] private Transform hingeJointAnchor;
|
[SerializeField] private Transform hingeJointAnchor;
|
||||||
[SerializeField] private HingeJoint hingeJoint;
|
[SerializeField] private HingeJoint hingeJoint;
|
||||||
[SerializeField] private Rigidbody rigidbody;
|
[SerializeField] private Rigidbody rigidbody;
|
||||||
@@ -15,9 +19,19 @@ namespace Code.Gameplay.Door
|
|||||||
rigidbody.isKinematic = true;
|
rigidbody.isKinematic = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
_doorInitialPosition = doorPolotno.position;
|
||||||
|
_doorInitialRotation = doorPolotno.rotation;
|
||||||
|
|
||||||
rigidbody.isKinematic = false;
|
rigidbody.isKinematic = false;
|
||||||
hingeJoint.autoConfigureConnectedAnchor = false;
|
hingeJoint.autoConfigureConnectedAnchor = false;
|
||||||
hingeJoint.connectedAnchor = hingeJointAnchor.position;
|
hingeJoint.connectedAnchor = hingeJointAnchor.position;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void CloseTheDoor()
|
||||||
|
{
|
||||||
|
TranslationMode(true);
|
||||||
|
doorPolotno.DORotate(_doorInitialRotation.eulerAngles, 0.5f);
|
||||||
|
doorPolotno.DOMove(_doorInitialPosition, 0.5f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
using System;
|
||||||
|
using DG.Tweening;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Code.Gameplay.Door
|
||||||
|
{
|
||||||
|
public class DoorDebug : MonoBehaviour
|
||||||
|
{
|
||||||
|
[SerializeField] private Transform doorSelf;
|
||||||
|
[SerializeField] private Transform doorPolotno;
|
||||||
|
private Vector3 _doorInitialPosition;
|
||||||
|
private Quaternion _doorInitialRotation;
|
||||||
|
[SerializeField] private Transform hingeJointAnchor;
|
||||||
|
[SerializeField] private HingeJoint hingeJoint;
|
||||||
|
[SerializeField] private Rigidbody rigidbody;
|
||||||
|
[SerializeField] private bool debug;
|
||||||
|
[SerializeField] private bool closed;
|
||||||
|
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
_doorInitialPosition = doorPolotno.position;
|
||||||
|
_doorInitialRotation = doorPolotno.rotation;
|
||||||
|
}
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
if(debug && !closed)
|
||||||
|
{
|
||||||
|
CloseTheDoor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void TranslationMode(bool on)
|
||||||
|
{
|
||||||
|
if (on)
|
||||||
|
{
|
||||||
|
rigidbody.isKinematic = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_doorInitialPosition = doorPolotno.position;
|
||||||
|
_doorInitialRotation = doorPolotno.rotation;
|
||||||
|
|
||||||
|
rigidbody.isKinematic = false;
|
||||||
|
hingeJoint.autoConfigureConnectedAnchor = false;
|
||||||
|
hingeJoint.connectedAnchor = hingeJointAnchor.position;
|
||||||
|
}
|
||||||
|
public void CloseTheDoor()
|
||||||
|
{
|
||||||
|
// TranslationMode(true);
|
||||||
|
doorPolotno.DORotate(_doorInitialRotation.eulerAngles, 0.5f);
|
||||||
|
doorPolotno.DOMove(_doorInitialPosition, 0.5f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ed06ed70c7924ca9bc59f33ee7e6cdfa
|
||||||
|
timeCreated: 1764533216
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace Code.Gameplay.Door
|
||||||
|
{
|
||||||
|
public class DoorPooler
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: acfad6f51f224b51abb761fc22e4356f
|
||||||
|
timeCreated: 1764521809
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f17ace0fa75741f2a730ff21181c6e8c
|
||||||
|
timeCreated: 1764575680
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.AI;
|
||||||
|
|
||||||
|
namespace Code.Gameplay.Enemies.Animators
|
||||||
|
{
|
||||||
|
public class EnemyAnimator : MonoBehaviour
|
||||||
|
{
|
||||||
|
private static readonly int Velocity = Animator.StringToHash("Velocity");
|
||||||
|
|
||||||
|
[SerializeField] private Animator animator;
|
||||||
|
[SerializeField] private NavMeshAgent agent;
|
||||||
|
|
||||||
|
private void SetVelocity(float velocity)
|
||||||
|
{
|
||||||
|
animator.SetFloat(Velocity, velocity);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
if(agent) SetVelocity(agent.velocity.magnitude);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 936125a7ed844674b0e0586a484253ce
|
||||||
|
timeCreated: 1764575708
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
|
using Code.Audio;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.AI;
|
using UnityEngine.AI;
|
||||||
using Code.Gameplay.Player;
|
using Code.Gameplay.Player;
|
||||||
using Code.Gameplay.Character.Controller;
|
using Code.Gameplay.Character.Controller;
|
||||||
using Code.Gameplay.Character.Core;
|
using Code.Gameplay.Character.Core;
|
||||||
|
using Code.Gameplay.Enemies.Animators;
|
||||||
using Reflex.Attributes;
|
using Reflex.Attributes;
|
||||||
using Reflex.Core;
|
using Reflex.Core;
|
||||||
using Reflex.Injectors;
|
using Reflex.Injectors;
|
||||||
@@ -13,6 +15,7 @@ namespace Code.Gameplay.Enemies
|
|||||||
{
|
{
|
||||||
[SerializeField] protected NavMeshAgent agent;
|
[SerializeField] protected NavMeshAgent agent;
|
||||||
[SerializeField] protected Collider enemyCollider;
|
[SerializeField] protected Collider enemyCollider;
|
||||||
|
[Inject] protected IAudioService audioService;
|
||||||
|
|
||||||
protected int Damage;
|
protected int Damage;
|
||||||
protected float AttackCooldown;
|
protected float AttackCooldown;
|
||||||
@@ -35,7 +38,7 @@ namespace Code.Gameplay.Enemies
|
|||||||
private bool _isStunned;
|
private bool _isStunned;
|
||||||
private float _currentStunTimer;
|
private float _currentStunTimer;
|
||||||
|
|
||||||
private bool _canAttack = true;
|
protected bool _canAttack = true;
|
||||||
private float _attackCooldownTimer;
|
private float _attackCooldownTimer;
|
||||||
|
|
||||||
private enum IdleState { Moving, Paused }
|
private enum IdleState { Moving, Paused }
|
||||||
@@ -50,10 +53,11 @@ namespace Code.Gameplay.Enemies
|
|||||||
|
|
||||||
protected virtual void Awake()
|
protected virtual void Awake()
|
||||||
{
|
{
|
||||||
if (_playerProvider == null)
|
// // TODO Мешает
|
||||||
{
|
// if (_playerProvider == null)
|
||||||
AttributeInjector.Inject(this, Container.ProjectContainer);
|
// {
|
||||||
}
|
// AttributeInjector.Inject(this, Container.ProjectContainer);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void Update()
|
protected virtual void Update()
|
||||||
@@ -164,19 +168,19 @@ namespace Code.Gameplay.Enemies
|
|||||||
|
|
||||||
protected virtual void HandleAttackCooldown()
|
protected virtual void HandleAttackCooldown()
|
||||||
{
|
{
|
||||||
if (!_canAttack)
|
if (_canAttack) return;
|
||||||
{
|
|
||||||
_attackCooldownTimer -= Time.deltaTime;
|
_attackCooldownTimer -= Time.deltaTime;
|
||||||
|
|
||||||
if (_attackCooldownTimer <= 0)
|
if (_attackCooldownTimer <= 0)
|
||||||
{
|
{
|
||||||
_canAttack = true;
|
_canAttack = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void DealDamage()
|
protected virtual void DealDamage()
|
||||||
{
|
{
|
||||||
if (!_canAttack || PlayerHealth == null) return;
|
if (PlayerHealth == null) return;
|
||||||
|
|
||||||
PlayerHealth.GetDamage(Damage);
|
PlayerHealth.GetDamage(Damage);
|
||||||
ApplyEffectsToPlayer();
|
ApplyEffectsToPlayer();
|
||||||
@@ -184,11 +188,10 @@ namespace Code.Gameplay.Enemies
|
|||||||
_canAttack = false;
|
_canAttack = false;
|
||||||
_attackCooldownTimer = AttackCooldown;
|
_attackCooldownTimer = AttackCooldown;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void ApplyEffectsToPlayer()
|
protected virtual void ApplyEffectsToPlayer()
|
||||||
{
|
{
|
||||||
if (PlayerController)
|
if (PlayerController)
|
||||||
PlayerController.BlockAbilities(3f);
|
PlayerController.BlockAbilities(3f); // TODO в конфиг
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnDrawGizmosSelected()
|
private void OnDrawGizmosSelected()
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using Code.Audio;
|
||||||
using Code.Configs;
|
using Code.Configs;
|
||||||
using Reflex.Attributes;
|
using Reflex.Attributes;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@@ -35,7 +36,7 @@ namespace Code.Gameplay.Enemies
|
|||||||
{
|
{
|
||||||
base.Awake();
|
base.Awake();
|
||||||
|
|
||||||
if (agent == null) return;
|
if (!agent) return;
|
||||||
|
|
||||||
var walkableArea = NavMesh.GetAreaFromName("Cockroach");
|
var walkableArea = NavMesh.GetAreaFromName("Cockroach");
|
||||||
agent.areaMask = 1 << walkableArea;
|
agent.areaMask = 1 << walkableArea;
|
||||||
@@ -43,12 +44,14 @@ namespace Code.Gameplay.Enemies
|
|||||||
|
|
||||||
protected override void HandleAttack()
|
protected override void HandleAttack()
|
||||||
{
|
{
|
||||||
if (!Player) return;
|
if (!Player || !_canAttack) return;
|
||||||
|
|
||||||
var distance = Vector3.Distance(transform.position, Player.transform.position);
|
var distance = Vector3.Distance(transform.position, Player.transform.position);
|
||||||
|
|
||||||
if (!(distance <= AttackRange)) return;
|
if (!(distance <= AttackRange)) return;
|
||||||
|
|
||||||
|
audioService.PlayEnemy(EnemiesSounds.RoachAttack, agent.transform.position);
|
||||||
|
|
||||||
DealDamage();
|
DealDamage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
|
using Code.Audio;
|
||||||
using Code.Configs;
|
using Code.Configs;
|
||||||
|
using Code.Gameplay.Enemies.Animators;
|
||||||
using Reflex.Attributes;
|
using Reflex.Attributes;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.AI;
|
using UnityEngine.AI;
|
||||||
@@ -40,16 +42,17 @@ namespace Code.Gameplay.Enemies
|
|||||||
var walkableArea = NavMesh.GetAreaFromName("Walkable");
|
var walkableArea = NavMesh.GetAreaFromName("Walkable");
|
||||||
agent.areaMask = 1 << walkableArea;
|
agent.areaMask = 1 << walkableArea;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void HandleAttack()
|
protected override void HandleAttack()
|
||||||
{
|
{
|
||||||
if (!Player) return;
|
if (!Player || !_canAttack) return;
|
||||||
|
|
||||||
var distance = Vector3.Distance(transform.position, Player.transform.position);
|
var distance = Vector3.Distance(transform.position, Player.transform.position);
|
||||||
|
|
||||||
if (!(distance <= AttackRange)) return;
|
if (!(distance <= AttackRange)) return;
|
||||||
|
|
||||||
if (Player.CustomCharacterController.IsSliding)
|
audioService.PlayEnemy(EnemiesSounds.GrandpaAttack,agent.transform.position);
|
||||||
|
|
||||||
|
if (Player.CustomCharacterController.IsDashing || Player.CustomCharacterController.IsSliding)
|
||||||
ApplyStun();
|
ApplyStun();
|
||||||
else
|
else
|
||||||
DealDamage();
|
DealDamage();
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
using Code.Audio;
|
||||||
|
using Reflex.Attributes;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Code.Gameplay.Enemies
|
||||||
|
{
|
||||||
|
public class EnemyAudio : MonoBehaviour
|
||||||
|
{
|
||||||
|
private IAudioService _audioService;
|
||||||
|
private IAudioFactory _audioFactory;
|
||||||
|
[SerializeField] private AudioSource _audioSource;
|
||||||
|
[SerializeField] private EnemiesSounds stepId;
|
||||||
|
|
||||||
|
[Inject]
|
||||||
|
private void Construct(IAudioService audioService, IAudioFactory audioFactory)
|
||||||
|
{
|
||||||
|
_audioService = audioService;
|
||||||
|
_audioSource = audioService.GetSourceOfGroup(Audio.AudioType.Enemies);
|
||||||
|
_audioSource.transform.position = transform.position;
|
||||||
|
_audioSource.spatialBlend = 1f;
|
||||||
|
_audioFactory = audioFactory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void PlayStep()
|
||||||
|
{
|
||||||
|
_audioSource.transform.position = transform.position;
|
||||||
|
_audioSource.PlayOneShot(_audioFactory.EnemiesAudios[(int)stepId]);
|
||||||
|
}
|
||||||
|
private void OnDestroy()
|
||||||
|
{
|
||||||
|
_audioService.ReleaseSourceOfGroup(_audioSource);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 91cb250df1b24fc4825ee791a12dda11
|
||||||
|
timeCreated: 1764695102
|
||||||
@@ -3,9 +3,11 @@ using Code.Configs;
|
|||||||
using Cysharp.Threading.Tasks;
|
using Cysharp.Threading.Tasks;
|
||||||
using Reflex.Attributes;
|
using Reflex.Attributes;
|
||||||
using Reflex.Core;
|
using Reflex.Core;
|
||||||
|
using Reflex.Extensions;
|
||||||
using Reflex.Injectors;
|
using Reflex.Injectors;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.AddressableAssets;
|
using UnityEngine.AddressableAssets;
|
||||||
|
using UnityEngine.SceneManagement;
|
||||||
|
|
||||||
namespace Code.Gameplay.Enemies
|
namespace Code.Gameplay.Enemies
|
||||||
{
|
{
|
||||||
@@ -27,14 +29,14 @@ namespace Code.Gameplay.Enemies
|
|||||||
)
|
)
|
||||||
.ToUniTask();
|
.ToUniTask();
|
||||||
|
|
||||||
AttributeInjector.Inject(enemyObj, Container.ProjectContainer);
|
GameObjectInjector.InjectRecursive(enemyObj, SceneManager.GetActiveScene().GetSceneContainer());
|
||||||
|
|
||||||
return enemyObj.GetComponent<BaseEnemy>();
|
return enemyObj.GetComponent<BaseEnemy>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ReleaseEnemy(BaseEnemy enemy)
|
public void ReleaseEnemy(BaseEnemy enemy)
|
||||||
{
|
{
|
||||||
if (enemy == null) return;
|
if (!enemy) return;
|
||||||
|
|
||||||
enemy.gameObject.SetActive(false);
|
enemy.gameObject.SetActive(false);
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
using Code.Gameplay.Player;
|
using Code.Gameplay.Player;
|
||||||
using Cysharp.Threading.Tasks;
|
using Cysharp.Threading.Tasks;
|
||||||
using Reflex.Attributes;
|
using Reflex.Attributes;
|
||||||
using Reflex.Core;
|
|
||||||
using Reflex.Injectors;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Code.Gameplay.Enemies
|
namespace Code.Gameplay.Enemies
|
||||||
@@ -20,13 +18,14 @@ namespace Code.Gameplay.Enemies
|
|||||||
private bool _isSpawning;
|
private bool _isSpawning;
|
||||||
private bool _isPlayerInRange;
|
private bool _isPlayerInRange;
|
||||||
|
|
||||||
private void Awake()
|
// GameObjectSelfInjector существует
|
||||||
{
|
// private void Awake()
|
||||||
if (_playerProvider == null || _enemyFactory == null)
|
// {
|
||||||
{
|
// if (_playerProvider == null || _enemyFactory == null)
|
||||||
AttributeInjector.Inject(this, Container.ProjectContainer);
|
// {
|
||||||
}
|
// AttributeInjector.Inject(this, Container.ProjectContainer);
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
@@ -64,9 +63,14 @@ namespace Code.Gameplay.Enemies
|
|||||||
_isSpawning = false;
|
_isSpawning = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnDestroy()
|
||||||
|
{
|
||||||
|
Despawn();
|
||||||
|
}
|
||||||
|
|
||||||
private void Despawn()
|
private void Despawn()
|
||||||
{
|
{
|
||||||
if (_spawnedEnemy == null) return;
|
if (!_spawnedEnemy) return;
|
||||||
|
|
||||||
_enemyFactory.ReleaseEnemy(_spawnedEnemy);
|
_enemyFactory.ReleaseEnemy(_spawnedEnemy);
|
||||||
_spawnedEnemy = null;
|
_spawnedEnemy = null;
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
using Code.Audio;
|
||||||
|
using Reflex.Attributes;
|
||||||
|
using UnityEngine;
|
||||||
|
using AudioType = Code.Audio.AudioType;
|
||||||
|
|
||||||
|
namespace Code.Gameplay.Player
|
||||||
|
{
|
||||||
|
public class PlayerAudio : MonoBehaviour
|
||||||
|
{
|
||||||
|
private IAudioService _audioService;
|
||||||
|
private IAudioFactory _audioFactory;
|
||||||
|
private AudioSource _audioSource;
|
||||||
|
|
||||||
|
[Inject]
|
||||||
|
private void Construct(IAudioService audioService, IAudioFactory audioFactory)
|
||||||
|
{
|
||||||
|
_audioService = audioService;
|
||||||
|
_audioSource = audioService.GetSourceOfGroup(AudioType.Courier);
|
||||||
|
|
||||||
|
_audioFactory = audioFactory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void PlayStep()
|
||||||
|
{
|
||||||
|
_audioSource.PlayOneShot(_audioFactory.CourierAudios[(int)CourierSounds.Step]);
|
||||||
|
}
|
||||||
|
private void OnDestroy()
|
||||||
|
{
|
||||||
|
_audioService.ReleaseSourceOfGroup(_audioSource);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 64f99dccce9d41df98accae0f355dbca
|
||||||
|
timeCreated: 1764584350
|
||||||
@@ -42,7 +42,13 @@ namespace Code.Gameplay.Player
|
|||||||
Addressables.ReleaseInstance(characterProvider.gameObject);
|
Addressables.ReleaseInstance(characterProvider.gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async UniTask<ArmsMeshProvider> CreateArms(Transform papochka) => (await Addressables.InstantiateAsync(_playerConfig.armsMeshPrefab, papochka).ToUniTask()).GetComponent<ArmsMeshProvider>();
|
public async UniTask<ArmsMeshProvider> CreateArms(Transform papochka)
|
||||||
|
{
|
||||||
|
var armsMesh = (await Addressables.InstantiateAsync(_playerConfig.armsMeshPrefab, papochka).ToUniTask());
|
||||||
|
GameObjectInjector.InjectRecursive(armsMesh, Container.ProjectContainer);
|
||||||
|
|
||||||
|
return armsMesh.GetComponent<ArmsMeshProvider>();
|
||||||
|
}
|
||||||
public void ReleaseArms(ArmsMeshProvider arms) => Addressables.ReleaseInstance(arms.gameObject);
|
public void ReleaseArms(ArmsMeshProvider arms) => Addressables.ReleaseInstance(arms.gameObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12,5 +12,6 @@ namespace Code.Generator
|
|||||||
Room CreateRoomByIndex(int index, RoomType roomType);
|
Room CreateRoomByIndex(int index, RoomType roomType);
|
||||||
void ReleaseRooms();
|
void ReleaseRooms();
|
||||||
GameObject GetRandomCachedPrefabOfType(RoomType roomType, out int index);
|
GameObject GetRandomCachedPrefabOfType(RoomType roomType, out int index);
|
||||||
|
int GetRandomIndexOfType(RoomType roomType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,12 @@
|
|||||||
using System;
|
using System;
|
||||||
using Code.Gameplay.Door;
|
using Code.Gameplay.Door;
|
||||||
|
using Code.Gameplay.Orders.Order;
|
||||||
using Code.UI;
|
using Code.UI;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Code.Generator
|
namespace Code.Generator
|
||||||
{
|
{
|
||||||
[RequireComponent(typeof(Transform))]
|
// Для написания нормальной системы комнат нужен другой подход в корне, это уже не исправить, только залатать большие дыры
|
||||||
public class Room : MonoBehaviour
|
public class Room : MonoBehaviour
|
||||||
{
|
{
|
||||||
[SerializeField] protected RoomType roomType;
|
[SerializeField] protected RoomType roomType;
|
||||||
@@ -15,19 +16,17 @@ namespace Code.Generator
|
|||||||
[SerializeField] protected Transform enterMarker;
|
[SerializeField] protected Transform enterMarker;
|
||||||
public Transform EnterMarker => enterMarker;
|
public Transform EnterMarker => enterMarker;
|
||||||
[SerializeField] protected Transform exitMarker;
|
[SerializeField] protected Transform exitMarker;
|
||||||
|
[SerializeField] protected Transform doorSlot;
|
||||||
public Transform ExitMarker => exitMarker;
|
public Transform ExitMarker => exitMarker;
|
||||||
[SerializeField] protected Door door;
|
[SerializeField] protected Door door;
|
||||||
|
|
||||||
protected void Awake()
|
public void Initialize(IOrderService orderService)
|
||||||
{
|
{
|
||||||
if (EnterMarker == null || ExitMarker == null)
|
door.TranslationMode(false);
|
||||||
{
|
|
||||||
Debug.LogError($"Але маркеры не найдены у комнаты {gameObject.name}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Initialize() => door.TranslationMode(false);
|
if(roomTrigger) roomTrigger.OrderService = orderService;
|
||||||
|
}
|
||||||
//PIZDEC
|
public void Seal() => door.CloseTheDoor();
|
||||||
|
[SerializeField] public RoomTrigger roomTrigger;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,6 @@ using System.Collections.Generic;
|
|||||||
using Code.Gameplay.Orders.Order;
|
using Code.Gameplay.Orders.Order;
|
||||||
using Code.Scenes;
|
using Code.Scenes;
|
||||||
using Code.Scenes.SceneEnvironments;
|
using Code.Scenes.SceneEnvironments;
|
||||||
using Cysharp.Threading.Tasks;
|
|
||||||
using Reflex.Attributes;
|
using Reflex.Attributes;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
@@ -36,43 +35,22 @@ namespace Code.Generator
|
|||||||
|
|
||||||
public void Initialize()
|
public void Initialize()
|
||||||
{
|
{
|
||||||
// _orderService.OrderGive();
|
|
||||||
|
|
||||||
_spawnedRooms = new List<Room>();
|
_spawnedRooms = new List<Room>();
|
||||||
_roomIndexesStack = new();
|
_roomIndexesStack = new();
|
||||||
|
|
||||||
Debug.LogWarning($"КОТЛЫ ГЕНЕРАЛЬСКИЕ{_orderService.DeliveryTimer}");
|
|
||||||
|
|
||||||
// CreateRoomsStack();
|
|
||||||
|
|
||||||
// SpawnInitialRoomsAsync();
|
|
||||||
_orderService.OnOrderGiven += CreateRoomsStack;
|
_orderService.OnOrderGiven += CreateRoomsStack;
|
||||||
RoomTrigger.PlayerEnteredRoom += OnPlayerEntered;
|
|
||||||
|
|
||||||
CreateInitialRoom();
|
CreateInitialRoom();
|
||||||
SpawnNextRoomAsync();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnEnable()
|
private void OnPlayerEntered()
|
||||||
{
|
{
|
||||||
RoomTrigger.PlayerEnteredRoom += OnPlayerEntered;
|
SpawnNextRoom();
|
||||||
}
|
|
||||||
|
|
||||||
private void OnDisable()
|
|
||||||
{
|
|
||||||
RoomTrigger.PlayerEnteredRoom -= OnPlayerEntered;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnPlayerEntered()
|
|
||||||
{
|
|
||||||
SpawnNextRoomAsync();
|
|
||||||
|
|
||||||
if (_spawnedRooms.Count > 3)
|
if (_spawnedRooms.Count > 3)
|
||||||
{
|
{
|
||||||
Room roomToRemove = _spawnedRooms[0];
|
Room roomToRemove = _spawnedRooms[0];
|
||||||
_spawnedRooms.RemoveAt(0);
|
_spawnedRooms.RemoveAt(0);
|
||||||
|
|
||||||
// _factory.ReleaseRoom(roomToRemove);
|
|
||||||
Object.Destroy(roomToRemove.gameObject);
|
Object.Destroy(roomToRemove.gameObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -92,24 +70,29 @@ namespace Code.Generator
|
|||||||
|
|
||||||
_roomIndexesStack.Add(new(RoomType.Basic, roomIndex));
|
_roomIndexesStack.Add(new(RoomType.Basic, roomIndex));
|
||||||
remainingTime -= room.RoomTimer;
|
remainingTime -= room.RoomTimer;
|
||||||
Debug.Log($"комната {room.name} время {room.RoomTimer} осталось: {remainingTime}");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateSaveRoom();
|
|
||||||
|
|
||||||
AddPickupRoom();
|
AddPickupRoom();
|
||||||
|
|
||||||
Debug.Log($"стек комнат: {_roomIndexesStack.Count}");
|
AddSaveRoom();
|
||||||
SpawnNextRoomAsync();
|
|
||||||
|
SpawnNextRoom();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CreateSaveRoom()
|
private void AddSaveRoom()
|
||||||
{
|
{
|
||||||
var prefab = _factory.GetRandomCachedPrefabOfType(RoomType.Save, out int roomIndex);
|
int saveRoomIndex = _factory.GetRandomIndexOfType(RoomType.Save);
|
||||||
Room saveRoom = prefab.GetComponent<Room>();
|
|
||||||
_roomIndexesStack.Add(new(RoomType.Save, roomIndex));
|
|
||||||
|
|
||||||
Debug.Log($"Первая комната: {saveRoom.name}");
|
_roomIndexesStack.Add(new(RoomType.Save, saveRoomIndex));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AddPickupRoom()
|
||||||
|
{
|
||||||
|
int pickupIndex = _factory.GetRandomIndexOfType(RoomType.PickUp);
|
||||||
|
|
||||||
|
int insertPos = Random.Range(1, _roomIndexesStack.Count + 1);
|
||||||
|
|
||||||
|
_roomIndexesStack.Insert(insertPos, new(RoomType.PickUp, pickupIndex));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Inject] private CurrentSceneEnvironment _currentSceneEnvironment;
|
[Inject] private CurrentSceneEnvironment _currentSceneEnvironment;
|
||||||
@@ -118,19 +101,17 @@ namespace Code.Generator
|
|||||||
{
|
{
|
||||||
GameplaySceneEnvironment gameplaySceneEnvironment = (GameplaySceneEnvironment)_currentSceneEnvironment;
|
GameplaySceneEnvironment gameplaySceneEnvironment = (GameplaySceneEnvironment)_currentSceneEnvironment;
|
||||||
|
|
||||||
_factory.GetRandomCachedPrefabOfType(RoomType.Initial, out int roomIndex);
|
int roomIndex = _factory.GetRandomIndexOfType(RoomType.Initial);
|
||||||
// _roomIndexesStack.Add(new(RoomType.Initial, roomIndex));
|
|
||||||
InitialRoom instantiated = _factory.CreateRoomByIndex(roomIndex, RoomType.Initial).GetComponent<InitialRoom>();
|
InitialRoom instantiated = _factory.CreateRoomByIndex(roomIndex, RoomType.Initial).GetComponent<InitialRoom>();
|
||||||
_spawnedRooms.Add(instantiated);
|
_spawnedRooms.Add(instantiated);
|
||||||
instantiated.transform.position = Vector3.zero;
|
instantiated.transform.position = Vector3.zero;
|
||||||
instantiated.transform.rotation = Quaternion.identity;
|
instantiated.transform.rotation = Quaternion.identity;
|
||||||
|
|
||||||
gameplaySceneEnvironment.playerSpawnPoint = instantiated.playerSpawn;
|
gameplaySceneEnvironment.playerSpawnPoint = instantiated.playerSpawn;
|
||||||
instantiated.Initialize();
|
instantiated.Initialize(_orderService);
|
||||||
|
|
||||||
Debug.Log($"Первая комната: {instantiated.name}");
|
|
||||||
}
|
}
|
||||||
private void SpawnNextRoomAsync()
|
private void SpawnNextRoom()
|
||||||
{
|
{
|
||||||
if (_nextRoomStackIndex >= _roomIndexesStack.Count)
|
if (_nextRoomStackIndex >= _roomIndexesStack.Count)
|
||||||
return;
|
return;
|
||||||
@@ -149,23 +130,14 @@ namespace Code.Generator
|
|||||||
PlaceRoom(room, previousRoom);
|
PlaceRoom(room, previousRoom);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Отписываться можно, но Хатико никогда не дождётся вызова уничтоженного объекта.
|
||||||
|
room.roomTrigger.OnEnter += OnPlayerEntered;
|
||||||
|
|
||||||
|
room.roomTrigger.OnExit += _spawnedRooms[^1].Seal;
|
||||||
_spawnedRooms.Add(room);
|
_spawnedRooms.Add(room);
|
||||||
_nextRoomStackIndex++;
|
_nextRoomStackIndex++;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddPickupRoom()
|
|
||||||
{
|
|
||||||
var prefab = _factory.GetRandomCachedPrefabOfType(RoomType.PickUp, out int pickupIndex);
|
|
||||||
|
|
||||||
Room pickupRoom = prefab.GetComponent<Room>();
|
|
||||||
|
|
||||||
if (_roomIndexesStack.Count == 0) return;
|
|
||||||
|
|
||||||
int insertPos = Random.Range(1, _roomIndexesStack.Count + 1);
|
|
||||||
|
|
||||||
_roomIndexesStack.Insert(insertPos, new(RoomType.PickUp, pickupIndex));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void PlaceRoom(Room current, Room previous)
|
private void PlaceRoom(Room current, Room previous)
|
||||||
{
|
{
|
||||||
@@ -217,17 +189,7 @@ namespace Code.Generator
|
|||||||
segmentOriginPosition.y -= randomDoorOriginPosition.y;
|
segmentOriginPosition.y -= randomDoorOriginPosition.y;
|
||||||
current.transform.position = segmentOriginPosition;
|
current.transform.position = segmentOriginPosition;
|
||||||
current.transform.rotation = Quaternion.Euler(0, segmentOriginYRotation, 0);
|
current.transform.rotation = Quaternion.Euler(0, segmentOriginYRotation, 0);
|
||||||
// locationSegment.isNeedSomeDoors = true;
|
current.Initialize(_orderService);
|
||||||
// locationSegment.AddBadDoorId(locationSegment.LocationSegment.GetDoorOrigins.IndexOf(randomDoorOrigin));
|
|
||||||
current.Initialize();
|
|
||||||
|
|
||||||
float frameOnTheBallRotation = segmentOriginYRotation + randomDoorOriginRotation.eulerAngles.y;
|
|
||||||
if (frameOnTheBallRotation > 305f) frameOnTheBallRotation -= 360f;
|
|
||||||
else if (frameOnTheBallRotation < -45f) frameOnTheBallRotation += 360f;
|
|
||||||
|
|
||||||
// heOnTheBall.AddSlaveLocationSegment(locationSegment.Id);
|
|
||||||
// heOnTheBall.ReplaceSlaveSegmentDoorOriginYRotation(frameOnTheBallRotation);
|
|
||||||
// heOnTheBall.isGotOnTheBall = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ namespace Code.Generator
|
|||||||
index = Random.Range(0, _cashedRooms[roomType].Count);
|
index = Random.Range(0, _cashedRooms[roomType].Count);
|
||||||
return _cashedRooms[roomType][index];
|
return _cashedRooms[roomType][index];
|
||||||
}
|
}
|
||||||
|
public int GetRandomIndexOfType(RoomType roomType) => Random.Range(0, _cashedRooms[roomType].Count);
|
||||||
|
|
||||||
public Room CreateRoomByIndex(int index, RoomType roomType)
|
public Room CreateRoomByIndex(int index, RoomType roomType)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,32 +1,36 @@
|
|||||||
using System;
|
using System;
|
||||||
using Code.Gameplay.Orders.Order;
|
using Code.Gameplay.Orders.Order;
|
||||||
using Reflex.Attributes;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Code.Generator
|
namespace Code.Generator
|
||||||
{
|
{
|
||||||
public class RoomTrigger : MonoBehaviour
|
public class RoomTrigger : MonoBehaviour
|
||||||
{
|
{
|
||||||
[Inject] private IOrderService _orderService;
|
public IOrderService OrderService;
|
||||||
|
public event Action OnEnter;
|
||||||
|
public event Action OnExit;
|
||||||
|
|
||||||
public static event Action PlayerEnteredRoom;
|
private bool _playerEntered, _playerExited;
|
||||||
|
|
||||||
private bool _playerEntered;
|
|
||||||
|
|
||||||
// [Inject]
|
|
||||||
// private void Construct(IOrderService orderService)
|
|
||||||
// {
|
|
||||||
// _orderService = orderService;
|
|
||||||
// }
|
|
||||||
private void OnTriggerEnter(Collider other)
|
private void OnTriggerEnter(Collider other)
|
||||||
{
|
{
|
||||||
if (_playerEntered) return;
|
if (_playerEntered) return;
|
||||||
|
|
||||||
_playerEntered = true;
|
_playerEntered = true;
|
||||||
|
|
||||||
_orderService.RoomPassed();
|
OrderService.RoomPassed();
|
||||||
|
|
||||||
PlayerEnteredRoom?.Invoke();
|
OnEnter?.Invoke();
|
||||||
|
}
|
||||||
|
private void OnTriggerExit(Collider other)
|
||||||
|
{
|
||||||
|
if (_playerExited) return;
|
||||||
|
|
||||||
|
Debug.Log(other.name);
|
||||||
|
|
||||||
|
_playerExited = true;
|
||||||
|
|
||||||
|
OnExit?.Invoke();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 4207b7568dc3482393ac1860a31909b4
|
guid: 0d6940d73d544f0a8e4a45d956bc2364
|
||||||
timeCreated: 1764087485
|
timeCreated: 1764525516
|
||||||
@@ -16,8 +16,8 @@ namespace Code.Input
|
|||||||
// Для управления движением персонажа
|
// Для управления движением персонажа
|
||||||
Vector2 MoveInput { get; }
|
Vector2 MoveInput { get; }
|
||||||
bool JumpPressed { get; }
|
bool JumpPressed { get; }
|
||||||
bool SprintPressed { get; }
|
|
||||||
bool SlidePressed { get; }
|
bool SlidePressed { get; }
|
||||||
|
bool DashPressed { get; }
|
||||||
|
|
||||||
// Для переключения режима камеры
|
// Для переключения режима камеры
|
||||||
bool ToggleCameraModePressed { get; }
|
bool ToggleCameraModePressed { get; }
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ namespace Code.Input
|
|||||||
public float ZoomInput { get; private set; }
|
public float ZoomInput { get; private set; }
|
||||||
public Vector2 MoveInput { get; private set; }
|
public Vector2 MoveInput { get; private set; }
|
||||||
public bool JumpPressed { get; private set; }
|
public bool JumpPressed { get; private set; }
|
||||||
public bool SprintPressed { get; private set; }
|
|
||||||
public bool SlidePressed { get; private set; }
|
public bool SlidePressed { get; private set; }
|
||||||
|
public bool DashPressed { get; private set; }
|
||||||
public bool ToggleCameraModePressed { get; private set; }
|
public bool ToggleCameraModePressed { get; private set; }
|
||||||
|
|
||||||
public InputService(InputActionAsset inputActionAsset)
|
public InputService(InputActionAsset inputActionAsset)
|
||||||
@@ -69,14 +69,6 @@ namespace Code.Input
|
|||||||
jumpAction.canceled += OnJumpCanceled;
|
jumpAction.canceled += OnJumpCanceled;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Обработка спринта (персонаж)
|
|
||||||
var sprintAction = gameplayMap.FindAction("Sprint");
|
|
||||||
if (sprintAction != null)
|
|
||||||
{
|
|
||||||
sprintAction.performed += OnSprintPerformed;
|
|
||||||
sprintAction.canceled += OnSprintCanceled;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Обработка слайда (персонаж)
|
// Обработка слайда (персонаж)
|
||||||
var slideAction = gameplayMap.FindAction("Slide");
|
var slideAction = gameplayMap.FindAction("Slide");
|
||||||
if (slideAction != null)
|
if (slideAction != null)
|
||||||
@@ -85,6 +77,14 @@ namespace Code.Input
|
|||||||
slideAction.canceled += OnSlideCanceled;
|
slideAction.canceled += OnSlideCanceled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Обработка слайда (персонаж)
|
||||||
|
var dashAction = gameplayMap.FindAction("Dash");
|
||||||
|
if (dashAction != null)
|
||||||
|
{
|
||||||
|
dashAction.performed += OnDashPerformed;
|
||||||
|
dashAction.canceled += OnDashCanceled;
|
||||||
|
}
|
||||||
|
|
||||||
// Обработка переключения режима камеры
|
// Обработка переключения режима камеры
|
||||||
var toggleCameraModeAction = gameplayMap.FindAction("ToggleCameraMode");
|
var toggleCameraModeAction = gameplayMap.FindAction("ToggleCameraMode");
|
||||||
if (toggleCameraModeAction != null)
|
if (toggleCameraModeAction != null)
|
||||||
@@ -134,16 +134,6 @@ namespace Code.Input
|
|||||||
JumpPressed = false;
|
JumpPressed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnSprintPerformed(InputAction.CallbackContext context)
|
|
||||||
{
|
|
||||||
SprintPressed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnSprintCanceled(InputAction.CallbackContext context)
|
|
||||||
{
|
|
||||||
SprintPressed = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnSlidePerformed(InputAction.CallbackContext context)
|
private void OnSlidePerformed(InputAction.CallbackContext context)
|
||||||
{
|
{
|
||||||
SlidePressed = true;
|
SlidePressed = true;
|
||||||
@@ -154,6 +144,16 @@ namespace Code.Input
|
|||||||
SlidePressed = false;
|
SlidePressed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnDashPerformed(InputAction.CallbackContext context)
|
||||||
|
{
|
||||||
|
DashPressed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDashCanceled(InputAction.CallbackContext context)
|
||||||
|
{
|
||||||
|
DashPressed = false;
|
||||||
|
}
|
||||||
|
|
||||||
private void OnToggleCameraModePerformed(InputAction.CallbackContext context)
|
private void OnToggleCameraModePerformed(InputAction.CallbackContext context)
|
||||||
{
|
{
|
||||||
ToggleCameraModePressed = true;
|
ToggleCameraModePressed = true;
|
||||||
@@ -189,12 +189,12 @@ namespace Code.Input
|
|||||||
gameplayMap.FindAction("Jump").performed -= OnJumpPerformed;
|
gameplayMap.FindAction("Jump").performed -= OnJumpPerformed;
|
||||||
gameplayMap.FindAction("Jump").canceled -= OnJumpCanceled;
|
gameplayMap.FindAction("Jump").canceled -= OnJumpCanceled;
|
||||||
|
|
||||||
gameplayMap.FindAction("Sprint").performed -= OnSprintPerformed;
|
|
||||||
gameplayMap.FindAction("Sprint").canceled -= OnSprintCanceled;
|
|
||||||
|
|
||||||
gameplayMap.FindAction("Slide").performed -= OnSlidePerformed;
|
gameplayMap.FindAction("Slide").performed -= OnSlidePerformed;
|
||||||
gameplayMap.FindAction("Slide").canceled -= OnSlideCanceled;
|
gameplayMap.FindAction("Slide").canceled -= OnSlideCanceled;
|
||||||
|
|
||||||
|
gameplayMap.FindAction("Dash").performed -= OnDashPerformed;
|
||||||
|
gameplayMap.FindAction("Dash").canceled -= OnDashCanceled;
|
||||||
|
|
||||||
gameplayMap.FindAction("ToggleCameraMode").performed -= OnToggleCameraModePerformed;
|
gameplayMap.FindAction("ToggleCameraMode").performed -= OnToggleCameraModePerformed;
|
||||||
gameplayMap.FindAction("ToggleCameraMode").canceled -= OnToggleCameraModeCanceled;
|
gameplayMap.FindAction("ToggleCameraMode").canceled -= OnToggleCameraModeCanceled;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using Code.Gameplay.Orders.Order;
|
using Code.Gameplay.Orders.Order;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.Rendering;
|
||||||
using UnityEngine.Serialization;
|
using UnityEngine.Serialization;
|
||||||
|
|
||||||
namespace Code.Scenes.SceneEnvironments
|
namespace Code.Scenes.SceneEnvironments
|
||||||
@@ -8,10 +9,12 @@ namespace Code.Scenes.SceneEnvironments
|
|||||||
public class GameplaySceneEnvironment : CurrentSceneEnvironment
|
public class GameplaySceneEnvironment : CurrentSceneEnvironment
|
||||||
{
|
{
|
||||||
public Transform playerSpawnPoint;
|
public Transform playerSpawnPoint;
|
||||||
|
public Volume volume;
|
||||||
|
|
||||||
public void TransitVariables(GameplaySceneEnvironment env)
|
public void TransitVariables(GameplaySceneEnvironment env)
|
||||||
{
|
{
|
||||||
playerSpawnPoint = env.playerSpawnPoint;
|
playerSpawnPoint = env.playerSpawnPoint;
|
||||||
|
volume = env.volume;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -33,6 +33,8 @@ namespace Code.StaticData
|
|||||||
Dictionary<AudioSourceType, AudioSourceSettingsConfig> AudioSourceSettingsConfigs { get; }
|
Dictionary<AudioSourceType, AudioSourceSettingsConfig> AudioSourceSettingsConfigs { get; }
|
||||||
AudioTestClipsConfig AudioTestClipsConfig { get; }
|
AudioTestClipsConfig AudioTestClipsConfig { get; }
|
||||||
GeneratorConfig GeneratorConfig { get; }
|
GeneratorConfig GeneratorConfig { get; }
|
||||||
|
CourierSoundListConfig CourierSoundListConfig { get; }
|
||||||
|
DefaultAudioSettingsConfig DefaultAudioSettingsConfig { get; }
|
||||||
void Load();
|
void Load();
|
||||||
Task<T> InstantiateAsset<T>(AssetReference assetReference) where T : Behaviour;
|
Task<T> InstantiateAsset<T>(AssetReference assetReference) where T : Behaviour;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ namespace Code.StaticData
|
|||||||
public DispatcherSoundListConfig DispatcherSoundListConfig { get; private set; }
|
public DispatcherSoundListConfig DispatcherSoundListConfig { get; private set; }
|
||||||
public EnemiesSoundListConfig EnemiesSoundListConfig { get; private set; }
|
public EnemiesSoundListConfig EnemiesSoundListConfig { get; private set; }
|
||||||
public AudioTestClipsConfig AudioTestClipsConfig { get; private set; }
|
public AudioTestClipsConfig AudioTestClipsConfig { get; private set; }
|
||||||
|
public CourierSoundListConfig CourierSoundListConfig { get; private set; }
|
||||||
|
public DefaultAudioSettingsConfig DefaultAudioSettingsConfig { get; private set; }
|
||||||
|
|
||||||
public DrunkenGrandpaConfig DrunkenGrandpaConfig {get; private set;}
|
public DrunkenGrandpaConfig DrunkenGrandpaConfig {get; private set;}
|
||||||
public CockroachConfig CockroachConfig { get; private set; }
|
public CockroachConfig CockroachConfig { get; private set; }
|
||||||
@@ -66,9 +68,11 @@ namespace Code.StaticData
|
|||||||
private void LoadAudioConfigs()
|
private void LoadAudioConfigs()
|
||||||
{
|
{
|
||||||
AudioMixerConfig = Resources.Load<AudioMixerConfig>(string.Format(StringPaths.ConfigSingle, "Audio", "AudioMixerConfig"));
|
AudioMixerConfig = Resources.Load<AudioMixerConfig>(string.Format(StringPaths.ConfigSingle, "Audio", "AudioMixerConfig"));
|
||||||
|
DefaultAudioSettingsConfig = Resources.Load<DefaultAudioSettingsConfig>(string.Format(StringPaths.ConfigSingle, "Audio", "DefaultAudioSettingsConfig"));
|
||||||
SoundtrackListConfig = Resources.Load<SoundtrackListConfig>(string.Format(StringPaths.ConfigSingle, "Audio", "SoundtrackListConfig"));
|
SoundtrackListConfig = Resources.Load<SoundtrackListConfig>(string.Format(StringPaths.ConfigSingle, "Audio", "SoundtrackListConfig"));
|
||||||
AudioTestClipsConfig = Resources.Load<AudioTestClipsConfig>(string.Format(StringPaths.ConfigSingle, "Audio", "AudioTestClipsConfig"));
|
AudioTestClipsConfig = Resources.Load<AudioTestClipsConfig>(string.Format(StringPaths.ConfigSingle, "Audio", "AudioTestClipsConfig"));
|
||||||
SFXListConfig = Resources.Load<SFXListConfig>(string.Format(StringPaths.ConfigSingle, "Audio", "SFXListConfig"));
|
SFXListConfig = Resources.Load<SFXListConfig>(string.Format(StringPaths.ConfigSingle, "Audio", "SFXListConfig"));
|
||||||
|
CourierSoundListConfig = Resources.Load<CourierSoundListConfig>(string.Format(StringPaths.ConfigSingle, "Audio", "CourierSoundListConfig"));
|
||||||
DispatcherSoundListConfig = Resources.Load<DispatcherSoundListConfig>(string.Format(StringPaths.ConfigSingle, "Audio", "DispatcherSoundListConfig"));
|
DispatcherSoundListConfig = Resources.Load<DispatcherSoundListConfig>(string.Format(StringPaths.ConfigSingle, "Audio", "DispatcherSoundListConfig"));
|
||||||
EnemiesSoundListConfig = Resources.Load<EnemiesSoundListConfig>(string.Format(StringPaths.ConfigSingle, "Audio", "EnemiesSoundListConfig"));
|
EnemiesSoundListConfig = Resources.Load<EnemiesSoundListConfig>(string.Format(StringPaths.ConfigSingle, "Audio", "EnemiesSoundListConfig"));
|
||||||
AudioSourceSettingsConfigs = Resources
|
AudioSourceSettingsConfigs = Resources
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
using DG.Tweening;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
namespace Code.UI.Panels
|
||||||
|
{
|
||||||
|
public class DamagePanel : UIElement
|
||||||
|
{
|
||||||
|
[SerializeField] private Image background;
|
||||||
|
[SerializeField] private Color shownColor;
|
||||||
|
[SerializeField] private Color hiddenColor;
|
||||||
|
public override void Hide()
|
||||||
|
{
|
||||||
|
Shown = false;
|
||||||
|
// background.enabled = false;
|
||||||
|
background.DOColor(hiddenColor, 2f);
|
||||||
|
}
|
||||||
|
public override void Show()
|
||||||
|
{
|
||||||
|
Shown = true;
|
||||||
|
// background.enabled = true;
|
||||||
|
background.DOColor(shownColor, 0.3f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b586dbc292c44261892460f578a38e50
|
||||||
|
timeCreated: 1764769541
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using DG.Tweening;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
@@ -9,21 +10,27 @@ namespace Code.UI
|
|||||||
[SerializeField] private TMP_Text scoreText;
|
[SerializeField] private TMP_Text scoreText;
|
||||||
[SerializeField] private TMP_Text gameOverText;
|
[SerializeField] private TMP_Text gameOverText;
|
||||||
[SerializeField] private Image _background;
|
[SerializeField] private Image _background;
|
||||||
|
[SerializeField] private Color shownColor;
|
||||||
|
[SerializeField] private Color hiddenColor;
|
||||||
|
|
||||||
public void UpdateScoreText(int score) => scoreText.text = score.ToString();
|
public void UpdateScoreText(int score) => scoreText.text = score.ToString();
|
||||||
|
|
||||||
public override void Hide()
|
public override void Hide()
|
||||||
{
|
{
|
||||||
_background.enabled = false;
|
_background.enabled = false;
|
||||||
scoreText.enabled = false;
|
// scoreText.enabled = true;
|
||||||
gameOverText.enabled = false;
|
// gameOverText.enabled = false;
|
||||||
|
scoreText.DOColor(hiddenColor, 3f);
|
||||||
|
// gameOverText.DOColor(hiddenColor, 3f);
|
||||||
base.Hide();
|
base.Hide();
|
||||||
}
|
}
|
||||||
public override void Show()
|
public override void Show()
|
||||||
{
|
{
|
||||||
_background.enabled = true;
|
// _background.enabled = true;
|
||||||
scoreText.enabled = true;
|
// scoreText.enabled = true;
|
||||||
gameOverText.enabled = true;
|
// gameOverText.enabled = true;
|
||||||
|
scoreText.DOColor(shownColor, 5f);
|
||||||
|
// gameOverText.DOColor(shownColor, 5f);
|
||||||
base.Show();
|
base.Show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ namespace Code.UI.Panels
|
|||||||
[Header("MoneyBar")]
|
[Header("MoneyBar")]
|
||||||
[SerializeField] private TMP_Text moneyText;
|
[SerializeField] private TMP_Text moneyText;
|
||||||
|
|
||||||
|
[SerializeField] private DamagePanel damagePanel;
|
||||||
|
public DamagePanel DamagePanel => damagePanel;
|
||||||
|
|
||||||
private void ScoreUpdate(int count, int money)
|
private void ScoreUpdate(int count, int money)
|
||||||
{
|
{
|
||||||
// TODO Анимация получения\потери
|
// TODO Анимация получения\потери
|
||||||
|
|||||||
@@ -7,21 +7,27 @@ namespace Code.UI.Panels
|
|||||||
public class LoadingScreen : UIElement
|
public class LoadingScreen : UIElement
|
||||||
{
|
{
|
||||||
[SerializeField] private Image background;
|
[SerializeField] private Image background;
|
||||||
[SerializeField] private TMP_Text loadingTitle;
|
[SerializeField] private Image loadingImage;
|
||||||
[SerializeField] private TMP_Text vyapWatermark;
|
[SerializeField] private Image courierAnim;
|
||||||
|
// [SerializeField] private TMP_Text loadingTitle;
|
||||||
|
// [SerializeField] private TMP_Text vyapWatermark;
|
||||||
public override void Hide()
|
public override void Hide()
|
||||||
{
|
{
|
||||||
Shown = false;
|
Shown = false;
|
||||||
background.enabled = false;
|
background.enabled = false;
|
||||||
loadingTitle.enabled = false;
|
loadingImage.enabled = false;
|
||||||
vyapWatermark.enabled = false;
|
courierAnim.enabled = false;
|
||||||
|
// loadingTitle.enabled = false;
|
||||||
|
// vyapWatermark.enabled = false;
|
||||||
}
|
}
|
||||||
public override void Show()
|
public override void Show()
|
||||||
{
|
{
|
||||||
Shown = true;
|
Shown = true;
|
||||||
background.enabled = true;
|
background.enabled = true;
|
||||||
loadingTitle.enabled = true;
|
loadingImage.enabled = true;
|
||||||
vyapWatermark.enabled = true;
|
courierAnim.enabled = true;
|
||||||
|
// loadingTitle.enabled = true;
|
||||||
|
// vyapWatermark.enabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -14,6 +14,7 @@ namespace Code.UI
|
|||||||
[SerializeField] private Slider master;
|
[SerializeField] private Slider master;
|
||||||
[SerializeField] private Slider sfx;
|
[SerializeField] private Slider sfx;
|
||||||
[SerializeField] private Slider dispatcher;
|
[SerializeField] private Slider dispatcher;
|
||||||
|
[SerializeField] private Slider courier;
|
||||||
[SerializeField] private Slider creatures;
|
[SerializeField] private Slider creatures;
|
||||||
[SerializeField] private Slider menuMusic;
|
[SerializeField] private Slider menuMusic;
|
||||||
[SerializeField] private Slider gameplayMusic;
|
[SerializeField] private Slider gameplayMusic;
|
||||||
@@ -28,16 +29,19 @@ namespace Code.UI
|
|||||||
sfx.value = _audioService.GetSetting(AudioType.SFX);
|
sfx.value = _audioService.GetSetting(AudioType.SFX);
|
||||||
sfx.onValueChanged.AddListener(OnSFXUpdate);
|
sfx.onValueChanged.AddListener(OnSFXUpdate);
|
||||||
|
|
||||||
dispatcher.value = _audioService.GetSetting(AudioType.DispatcherSounds);
|
dispatcher.value = _audioService.GetSetting(AudioType.Dispatcher);
|
||||||
dispatcher.onValueChanged.AddListener(OnDispatcherUpdate);
|
dispatcher.onValueChanged.AddListener(OnDispatcherUpdate);
|
||||||
|
|
||||||
creatures.value = _audioService.GetSetting(AudioType.Creatures);
|
courier.value = _audioService.GetSetting(AudioType.Courier);
|
||||||
|
courier.onValueChanged.AddListener(OnCourierUpdate);
|
||||||
|
|
||||||
|
creatures.value = _audioService.GetSetting(AudioType.Enemies);
|
||||||
creatures.onValueChanged.AddListener(OnEnemiesUpdate);
|
creatures.onValueChanged.AddListener(OnEnemiesUpdate);
|
||||||
|
|
||||||
menuMusic.value = _audioService.GetSetting(AudioType.MenuMusic);
|
menuMusic.value = _audioService.GetSetting(AudioType.MenuMusic);
|
||||||
menuMusic.onValueChanged.AddListener(OnMenuMusicUpdate);
|
menuMusic.onValueChanged.AddListener(OnMenuMusicUpdate);
|
||||||
|
|
||||||
gameplayMusic.value = _audioService.GetSetting(AudioType.GameplayMusic);
|
gameplayMusic.value = _audioService.GetSetting(AudioType.ActionMusic);
|
||||||
gameplayMusic.onValueChanged.AddListener(OnGameplayUpdate);
|
gameplayMusic.onValueChanged.AddListener(OnGameplayUpdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,25 +55,32 @@ namespace Code.UI
|
|||||||
_audioService.ChangeSetting(AudioType.SFX, value);
|
_audioService.ChangeSetting(AudioType.SFX, value);
|
||||||
_audioService.PlayTestClip(AudioType.SFX);
|
_audioService.PlayTestClip(AudioType.SFX);
|
||||||
}
|
}
|
||||||
|
private void OnCourierUpdate(float value)
|
||||||
|
{
|
||||||
|
_audioService.ChangeSetting(AudioType.Courier, value);
|
||||||
|
_audioService.PlayTestClip(AudioType.Courier);
|
||||||
|
}
|
||||||
private void OnDispatcherUpdate(float value)
|
private void OnDispatcherUpdate(float value)
|
||||||
{
|
{
|
||||||
_audioService.ChangeSetting(AudioType.DispatcherSounds, value);
|
_audioService.ChangeSetting(AudioType.Dispatcher, value);
|
||||||
_audioService.PlayTestClip(AudioType.DispatcherSounds);
|
_audioService.PlayTestClip(AudioType.Dispatcher);
|
||||||
}
|
}
|
||||||
private void OnEnemiesUpdate(float value)
|
private void OnEnemiesUpdate(float value)
|
||||||
{
|
{
|
||||||
_audioService.ChangeSetting(AudioType.Creatures, value);
|
_audioService.ChangeSetting(AudioType.Enemies, value);
|
||||||
_audioService.PlayTestClip(AudioType.Creatures);
|
_audioService.PlayTestClip(AudioType.Enemies);
|
||||||
}
|
}
|
||||||
private void OnMenuMusicUpdate(float value)
|
private void OnMenuMusicUpdate(float value)
|
||||||
{
|
{
|
||||||
_audioService.ChangeSetting(AudioType.MenuMusic, value);
|
_audioService.ChangeSetting(AudioType.MenuMusic, value);
|
||||||
|
_audioService.ChangeSetting(AudioType.DeathMusic, value);
|
||||||
_audioService.PlayTestClip(AudioType.MenuMusic);
|
_audioService.PlayTestClip(AudioType.MenuMusic);
|
||||||
}
|
}
|
||||||
private void OnGameplayUpdate(float value)
|
private void OnGameplayUpdate(float value)
|
||||||
{
|
{
|
||||||
_audioService.ChangeSetting(AudioType.GameplayMusic, value);
|
_audioService.ChangeSetting(AudioType.ActionMusic, value);
|
||||||
_audioService.PlayTestClip(AudioType.GameplayMusic);
|
_audioService.ChangeSetting(AudioType.PeacefulMusic, value);
|
||||||
|
_audioService.PlayTestClip(AudioType.ActionMusic);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Hide()
|
public override void Hide()
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 1ce80ea58c1a9154dab0a2f539b9b2a4
|
guid: 45b4aa0e7c33e934493bb7d2a15a9add
|
||||||
folderAsset: yes
|
folderAsset: yes
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
+2
-1
@@ -1,5 +1,6 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: f0a1f49824855efb0b1ffb2916cbeea9
|
guid: 767316a9a37abc34694c3086d846f668
|
||||||
|
folderAsset: yes
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 43bd94852ddc6b34dbe9fec318fb54d8
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"name": "AYellowpaper.SerializedCollections.Editor",
|
||||||
|
"references": [
|
||||||
|
"GUID:d525ad6bd40672747bde77962f1c401e"
|
||||||
|
],
|
||||||
|
"includePlatforms": [
|
||||||
|
"Editor"
|
||||||
|
],
|
||||||
|
"excludePlatforms": [],
|
||||||
|
"allowUnsafeCode": false,
|
||||||
|
"overrideReferences": false,
|
||||||
|
"precompiledReferences": [],
|
||||||
|
"autoReferenced": true,
|
||||||
|
"defineConstraints": [],
|
||||||
|
"versionDefines": [],
|
||||||
|
"noEngineReferences": false
|
||||||
|
}
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 234340c04eed5674a988bc6ebde7d248
|
||||||
|
AssemblyDefinitionImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
AssetOrigin:
|
||||||
|
serializedVersion: 1
|
||||||
|
productId: 243052
|
||||||
|
packageName: Serialized Dictionary
|
||||||
|
packageVersion: 1.0.13
|
||||||
|
assetPath: Assets/Plugins/SerializedCollections/Editor/AYellowpaper.SerializedCollections.Editor.asmdef
|
||||||
|
uploadId: 632226
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: edb739dfb1824234681f6480c75cd523
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
Binary file not shown.
Loaded 100 of 524 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user