From 49d9ebb808eb0018b612736f164160ef6fb8c128 Mon Sep 17 00:00:00 2001 From: xandudex Date: Tue, 5 Nov 2024 11:55:04 +0200 Subject: [PATCH] Refactoring Updated folder structure Updated codebase --- Assets/_Game/{Animals.meta => Configs.meta} | 2 +- Assets/_Game/Configs/Effects Config.asset | 16 ++ .../_Game/Configs/Effects Config.asset.meta | 8 + .../Resources Config.asset | 0 .../Resources Config.asset.meta | 0 .../Simulation Config.asset | 0 .../Simulation Config.asset.meta | 0 .../{Settings => Configs}/VContainer.meta | 0 .../VContainer/Root Container.prefab | 1 + .../VContainer/Root Container.prefab.meta | 0 .../VContainer/VContainerSettings.asset | 0 .../VContainer/VContainerSettings.asset.meta | 0 Assets/_Game/{Food.meta => Effects.meta} | 0 .../{Food => Effects}/food_collect_vfx.vfx | 0 .../food_collect_vfx.vfx.meta | 0 Assets/_Game/{Resources.meta => Prefabs.meta} | 2 +- .../{Animals => Prefabs}/Animal Prefab.prefab | 0 .../Animal Prefab.prefab.meta | 0 .../{Food => Prefabs}/Food Prefab.prefab | 83 --------- .../{Food => Prefabs}/Food Prefab.prefab.meta | 0 .../_Game/Prefabs/Visual Effect Prefab.prefab | 116 ++++++++++++ .../Prefabs/Visual Effect Prefab.prefab.meta | 7 + Assets/_Game/Scenes/Bootstrap Scene.unity | 165 +++--------------- Assets/_Game/Scenes/Game Scene.unity | 6 +- Assets/_Game/Scenes/Menu Scene.unity | 22 +-- ...niversalRenderPipelineGlobalSettings.asset | 13 +- Assets/_Game/_Code/Infrastructure/Data.meta | 8 + .../_Code/Infrastructure/Data/Effects.meta | 8 + .../Data/Effects/EffectsConfig.cs | 15 ++ .../Data/Effects/EffectsConfig.cs.meta | 2 + .../{Services => Data}/GameResources.meta | 0 .../GameResources/GameResourcesConfig.cs | 4 +- .../GameResources/GameResourcesConfig.cs.meta | 0 .../{Services => Data}/Simulation.meta | 2 +- .../Data}/Simulation/SimulationConfig.cs | 2 +- .../Data}/Simulation/SimulationConfig.cs.meta | 0 .../Infrastructure/Factories/GameFactory.cs | 26 +-- .../Installers/ProjectLifetimeScope.cs | 36 ---- .../{Installers.meta => Scopes.meta} | 0 .../GameLifetimeScope.cs | 16 +- .../GameLifetimeScope.cs.meta | 0 .../Scopes/ProjectLifetimeScope.cs | 46 +++++ .../ProjectLifetimeScope.cs.meta | 0 .../SimulationMenuLifetimeScope.cs | 4 +- .../SimulationMenuLifetimeScope.cs.meta | 0 .../Infrastructure/Services/Effects.meta | 8 + .../Services/Effects/EffectsService.cs | 46 +++++ .../Services/Effects/EffectsService.cs.meta | 2 + .../Services/Effects/IEffectsService.cs | 12 ++ .../Services/Effects/IEffectsService.cs.meta | 2 + .../Services/GameResources/GameResources.cs | 16 -- .../GameResources/GameResources.cs.meta | 2 - .../Services/GameResources/IGameResources.cs | 10 -- .../GameResources/IGameResources.cs.meta | 2 - .../Infrastructure/Services/Save/ISaveData.cs | 2 +- .../Services/Save/ISaveService.cs | 2 +- .../Services/Save/SaveService.cs | 11 +- .../Services/SceneLoader/ISceneLoader.cs | 12 -- .../Services/SceneLoader/ISceneLoader.cs.meta | 2 - .../SceneLoader/ISceneLoaderService.cs | 17 ++ .../SceneLoader/ISceneLoaderService.cs.meta | 2 + .../Services/SceneLoader/SceneLoader.cs.meta | 2 - .../{SceneLoader.cs => SceneLoaderService.cs} | 39 ++--- .../SceneLoader/SceneLoaderService.cs.meta | 2 + Assets/_Game/_Code/Systems.meta | 8 + Assets/_Game/_Code/Systems/Bootsrapping.meta | 8 + .../Systems/Bootsrapping/GameBootsrapper.cs | 15 ++ .../Bootsrapping/GameBootsrapper.cs.meta | 2 + .../_Game/_Code/{ => Systems}/Simulation.meta | 0 .../{ => Systems}/Simulation/Animals.meta | 0 .../Simulation/Animals/Animal.Mover.cs | 2 +- .../Simulation/Animals/Animal.Mover.cs.meta | 0 .../Simulation/Animals/Animal.cs | 5 +- .../Simulation/Animals/Animal.cs.meta | 0 .../Simulation/Animals/AnimalSpawner.cs | 15 +- .../Simulation/Animals/AnimalSpawner.cs.meta | 0 .../Simulation/Animals/AnimalSpawnerConfig.cs | 2 +- .../Animals/AnimalSpawnerConfig.cs.meta | 0 .../Simulation/Animals/States.meta | 0 .../Animals/States/BaseAnimalState.cs | 2 +- .../Animals/States/BaseAnimalState.cs.meta | 0 .../Animals/States/EatingFoodAnimalState.cs | 8 +- .../States/EatingFoodAnimalState.cs.meta | 0 .../Animals/States/MovingToFoodAnimalState.cs | 2 +- .../States/MovingToFoodAnimalState.cs.meta | 0 .../Animals/States/SearchFoodAnimalState.cs | 2 +- .../States/SearchFoodAnimalState.cs.meta | 0 .../Animals/States/SpawnAnimalState.cs | 2 +- .../Animals/States/SpawnAnimalState.cs.meta | 0 .../Simulation/CameraMovement.cs | 2 +- .../Simulation/CameraMovement.cs.meta | 0 .../_Code/{ => Systems}/Simulation/Food.meta | 0 .../{ => Systems}/Simulation/Food/Food.cs | 19 +- .../Simulation/Food/Food.cs.meta | 0 .../Simulation/Food/FoodSpawner.cs | 14 +- .../Simulation/Food/FoodSpawner.cs.meta | 0 .../Simulation/Food/FoodSpawnerConfig.cs | 2 +- .../Simulation/Food/FoodSpawnerConfig.cs.meta | 0 .../{ => Systems}/Simulation/GameBoard.meta | 0 .../Simulation/GameBoard/GameBoard.cs | 17 +- .../Simulation/GameBoard/GameBoard.cs.meta | 0 .../Simulation/GameBoard/GameBoardConfig.cs | 2 +- .../GameBoard/GameBoardConfig.cs.meta | 0 .../Simulation/GameBoard/GameBoardView.cs | 2 +- .../GameBoard/GameBoardView.cs.meta | 0 .../Simulation/SimulationSettings.cs | 5 +- .../Simulation/SimulationSettings.cs.meta | 0 .../Simulation/SimulationSystemMessages.cs | 7 + .../SimulationSystemMessages.cs.meta | 2 + Assets/_Game/_Code/UI.meta | 8 + Assets/_Game/_Code/UI/Components.meta | 8 + .../Components}/ExtendedSlider.cs | 2 +- .../Components}/ExtendedSlider.cs.meta | 0 .../{SimulationMenu.meta => UI/MainMenu.meta} | 0 .../MainMenu}/SimulationSettingsModel.cs | 5 +- .../MainMenu}/SimulationSettingsModel.cs.meta | 0 .../MainMenu}/SimulationSettingsPresenter.cs | 12 +- .../SimulationSettingsPresenter.cs.meta | 0 .../MainMenu}/SimulationSettingsView.cs | 2 +- .../MainMenu}/SimulationSettingsView.cs.meta | 0 .../UI.meta => UI/SimulationHud.meta} | 0 .../SimulationHud}/SimulationUiPresenter.cs | 8 +- .../SimulationUiPresenter.cs.meta | 0 .../SimulationHud}/SimulationUiView.cs | 2 +- .../SimulationHud}/SimulationUiView.cs.meta | 0 .../_Code/{Utility.meta => Utilities.meta} | 0 .../Important.meta | 0 .../Important/IsExternalInit.cs | 0 .../Important/IsExternalInit.cs.meta | 0 Assets/_Game/_Code/Utilities/Service.cs | 26 +++ Assets/_Game/_Code/Utilities/Service.cs.meta | 2 + .../{Utility => Utilities}/StateMachine.meta | 0 .../StateMachine/IExitableState.cs | 0 .../StateMachine/IExitableState.cs.meta | 0 .../StateMachine/IPayloadedState.cs | 0 .../StateMachine/IPayloadedState.cs.meta | 0 .../StateMachine/IState.cs | 0 .../StateMachine/IState.cs.meta | 0 .../StateMachine/IStateMachine.cs | 0 .../StateMachine/IStateMachine.cs.meta | 0 Packages/manifest.json | 9 +- Packages/packages-lock.json | 28 +-- ProjectSettings/EditorBuildSettings.asset | 6 +- ProjectSettings/ProjectVersion.txt | 4 +- 144 files changed, 601 insertions(+), 467 deletions(-) rename Assets/_Game/{Animals.meta => Configs.meta} (77%) create mode 100644 Assets/_Game/Configs/Effects Config.asset create mode 100644 Assets/_Game/Configs/Effects Config.asset.meta rename Assets/_Game/{Resources => Configs}/Resources Config.asset (100%) rename Assets/_Game/{Resources => Configs}/Resources Config.asset.meta (100%) rename Assets/_Game/{Settings => Configs}/Simulation Config.asset (100%) rename Assets/_Game/{Settings => Configs}/Simulation Config.asset.meta (100%) rename Assets/_Game/{Settings => Configs}/VContainer.meta (100%) rename Assets/_Game/{Settings => Configs}/VContainer/Root Container.prefab (93%) rename Assets/_Game/{Settings => Configs}/VContainer/Root Container.prefab.meta (100%) rename Assets/_Game/{Settings => Configs}/VContainer/VContainerSettings.asset (100%) rename Assets/_Game/{Settings => Configs}/VContainer/VContainerSettings.asset.meta (100%) rename Assets/_Game/{Food.meta => Effects.meta} (100%) rename Assets/_Game/{Food => Effects}/food_collect_vfx.vfx (100%) rename Assets/_Game/{Food => Effects}/food_collect_vfx.vfx.meta (100%) rename Assets/_Game/{Resources.meta => Prefabs.meta} (77%) rename Assets/_Game/{Animals => Prefabs}/Animal Prefab.prefab (100%) rename Assets/_Game/{Animals => Prefabs}/Animal Prefab.prefab.meta (100%) rename Assets/_Game/{Food => Prefabs}/Food Prefab.prefab (62%) rename Assets/_Game/{Food => Prefabs}/Food Prefab.prefab.meta (100%) create mode 100644 Assets/_Game/Prefabs/Visual Effect Prefab.prefab create mode 100644 Assets/_Game/Prefabs/Visual Effect Prefab.prefab.meta create mode 100644 Assets/_Game/_Code/Infrastructure/Data.meta create mode 100644 Assets/_Game/_Code/Infrastructure/Data/Effects.meta create mode 100644 Assets/_Game/_Code/Infrastructure/Data/Effects/EffectsConfig.cs create mode 100644 Assets/_Game/_Code/Infrastructure/Data/Effects/EffectsConfig.cs.meta rename Assets/_Game/_Code/Infrastructure/{Services => Data}/GameResources.meta (100%) rename Assets/_Game/_Code/Infrastructure/{Services => Data}/GameResources/GameResourcesConfig.cs (64%) rename Assets/_Game/_Code/Infrastructure/{Services => Data}/GameResources/GameResourcesConfig.cs.meta (100%) rename Assets/_Game/_Code/Infrastructure/{Services => Data}/Simulation.meta (77%) rename Assets/_Game/_Code/{ => Infrastructure/Data}/Simulation/SimulationConfig.cs (96%) rename Assets/_Game/_Code/{ => Infrastructure/Data}/Simulation/SimulationConfig.cs.meta (100%) delete mode 100644 Assets/_Game/_Code/Infrastructure/Installers/ProjectLifetimeScope.cs rename Assets/_Game/_Code/Infrastructure/{Installers.meta => Scopes.meta} (100%) rename Assets/_Game/_Code/Infrastructure/{Installers => Scopes}/GameLifetimeScope.cs (83%) rename Assets/_Game/_Code/Infrastructure/{Installers => Scopes}/GameLifetimeScope.cs.meta (100%) create mode 100644 Assets/_Game/_Code/Infrastructure/Scopes/ProjectLifetimeScope.cs rename Assets/_Game/_Code/Infrastructure/{Installers => Scopes}/ProjectLifetimeScope.cs.meta (100%) rename Assets/_Game/_Code/Infrastructure/{Installers => Scopes}/SimulationMenuLifetimeScope.cs (89%) rename Assets/_Game/_Code/Infrastructure/{Installers => Scopes}/SimulationMenuLifetimeScope.cs.meta (100%) create mode 100644 Assets/_Game/_Code/Infrastructure/Services/Effects.meta create mode 100644 Assets/_Game/_Code/Infrastructure/Services/Effects/EffectsService.cs create mode 100644 Assets/_Game/_Code/Infrastructure/Services/Effects/EffectsService.cs.meta create mode 100644 Assets/_Game/_Code/Infrastructure/Services/Effects/IEffectsService.cs create mode 100644 Assets/_Game/_Code/Infrastructure/Services/Effects/IEffectsService.cs.meta delete mode 100644 Assets/_Game/_Code/Infrastructure/Services/GameResources/GameResources.cs delete mode 100644 Assets/_Game/_Code/Infrastructure/Services/GameResources/GameResources.cs.meta delete mode 100644 Assets/_Game/_Code/Infrastructure/Services/GameResources/IGameResources.cs delete mode 100644 Assets/_Game/_Code/Infrastructure/Services/GameResources/IGameResources.cs.meta delete mode 100644 Assets/_Game/_Code/Infrastructure/Services/SceneLoader/ISceneLoader.cs delete mode 100644 Assets/_Game/_Code/Infrastructure/Services/SceneLoader/ISceneLoader.cs.meta create mode 100644 Assets/_Game/_Code/Infrastructure/Services/SceneLoader/ISceneLoaderService.cs create mode 100644 Assets/_Game/_Code/Infrastructure/Services/SceneLoader/ISceneLoaderService.cs.meta delete mode 100644 Assets/_Game/_Code/Infrastructure/Services/SceneLoader/SceneLoader.cs.meta rename Assets/_Game/_Code/Infrastructure/Services/SceneLoader/{SceneLoader.cs => SceneLoaderService.cs} (50%) create mode 100644 Assets/_Game/_Code/Infrastructure/Services/SceneLoader/SceneLoaderService.cs.meta create mode 100644 Assets/_Game/_Code/Systems.meta create mode 100644 Assets/_Game/_Code/Systems/Bootsrapping.meta create mode 100644 Assets/_Game/_Code/Systems/Bootsrapping/GameBootsrapper.cs create mode 100644 Assets/_Game/_Code/Systems/Bootsrapping/GameBootsrapper.cs.meta rename Assets/_Game/_Code/{ => Systems}/Simulation.meta (100%) rename Assets/_Game/_Code/{ => Systems}/Simulation/Animals.meta (100%) rename Assets/_Game/_Code/{ => Systems}/Simulation/Animals/Animal.Mover.cs (97%) rename Assets/_Game/_Code/{ => Systems}/Simulation/Animals/Animal.Mover.cs.meta (100%) rename Assets/_Game/_Code/{ => Systems}/Simulation/Animals/Animal.cs (96%) rename Assets/_Game/_Code/{ => Systems}/Simulation/Animals/Animal.cs.meta (100%) rename Assets/_Game/_Code/{ => Systems}/Simulation/Animals/AnimalSpawner.cs (90%) rename Assets/_Game/_Code/{ => Systems}/Simulation/Animals/AnimalSpawner.cs.meta (100%) rename Assets/_Game/_Code/{ => Systems}/Simulation/Animals/AnimalSpawnerConfig.cs (84%) rename Assets/_Game/_Code/{ => Systems}/Simulation/Animals/AnimalSpawnerConfig.cs.meta (100%) rename Assets/_Game/_Code/{ => Systems}/Simulation/Animals/States.meta (100%) rename Assets/_Game/_Code/{ => Systems}/Simulation/Animals/States/BaseAnimalState.cs (89%) rename Assets/_Game/_Code/{ => Systems}/Simulation/Animals/States/BaseAnimalState.cs.meta (100%) rename Assets/_Game/_Code/{ => Systems}/Simulation/Animals/States/EatingFoodAnimalState.cs (62%) rename Assets/_Game/_Code/{ => Systems}/Simulation/Animals/States/EatingFoodAnimalState.cs.meta (100%) rename Assets/_Game/_Code/{ => Systems}/Simulation/Animals/States/MovingToFoodAnimalState.cs (93%) rename Assets/_Game/_Code/{ => Systems}/Simulation/Animals/States/MovingToFoodAnimalState.cs.meta (100%) rename Assets/_Game/_Code/{ => Systems}/Simulation/Animals/States/SearchFoodAnimalState.cs (96%) rename Assets/_Game/_Code/{ => Systems}/Simulation/Animals/States/SearchFoodAnimalState.cs.meta (100%) rename Assets/_Game/_Code/{ => Systems}/Simulation/Animals/States/SpawnAnimalState.cs (91%) rename Assets/_Game/_Code/{ => Systems}/Simulation/Animals/States/SpawnAnimalState.cs.meta (100%) rename Assets/_Game/_Code/{ => Systems}/Simulation/CameraMovement.cs (96%) rename Assets/_Game/_Code/{ => Systems}/Simulation/CameraMovement.cs.meta (100%) rename Assets/_Game/_Code/{ => Systems}/Simulation/Food.meta (100%) rename Assets/_Game/_Code/{ => Systems}/Simulation/Food/Food.cs (59%) rename Assets/_Game/_Code/{ => Systems}/Simulation/Food/Food.cs.meta (100%) rename Assets/_Game/_Code/{ => Systems}/Simulation/Food/FoodSpawner.cs (93%) rename Assets/_Game/_Code/{ => Systems}/Simulation/Food/FoodSpawner.cs.meta (100%) rename Assets/_Game/_Code/{ => Systems}/Simulation/Food/FoodSpawnerConfig.cs (89%) rename Assets/_Game/_Code/{ => Systems}/Simulation/Food/FoodSpawnerConfig.cs.meta (100%) rename Assets/_Game/_Code/{ => Systems}/Simulation/GameBoard.meta (100%) rename Assets/_Game/_Code/{ => Systems}/Simulation/GameBoard/GameBoard.cs (76%) rename Assets/_Game/_Code/{ => Systems}/Simulation/GameBoard/GameBoard.cs.meta (100%) rename Assets/_Game/_Code/{ => Systems}/Simulation/GameBoard/GameBoardConfig.cs (72%) rename Assets/_Game/_Code/{ => Systems}/Simulation/GameBoard/GameBoardConfig.cs.meta (100%) rename Assets/_Game/_Code/{ => Systems}/Simulation/GameBoard/GameBoardView.cs (90%) rename Assets/_Game/_Code/{ => Systems}/Simulation/GameBoard/GameBoardView.cs.meta (100%) rename Assets/_Game/_Code/{ => Systems}/Simulation/SimulationSettings.cs (87%) rename Assets/_Game/_Code/{ => Systems}/Simulation/SimulationSettings.cs.meta (100%) create mode 100644 Assets/_Game/_Code/Systems/Simulation/SimulationSystemMessages.cs create mode 100644 Assets/_Game/_Code/Systems/Simulation/SimulationSystemMessages.cs.meta create mode 100644 Assets/_Game/_Code/UI.meta create mode 100644 Assets/_Game/_Code/UI/Components.meta rename Assets/_Game/_Code/{SimulationMenu => UI/Components}/ExtendedSlider.cs (98%) rename Assets/_Game/_Code/{SimulationMenu => UI/Components}/ExtendedSlider.cs.meta (100%) rename Assets/_Game/_Code/{SimulationMenu.meta => UI/MainMenu.meta} (100%) rename Assets/_Game/_Code/{SimulationMenu => UI/MainMenu}/SimulationSettingsModel.cs (84%) rename Assets/_Game/_Code/{SimulationMenu => UI/MainMenu}/SimulationSettingsModel.cs.meta (100%) rename Assets/_Game/_Code/{SimulationMenu => UI/MainMenu}/SimulationSettingsPresenter.cs (92%) rename Assets/_Game/_Code/{SimulationMenu => UI/MainMenu}/SimulationSettingsPresenter.cs.meta (100%) rename Assets/_Game/_Code/{SimulationMenu => UI/MainMenu}/SimulationSettingsView.cs (95%) rename Assets/_Game/_Code/{SimulationMenu => UI/MainMenu}/SimulationSettingsView.cs.meta (100%) rename Assets/_Game/_Code/{Simulation/UI.meta => UI/SimulationHud.meta} (100%) rename Assets/_Game/_Code/{Simulation/UI => UI/SimulationHud}/SimulationUiPresenter.cs (86%) rename Assets/_Game/_Code/{Simulation/UI => UI/SimulationHud}/SimulationUiPresenter.cs.meta (100%) rename Assets/_Game/_Code/{Simulation/UI => UI/SimulationHud}/SimulationUiView.cs (92%) rename Assets/_Game/_Code/{Simulation/UI => UI/SimulationHud}/SimulationUiView.cs.meta (100%) rename Assets/_Game/_Code/{Utility.meta => Utilities.meta} (100%) rename Assets/_Game/_Code/{Infrastructure => Utilities}/Important.meta (100%) rename Assets/_Game/_Code/{Infrastructure => Utilities}/Important/IsExternalInit.cs (100%) rename Assets/_Game/_Code/{Infrastructure => Utilities}/Important/IsExternalInit.cs.meta (100%) create mode 100644 Assets/_Game/_Code/Utilities/Service.cs create mode 100644 Assets/_Game/_Code/Utilities/Service.cs.meta rename Assets/_Game/_Code/{Utility => Utilities}/StateMachine.meta (100%) rename Assets/_Game/_Code/{Utility => Utilities}/StateMachine/IExitableState.cs (100%) rename Assets/_Game/_Code/{Utility => Utilities}/StateMachine/IExitableState.cs.meta (100%) rename Assets/_Game/_Code/{Utility => Utilities}/StateMachine/IPayloadedState.cs (100%) rename Assets/_Game/_Code/{Utility => Utilities}/StateMachine/IPayloadedState.cs.meta (100%) rename Assets/_Game/_Code/{Utility => Utilities}/StateMachine/IState.cs (100%) rename Assets/_Game/_Code/{Utility => Utilities}/StateMachine/IState.cs.meta (100%) rename Assets/_Game/_Code/{Utility => Utilities}/StateMachine/IStateMachine.cs (100%) rename Assets/_Game/_Code/{Utility => Utilities}/StateMachine/IStateMachine.cs.meta (100%) diff --git a/Assets/_Game/Animals.meta b/Assets/_Game/Configs.meta similarity index 77% rename from Assets/_Game/Animals.meta rename to Assets/_Game/Configs.meta index c540e41..59e486b 100644 --- a/Assets/_Game/Animals.meta +++ b/Assets/_Game/Configs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 888a215e3b1ab7842856553a3c581efe +guid: 8b9293ba13817a7458cd12906aeb4292 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/_Game/Configs/Effects Config.asset b/Assets/_Game/Configs/Effects Config.asset new file mode 100644 index 0000000..6cb2a1a --- /dev/null +++ b/Assets/_Game/Configs/Effects Config.asset @@ -0,0 +1,16 @@ +%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: 08eaed2fa10ab63469c729fbe0f612cf, type: 3} + m_Name: Effects Config + m_EditorClassIdentifier: + k__BackingField: {fileID: -1544216981232568923, guid: 5d2b24aa35ff30e4686199b6c909e3f5, type: 3} + k__BackingField: {fileID: 8926484042661614526, guid: 6ddde6326052c8f469ad795f031f426b, type: 3} diff --git a/Assets/_Game/Configs/Effects Config.asset.meta b/Assets/_Game/Configs/Effects Config.asset.meta new file mode 100644 index 0000000..fd48012 --- /dev/null +++ b/Assets/_Game/Configs/Effects Config.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1a9fa2922e48c624580b64fcb079cde5 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Game/Resources/Resources Config.asset b/Assets/_Game/Configs/Resources Config.asset similarity index 100% rename from Assets/_Game/Resources/Resources Config.asset rename to Assets/_Game/Configs/Resources Config.asset diff --git a/Assets/_Game/Resources/Resources Config.asset.meta b/Assets/_Game/Configs/Resources Config.asset.meta similarity index 100% rename from Assets/_Game/Resources/Resources Config.asset.meta rename to Assets/_Game/Configs/Resources Config.asset.meta diff --git a/Assets/_Game/Settings/Simulation Config.asset b/Assets/_Game/Configs/Simulation Config.asset similarity index 100% rename from Assets/_Game/Settings/Simulation Config.asset rename to Assets/_Game/Configs/Simulation Config.asset diff --git a/Assets/_Game/Settings/Simulation Config.asset.meta b/Assets/_Game/Configs/Simulation Config.asset.meta similarity index 100% rename from Assets/_Game/Settings/Simulation Config.asset.meta rename to Assets/_Game/Configs/Simulation Config.asset.meta diff --git a/Assets/_Game/Settings/VContainer.meta b/Assets/_Game/Configs/VContainer.meta similarity index 100% rename from Assets/_Game/Settings/VContainer.meta rename to Assets/_Game/Configs/VContainer.meta diff --git a/Assets/_Game/Settings/VContainer/Root Container.prefab b/Assets/_Game/Configs/VContainer/Root Container.prefab similarity index 93% rename from Assets/_Game/Settings/VContainer/Root Container.prefab rename to Assets/_Game/Configs/VContainer/Root Container.prefab index e8a75e3..5cc202d 100644 --- a/Assets/_Game/Settings/VContainer/Root Container.prefab +++ b/Assets/_Game/Configs/VContainer/Root Container.prefab @@ -48,3 +48,4 @@ MonoBehaviour: TypeName: autoRun: 1 autoInjectGameObjects: [] + gameResourcesConfig: {fileID: 11400000, guid: 803398ff03a81e14b9421a8bef96c6b4, type: 2} diff --git a/Assets/_Game/Settings/VContainer/Root Container.prefab.meta b/Assets/_Game/Configs/VContainer/Root Container.prefab.meta similarity index 100% rename from Assets/_Game/Settings/VContainer/Root Container.prefab.meta rename to Assets/_Game/Configs/VContainer/Root Container.prefab.meta diff --git a/Assets/_Game/Settings/VContainer/VContainerSettings.asset b/Assets/_Game/Configs/VContainer/VContainerSettings.asset similarity index 100% rename from Assets/_Game/Settings/VContainer/VContainerSettings.asset rename to Assets/_Game/Configs/VContainer/VContainerSettings.asset diff --git a/Assets/_Game/Settings/VContainer/VContainerSettings.asset.meta b/Assets/_Game/Configs/VContainer/VContainerSettings.asset.meta similarity index 100% rename from Assets/_Game/Settings/VContainer/VContainerSettings.asset.meta rename to Assets/_Game/Configs/VContainer/VContainerSettings.asset.meta diff --git a/Assets/_Game/Food.meta b/Assets/_Game/Effects.meta similarity index 100% rename from Assets/_Game/Food.meta rename to Assets/_Game/Effects.meta diff --git a/Assets/_Game/Food/food_collect_vfx.vfx b/Assets/_Game/Effects/food_collect_vfx.vfx similarity index 100% rename from Assets/_Game/Food/food_collect_vfx.vfx rename to Assets/_Game/Effects/food_collect_vfx.vfx diff --git a/Assets/_Game/Food/food_collect_vfx.vfx.meta b/Assets/_Game/Effects/food_collect_vfx.vfx.meta similarity index 100% rename from Assets/_Game/Food/food_collect_vfx.vfx.meta rename to Assets/_Game/Effects/food_collect_vfx.vfx.meta diff --git a/Assets/_Game/Resources.meta b/Assets/_Game/Prefabs.meta similarity index 77% rename from Assets/_Game/Resources.meta rename to Assets/_Game/Prefabs.meta index 2f9986e..7dc166d 100644 --- a/Assets/_Game/Resources.meta +++ b/Assets/_Game/Prefabs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c6f4d818b71f4d04f96808074543b577 +guid: a6893c1c12cd02841abefc0d6bffd726 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/_Game/Animals/Animal Prefab.prefab b/Assets/_Game/Prefabs/Animal Prefab.prefab similarity index 100% rename from Assets/_Game/Animals/Animal Prefab.prefab rename to Assets/_Game/Prefabs/Animal Prefab.prefab diff --git a/Assets/_Game/Animals/Animal Prefab.prefab.meta b/Assets/_Game/Prefabs/Animal Prefab.prefab.meta similarity index 100% rename from Assets/_Game/Animals/Animal Prefab.prefab.meta rename to Assets/_Game/Prefabs/Animal Prefab.prefab.meta diff --git a/Assets/_Game/Food/Food Prefab.prefab b/Assets/_Game/Prefabs/Food Prefab.prefab similarity index 62% rename from Assets/_Game/Food/Food Prefab.prefab rename to Assets/_Game/Prefabs/Food Prefab.prefab index 3362c82..f67ce91 100644 --- a/Assets/_Game/Food/Food Prefab.prefab +++ b/Assets/_Game/Prefabs/Food Prefab.prefab @@ -95,8 +95,6 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 6394835160015690068} - - component: {fileID: 3525361554179503999} - - component: {fileID: 9180127156026674136} m_Layer: 0 m_Name: Food Prefab m_TagString: Untagged @@ -120,84 +118,3 @@ Transform: - {fileID: 2145061254620934256} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!73398921 &3525361554179503999 -VFXRenderer: - serializedVersion: 1 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6858286771759742821} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_DynamicOccludee: 1 - m_StaticShadowCaster: 0 - m_MotionVectors: 0 - m_LightProbeUsage: 0 - m_ReflectionProbeUsage: 0 - m_RayTracingMode: 0 - m_RayTraceProcedural: 0 - m_RayTracingAccelStructBuildFlagsOverride: 0 - m_RayTracingAccelStructBuildFlags: 1 - m_SmallMeshCulling: 1 - m_RenderingLayerMask: 1 - m_RendererPriority: 0 - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_ReceiveGI: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 1 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!2083052967 &9180127156026674136 -VisualEffect: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6858286771759742821} - m_Enabled: 1 - m_Asset: {fileID: 8926484042661614526, guid: 6ddde6326052c8f469ad795f031f426b, type: 3} - m_InitialEventName: - m_InitialEventNameOverriden: 1 - m_StartSeed: 0 - m_ResetSeedOnPlay: 1 - m_AllowInstancing: 1 - m_ResourceVersion: 1 - m_PropertySheet: - m_Float: - m_Array: [] - m_Vector2f: - m_Array: [] - m_Vector3f: - m_Array: [] - m_Vector4f: - m_Array: [] - m_Uint: - m_Array: [] - m_Int: - m_Array: [] - m_Matrix4x4f: - m_Array: [] - m_AnimationCurve: - m_Array: [] - m_Gradient: - m_Array: [] - m_NamedObject: - m_Array: [] - m_Bool: - m_Array: [] diff --git a/Assets/_Game/Food/Food Prefab.prefab.meta b/Assets/_Game/Prefabs/Food Prefab.prefab.meta similarity index 100% rename from Assets/_Game/Food/Food Prefab.prefab.meta rename to Assets/_Game/Prefabs/Food Prefab.prefab.meta diff --git a/Assets/_Game/Prefabs/Visual Effect Prefab.prefab b/Assets/_Game/Prefabs/Visual Effect Prefab.prefab new file mode 100644 index 0000000..0f618e4 --- /dev/null +++ b/Assets/_Game/Prefabs/Visual Effect Prefab.prefab @@ -0,0 +1,116 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &7642071725540407326 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3563465379897113294} + - component: {fileID: -1544216981232568923} + - component: {fileID: 1624984301691632579} + m_Layer: 0 + m_Name: Visual Effect Prefab + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3563465379897113294 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7642071725540407326} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!2083052967 &-1544216981232568923 +VisualEffect: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7642071725540407326} + m_Enabled: 1 + m_Asset: {fileID: 0} + m_InitialEventName: + m_InitialEventNameOverriden: 1 + m_StartSeed: 0 + m_ResetSeedOnPlay: 1 + m_AllowInstancing: 1 + m_ResourceVersion: 1 + m_PropertySheet: + m_Float: + m_Array: [] + m_Vector2f: + m_Array: [] + m_Vector3f: + m_Array: [] + m_Vector4f: + m_Array: [] + m_Uint: + m_Array: [] + m_Int: + m_Array: [] + m_Matrix4x4f: + m_Array: [] + m_AnimationCurve: + m_Array: [] + m_Gradient: + m_Array: [] + m_NamedObject: + m_Array: [] + m_Bool: + m_Array: [] +--- !u!73398921 &1624984301691632579 +VFXRenderer: + serializedVersion: 1 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7642071725540407326} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 diff --git a/Assets/_Game/Prefabs/Visual Effect Prefab.prefab.meta b/Assets/_Game/Prefabs/Visual Effect Prefab.prefab.meta new file mode 100644 index 0000000..84e5f74 --- /dev/null +++ b/Assets/_Game/Prefabs/Visual Effect Prefab.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5d2b24aa35ff30e4686199b6c909e3f5 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Game/Scenes/Bootstrap Scene.unity b/Assets/_Game/Scenes/Bootstrap Scene.unity index 1c63aa8..443b117 100644 --- a/Assets/_Game/Scenes/Bootstrap Scene.unity +++ b/Assets/_Game/Scenes/Bootstrap Scene.unity @@ -38,12 +38,12 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.18028378, g: 0.22571412, b: 0.30692285, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 12 + serializedVersion: 13 + m_BakeOnSceneLoad: 0 m_GISettings: serializedVersion: 2 m_BounceScale: 1 @@ -155,8 +155,8 @@ Camera: m_GameObject: {fileID: 330585543} m_Enabled: 1 serializedVersion: 2 - m_ClearFlags: 1 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.73282254, g: 0.66206837, b: 0.8113208, a: 0} m_projectionMatrixMode: 1 m_GateFitMode: 2 m_FOVAxisMode: 0 @@ -250,13 +250,13 @@ MonoBehaviour: m_RequiresColorTexture: 0 m_Version: 2 m_TaaSettings: - quality: 3 - frameInfluence: 0.1 - jitterScale: 1 - mipBias: 0 - varianceClampScale: 0.9 - contrastAdaptiveSharpening: 0 ---- !u!1 &410087039 + m_Quality: 3 + m_FrameInfluence: 0.1 + m_JitterScale: 1 + m_MipBias: 0 + m_VarianceClampScale: 0.9 + m_ContrastAdaptiveSharpening: 0 +--- !u!1 &1528287145 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -264,157 +264,35 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 410087041} - - component: {fileID: 410087040} - - component: {fileID: 410087042} + - component: {fileID: 1528287147} + - component: {fileID: 1528287146} m_Layer: 0 - m_Name: Directional Light + m_Name: Bootstrapper m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!108 &410087040 -Light: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 410087039} - m_Enabled: 1 - serializedVersion: 11 - m_Type: 1 - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_Intensity: 2 - m_Range: 10 - m_SpotAngle: 30 - m_InnerSpotAngle: 21.80208 - m_CookieSize: 10 - m_Shadows: - m_Type: 2 - m_Resolution: -1 - m_CustomResolution: -1 - m_Strength: 1 - m_Bias: 0.05 - m_NormalBias: 0.4 - m_NearPlane: 0.2 - m_CullingMatrixOverride: - e00: 1 - e01: 0 - e02: 0 - e03: 0 - e10: 0 - e11: 1 - e12: 0 - e13: 0 - e20: 0 - e21: 0 - e22: 1 - e23: 0 - e30: 0 - e31: 0 - e32: 0 - e33: 1 - m_UseCullingMatrixOverride: 0 - m_Cookie: {fileID: 0} - m_DrawHalo: 0 - m_Flare: {fileID: 0} - m_RenderMode: 0 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingLayerMask: 1 - m_Lightmapping: 4 - m_LightShadowCasterMode: 0 - m_AreaSize: {x: 1, y: 1} - m_BounceIntensity: 1 - m_ColorTemperature: 5000 - m_UseColorTemperature: 1 - m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} - m_UseBoundingSphereOverride: 0 - m_UseViewFrustumForShadowCasterCull: 1 - m_ForceVisible: 0 - m_ShadowRadius: 0 - m_ShadowAngle: 0 ---- !u!4 &410087041 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 410087039} - serializedVersion: 2 - m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} - m_LocalPosition: {x: 0, y: 3, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} ---- !u!114 &410087042 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 410087039} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Version: 3 - m_UsePipelineSettings: 1 - m_AdditionalLightsShadowResolutionTier: 2 - m_LightLayerMask: 1 - m_RenderingLayers: 1 - m_CustomShadowLayers: 0 - m_ShadowLayerMask: 1 - m_ShadowRenderingLayers: 1 - m_LightCookieSize: {x: 1, y: 1} - m_LightCookieOffset: {x: 0, y: 0} - m_SoftShadowQuality: 1 ---- !u!1 &832575517 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 832575519} - - component: {fileID: 832575518} - m_Layer: 0 - m_Name: Global Volume - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &832575518 +--- !u!114 &1528287146 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 832575517} + m_GameObject: {fileID: 1528287145} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3} + m_Script: {fileID: 11500000, guid: 1d51d6cf436a19a4ab9fd3d245da2ec6, type: 3} m_Name: m_EditorClassIdentifier: - m_IsGlobal: 1 - priority: 0 - blendDistance: 0 - weight: 1 - sharedProfile: {fileID: 11400000, guid: 10fc4df2da32a41aaa32d77bc913491c, type: 2} ---- !u!4 &832575519 + startSceneIndex: 1 +--- !u!4 &1528287147 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 832575517} + m_GameObject: {fileID: 1528287145} serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} @@ -428,5 +306,4 @@ SceneRoots: m_ObjectHideFlags: 0 m_Roots: - {fileID: 330585546} - - {fileID: 410087041} - - {fileID: 832575519} + - {fileID: 1528287147} diff --git a/Assets/_Game/Scenes/Game Scene.unity b/Assets/_Game/Scenes/Game Scene.unity index 2657e75..185de6a 100644 --- a/Assets/_Game/Scenes/Game Scene.unity +++ b/Assets/_Game/Scenes/Game Scene.unity @@ -42,7 +42,8 @@ RenderSettings: --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 12 + serializedVersion: 13 + m_BakeOnSceneLoad: 0 m_GISettings: serializedVersion: 2 m_BounceScale: 1 @@ -166,6 +167,7 @@ MonoBehaviour: m_DeselectOnBackgroundClick: 1 m_PointerBehavior: 0 m_CursorLockBehavior: 0 + m_ScrollDeltaPerTick: 6 --- !u!114 &48208519 MonoBehaviour: m_ObjectHideFlags: 0 @@ -510,6 +512,7 @@ MonoBehaviour: foodConfig: k__BackingField: {fileID: 1427794212} k__BackingField: 5 + effectsConfig: {fileID: 11400000, guid: 1a9fa2922e48c624580b64fcb079cde5, type: 2} --- !u!1 &443666759 GameObject: m_ObjectHideFlags: 0 @@ -1181,6 +1184,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7a5ac11cc976e418e8d13136b07e1f52, type: 3} m_Name: m_EditorClassIdentifier: + m_SerializedVersion: 0 m_AgentTypeID: 0 m_CollectObjects: 0 m_Size: {x: 10, y: 10, z: 10} diff --git a/Assets/_Game/Scenes/Menu Scene.unity b/Assets/_Game/Scenes/Menu Scene.unity index 3e3bef3..d3353ee 100644 --- a/Assets/_Game/Scenes/Menu Scene.unity +++ b/Assets/_Game/Scenes/Menu Scene.unity @@ -42,7 +42,8 @@ RenderSettings: --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 12 + serializedVersion: 13 + m_BakeOnSceneLoad: 0 m_GISettings: serializedVersion: 2 m_BounceScale: 1 @@ -281,9 +282,9 @@ RectTransform: m_Father: {fileID: 1900976148} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 100, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &21617909 MonoBehaviour: @@ -1024,9 +1025,9 @@ RectTransform: m_Father: {fileID: 1042399716} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 100, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &429292554 MonoBehaviour: @@ -1870,7 +1871,7 @@ MonoBehaviour: m_ScaleFactor: 1 m_ReferenceResolution: {x: 1920, y: 1080} m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 0.254 + m_MatchWidthOrHeight: 0 m_PhysicalUnit: 3 m_FallbackScreenDPI: 96 m_DefaultSpriteDPI: 96 @@ -2155,6 +2156,7 @@ MonoBehaviour: m_DeselectOnBackgroundClick: 1 m_PointerBehavior: 0 m_CursorLockBehavior: 0 + m_ScrollDeltaPerTick: 6 --- !u!114 &920354100 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2727,9 +2729,9 @@ RectTransform: m_Father: {fileID: 1593576915} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 100, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1175838149 MonoBehaviour: @@ -4214,7 +4216,7 @@ GameObject: - component: {fileID: 1889985852} - component: {fileID: 1889985853} m_Layer: 0 - m_Name: DiContainer + m_Name: SceneScope m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -4248,7 +4250,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: parentReference: - TypeName: Xandudex.LifeGame.ProjectLifetimeScope + TypeName: autoRun: 1 autoInjectGameObjects: [] simulationConfig: {fileID: 11400000, guid: 318f053d844400c468df7a6d68ba9285, type: 2} diff --git a/Assets/_Game/Settings/URP/UniversalRenderPipelineGlobalSettings.asset b/Assets/_Game/Settings/URP/UniversalRenderPipelineGlobalSettings.asset index c56b021..a274ba3 100644 --- a/Assets/_Game/Settings/URP/UniversalRenderPipelineGlobalSettings.asset +++ b/Assets/_Game/Settings/URP/UniversalRenderPipelineGlobalSettings.asset @@ -158,7 +158,6 @@ MonoBehaviour: m_GeometryUnshadowShader: {fileID: 4800000, guid: 77774d9009bb81447b048c907d4c6273, type: 3} m_FallOffLookup: {fileID: 2800000, guid: 5688ab254e4c0634f8d6c8e0792331ca, type: 3} m_CopyDepthPS: {fileID: 4800000, guid: d6dae50ee9e1bfa4db75f19f99355220, type: 3} - m_DefaultCustomMaterial: {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} m_DefaultLitMaterial: {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} m_DefaultUnlitMaterial: {fileID: 2100000, guid: 9dfc825aed78fcd4ba02077103263b40, type: 2} m_DefaultMaskMaterial: {fileID: 2100000, guid: 15d0c3709176029428a0da2f8cecf0b5, type: 2} @@ -206,12 +205,12 @@ MonoBehaviour: dilationShader: {fileID: 7200000, guid: 6bb382f7de370af41b775f54182e491d, type: 3} subdivideSceneCS: {fileID: 7200000, guid: bb86f1f0af829fd45b2ebddda1245c22, type: 3} voxelizeSceneShader: {fileID: 4800000, guid: c8b6a681c7b4e2e4785ffab093907f9e, type: 3} - traceVirtualOffsetCS: {fileID: 7200000, guid: 805f10d263aac4b4098c0279cd37a4f3, type: 3} - traceVirtualOffsetRT: {fileID: 4807578003741378534, guid: b60511f4aa1443f4d8c0b18f4fec92f4, type: 3} - skyOcclusionCS: {fileID: 7200000, guid: 798f52ec82fa04048a12826bbbbcf7b4, type: 3} - skyOcclusionRT: {fileID: 4807578003741378534, guid: dfaf42b38dd001f49a72d8102b709f29, type: 3} - renderingLayerCS: {fileID: 7200000, guid: a63c9cf933e3d8f41ae680a372784ebf, type: 3} - renderingLayerRT: {fileID: 4807578003741378534, guid: c2be09c936362eb49a58f08aeb30627a, type: 3} + traceVirtualOffsetCS: {fileID: -6772857160820960102, guid: ff2cbab5da58bf04d82c5f34037ed123, type: 3} + traceVirtualOffsetRT: {fileID: -5126288278712620388, guid: ff2cbab5da58bf04d82c5f34037ed123, type: 3} + skyOcclusionCS: {fileID: -6772857160820960102, guid: 5a2a534753fbdb44e96c3c78b5a6999d, type: 3} + skyOcclusionRT: {fileID: -5126288278712620388, guid: 5a2a534753fbdb44e96c3c78b5a6999d, type: 3} + renderingLayerCS: {fileID: -6772857160820960102, guid: 94a070d33e408384bafc1dea4a565df9, type: 3} + renderingLayerRT: {fileID: -5126288278712620388, guid: 94a070d33e408384bafc1dea4a565df9, type: 3} - rid: 6852985685364965389 type: {class: ProbeVolumeGlobalSettings, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime} data: diff --git a/Assets/_Game/_Code/Infrastructure/Data.meta b/Assets/_Game/_Code/Infrastructure/Data.meta new file mode 100644 index 0000000..10682b2 --- /dev/null +++ b/Assets/_Game/_Code/Infrastructure/Data.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: be117f339dfaf8640a294deb24b2c6aa +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Game/_Code/Infrastructure/Data/Effects.meta b/Assets/_Game/_Code/Infrastructure/Data/Effects.meta new file mode 100644 index 0000000..b764f2b --- /dev/null +++ b/Assets/_Game/_Code/Infrastructure/Data/Effects.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cdbdda3960d165042b81c316074936bb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Game/_Code/Infrastructure/Data/Effects/EffectsConfig.cs b/Assets/_Game/_Code/Infrastructure/Data/Effects/EffectsConfig.cs new file mode 100644 index 0000000..fd29ea2 --- /dev/null +++ b/Assets/_Game/_Code/Infrastructure/Data/Effects/EffectsConfig.cs @@ -0,0 +1,15 @@ +using UnityEngine; +using UnityEngine.VFX; + +namespace Life.Data.Effects +{ + [CreateAssetMenu(fileName = nameof(EffectsConfig), menuName = "Game/Configs/" + nameof(EffectsConfig))] + internal class EffectsConfig : ScriptableObject + { + [field: SerializeField] + public VisualEffect EffectPrefab { get; private set; } + + [field: SerializeField] + public VisualEffectAsset FoodEatingEffect { get; private set; } + } +} diff --git a/Assets/_Game/_Code/Infrastructure/Data/Effects/EffectsConfig.cs.meta b/Assets/_Game/_Code/Infrastructure/Data/Effects/EffectsConfig.cs.meta new file mode 100644 index 0000000..a0d78ea --- /dev/null +++ b/Assets/_Game/_Code/Infrastructure/Data/Effects/EffectsConfig.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 08eaed2fa10ab63469c729fbe0f612cf \ No newline at end of file diff --git a/Assets/_Game/_Code/Infrastructure/Services/GameResources.meta b/Assets/_Game/_Code/Infrastructure/Data/GameResources.meta similarity index 100% rename from Assets/_Game/_Code/Infrastructure/Services/GameResources.meta rename to Assets/_Game/_Code/Infrastructure/Data/GameResources.meta diff --git a/Assets/_Game/_Code/Infrastructure/Services/GameResources/GameResourcesConfig.cs b/Assets/_Game/_Code/Infrastructure/Data/GameResources/GameResourcesConfig.cs similarity index 64% rename from Assets/_Game/_Code/Infrastructure/Services/GameResources/GameResourcesConfig.cs rename to Assets/_Game/_Code/Infrastructure/Data/GameResources/GameResourcesConfig.cs index f68ce59..87e5c9b 100644 --- a/Assets/_Game/_Code/Infrastructure/Services/GameResources/GameResourcesConfig.cs +++ b/Assets/_Game/_Code/Infrastructure/Data/GameResources/GameResourcesConfig.cs @@ -1,8 +1,8 @@ using UnityEngine; -namespace Xandudex.LifeGame +namespace Life.Data.GameResources { - [CreateAssetMenu(fileName = "Resources Config", menuName = "Game/Resources Config")] + [CreateAssetMenu(fileName = nameof(GameResourcesConfig), menuName = "Game/Configs/" + nameof(GameResourcesConfig))] internal class GameResourcesConfig : ScriptableObject { [field: SerializeField] diff --git a/Assets/_Game/_Code/Infrastructure/Services/GameResources/GameResourcesConfig.cs.meta b/Assets/_Game/_Code/Infrastructure/Data/GameResources/GameResourcesConfig.cs.meta similarity index 100% rename from Assets/_Game/_Code/Infrastructure/Services/GameResources/GameResourcesConfig.cs.meta rename to Assets/_Game/_Code/Infrastructure/Data/GameResources/GameResourcesConfig.cs.meta diff --git a/Assets/_Game/_Code/Infrastructure/Services/Simulation.meta b/Assets/_Game/_Code/Infrastructure/Data/Simulation.meta similarity index 77% rename from Assets/_Game/_Code/Infrastructure/Services/Simulation.meta rename to Assets/_Game/_Code/Infrastructure/Data/Simulation.meta index 330afba..2f4f9f5 100644 --- a/Assets/_Game/_Code/Infrastructure/Services/Simulation.meta +++ b/Assets/_Game/_Code/Infrastructure/Data/Simulation.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 2fc7ae5c5b41f204d985095e541e6892 +guid: b0138444db3356e4082cddff5ac4fff6 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/_Game/_Code/Simulation/SimulationConfig.cs b/Assets/_Game/_Code/Infrastructure/Data/Simulation/SimulationConfig.cs similarity index 96% rename from Assets/_Game/_Code/Simulation/SimulationConfig.cs rename to Assets/_Game/_Code/Infrastructure/Data/Simulation/SimulationConfig.cs index 4fcf0a8..6e4209b 100644 --- a/Assets/_Game/_Code/Simulation/SimulationConfig.cs +++ b/Assets/_Game/_Code/Infrastructure/Data/Simulation/SimulationConfig.cs @@ -1,7 +1,7 @@ using System; using UnityEngine; -namespace Xandudex.LifeGame +namespace Life.Data.Simulation { [CreateAssetMenu(fileName = "Simulation Config", menuName = "Game/Simulation Config")] internal class SimulationConfig : ScriptableObject diff --git a/Assets/_Game/_Code/Simulation/SimulationConfig.cs.meta b/Assets/_Game/_Code/Infrastructure/Data/Simulation/SimulationConfig.cs.meta similarity index 100% rename from Assets/_Game/_Code/Simulation/SimulationConfig.cs.meta rename to Assets/_Game/_Code/Infrastructure/Data/Simulation/SimulationConfig.cs.meta diff --git a/Assets/_Game/_Code/Infrastructure/Factories/GameFactory.cs b/Assets/_Game/_Code/Infrastructure/Factories/GameFactory.cs index 03eac94..0a7219a 100644 --- a/Assets/_Game/_Code/Infrastructure/Factories/GameFactory.cs +++ b/Assets/_Game/_Code/Infrastructure/Factories/GameFactory.cs @@ -2,7 +2,7 @@ using VContainer; using VContainer.Unity; -namespace Xandudex.LifeGame +namespace Life.Factories { internal class GameFactory { @@ -13,30 +13,6 @@ public GameFactory(LifetimeScope scope) this.scope = scope; } - /* public Food CreateFood(GameObject foodObject) - { - var childScope = - scope.CreateChild(o => - { - o.RegisterInstance(foodObject); - o.RegisterEntryPoint().AsSelf(); - }); - - return childScope.Container.Resolve(); - } - - public Food CreateAnimal(GameObject foodObject) - { - var childScope = - scope.CreateChild(o => - { - o.RegisterInstance(foodObject); - o.RegisterEntryPoint().AsSelf(); - }); - - return childScope.Container.Resolve(); - }*/ - public T Create(params object[] args) { return scope.Container.CreateScope(o => diff --git a/Assets/_Game/_Code/Infrastructure/Installers/ProjectLifetimeScope.cs b/Assets/_Game/_Code/Infrastructure/Installers/ProjectLifetimeScope.cs deleted file mode 100644 index 15f577b..0000000 --- a/Assets/_Game/_Code/Infrastructure/Installers/ProjectLifetimeScope.cs +++ /dev/null @@ -1,36 +0,0 @@ -using MessagePipe; -using VContainer; -using VContainer.Unity; - -namespace Xandudex.LifeGame -{ - internal class ProjectLifetimeScope : LifetimeScope - { - protected override void Configure(IContainerBuilder builder) - { - RegisterMessagePipe(builder); - RegisterGameResources(builder); - RegisterGameFactory(builder); - RegisterSaveService(builder); - RegisterSceneLoader(builder); - } - - private void RegisterMessagePipe(IContainerBuilder builder) - { - builder.RegisterMessagePipe(); - builder.RegisterBuildCallback(c => GlobalMessagePipe.SetProvider(c.AsServiceProvider())); - } - - private void RegisterGameResources(IContainerBuilder builder) => - builder.RegisterEntryPoint(); - - private void RegisterGameFactory(IContainerBuilder builder) => - builder.RegisterEntryPoint().AsSelf(); - - private void RegisterSaveService(IContainerBuilder builder) => - builder.RegisterEntryPoint(); - - private void RegisterSceneLoader(IContainerBuilder builder) => - builder.RegisterEntryPoint(); - } -} \ No newline at end of file diff --git a/Assets/_Game/_Code/Infrastructure/Installers.meta b/Assets/_Game/_Code/Infrastructure/Scopes.meta similarity index 100% rename from Assets/_Game/_Code/Infrastructure/Installers.meta rename to Assets/_Game/_Code/Infrastructure/Scopes.meta diff --git a/Assets/_Game/_Code/Infrastructure/Installers/GameLifetimeScope.cs b/Assets/_Game/_Code/Infrastructure/Scopes/GameLifetimeScope.cs similarity index 83% rename from Assets/_Game/_Code/Infrastructure/Installers/GameLifetimeScope.cs rename to Assets/_Game/_Code/Infrastructure/Scopes/GameLifetimeScope.cs index 86e9c93..eefc80f 100644 --- a/Assets/_Game/_Code/Infrastructure/Installers/GameLifetimeScope.cs +++ b/Assets/_Game/_Code/Infrastructure/Scopes/GameLifetimeScope.cs @@ -1,8 +1,13 @@ +using Life.Data.Effects; +using Life.Factories; +using Life.Services.Effects; +using Life.Systems.Simulation; +using Life.UI.SimulationHud; using UnityEngine; using VContainer; using VContainer.Unity; -namespace Xandudex.LifeGame +namespace Life.Scopes { public class GameLifetimeScope : LifetimeScope { @@ -24,6 +29,8 @@ public class GameLifetimeScope : LifetimeScope [SerializeField] FoodSpawnerConfig foodConfig; + [SerializeField] + EffectsConfig effectsConfig; protected override void Configure(IContainerBuilder builder) { RegisterCancellationToken(builder); @@ -33,6 +40,13 @@ protected override void Configure(IContainerBuilder builder) RegisterAnimals(builder); RegisterFood(builder); RegisterSpeedControl(builder); + RegisterEffects(builder); + } + + private void RegisterEffects(IContainerBuilder builder) + { + builder.RegisterInstance(effectsConfig); + builder.RegisterEntryPoint(); } private void RegisterCancellationToken(IContainerBuilder builder) diff --git a/Assets/_Game/_Code/Infrastructure/Installers/GameLifetimeScope.cs.meta b/Assets/_Game/_Code/Infrastructure/Scopes/GameLifetimeScope.cs.meta similarity index 100% rename from Assets/_Game/_Code/Infrastructure/Installers/GameLifetimeScope.cs.meta rename to Assets/_Game/_Code/Infrastructure/Scopes/GameLifetimeScope.cs.meta diff --git a/Assets/_Game/_Code/Infrastructure/Scopes/ProjectLifetimeScope.cs b/Assets/_Game/_Code/Infrastructure/Scopes/ProjectLifetimeScope.cs new file mode 100644 index 0000000..feb11f1 --- /dev/null +++ b/Assets/_Game/_Code/Infrastructure/Scopes/ProjectLifetimeScope.cs @@ -0,0 +1,46 @@ +using Life.Data.GameResources; +using Life.Factories; +using Life.Services.Save; +using Life.Services.SceneLoading; +using MessagePipe; +using UnityEngine; +using VContainer; +using VContainer.Unity; + +namespace Life.Scopes +{ + public class ProjectLifetimeScope : LifetimeScope + { + [SerializeField] + GameResourcesConfig gameResourcesConfig; + protected override void Configure(IContainerBuilder builder) + { + RegisterMessagePipe(builder); + + RegisterGameFactory(builder); + RegisterSceneLoader(builder); + + RegisterGameResources(builder); + + RegisterSaveService(builder); + } + + void RegisterMessagePipe(IContainerBuilder builder) + { + builder.RegisterMessagePipe(); + builder.RegisterBuildCallback(c => GlobalMessagePipe.SetProvider(c.AsServiceProvider())); + } + + void RegisterGameResources(IContainerBuilder builder) => + builder.RegisterInstance(gameResourcesConfig); + + void RegisterGameFactory(IContainerBuilder builder) => + builder.RegisterEntryPoint().AsSelf(); + + void RegisterSaveService(IContainerBuilder builder) => + builder.RegisterEntryPoint(); + + void RegisterSceneLoader(IContainerBuilder builder) => + builder.RegisterEntryPoint(); + } +} \ No newline at end of file diff --git a/Assets/_Game/_Code/Infrastructure/Installers/ProjectLifetimeScope.cs.meta b/Assets/_Game/_Code/Infrastructure/Scopes/ProjectLifetimeScope.cs.meta similarity index 100% rename from Assets/_Game/_Code/Infrastructure/Installers/ProjectLifetimeScope.cs.meta rename to Assets/_Game/_Code/Infrastructure/Scopes/ProjectLifetimeScope.cs.meta diff --git a/Assets/_Game/_Code/Infrastructure/Installers/SimulationMenuLifetimeScope.cs b/Assets/_Game/_Code/Infrastructure/Scopes/SimulationMenuLifetimeScope.cs similarity index 89% rename from Assets/_Game/_Code/Infrastructure/Installers/SimulationMenuLifetimeScope.cs rename to Assets/_Game/_Code/Infrastructure/Scopes/SimulationMenuLifetimeScope.cs index 2604a7e..9db19d7 100644 --- a/Assets/_Game/_Code/Infrastructure/Installers/SimulationMenuLifetimeScope.cs +++ b/Assets/_Game/_Code/Infrastructure/Scopes/SimulationMenuLifetimeScope.cs @@ -1,8 +1,10 @@ +using Life.Data.Simulation; +using Life.UI.MainMenu; using UnityEngine; using VContainer; using VContainer.Unity; -namespace Xandudex.LifeGame +namespace Life.Scopes { public class SimulationMenuLifetimeScope : LifetimeScope { diff --git a/Assets/_Game/_Code/Infrastructure/Installers/SimulationMenuLifetimeScope.cs.meta b/Assets/_Game/_Code/Infrastructure/Scopes/SimulationMenuLifetimeScope.cs.meta similarity index 100% rename from Assets/_Game/_Code/Infrastructure/Installers/SimulationMenuLifetimeScope.cs.meta rename to Assets/_Game/_Code/Infrastructure/Scopes/SimulationMenuLifetimeScope.cs.meta diff --git a/Assets/_Game/_Code/Infrastructure/Services/Effects.meta b/Assets/_Game/_Code/Infrastructure/Services/Effects.meta new file mode 100644 index 0000000..3e8ff15 --- /dev/null +++ b/Assets/_Game/_Code/Infrastructure/Services/Effects.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0f9c7fef8e0e3d24cb3efda60e8129a7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Game/_Code/Infrastructure/Services/Effects/EffectsService.cs b/Assets/_Game/_Code/Infrastructure/Services/Effects/EffectsService.cs new file mode 100644 index 0000000..4c59de7 --- /dev/null +++ b/Assets/_Game/_Code/Infrastructure/Services/Effects/EffectsService.cs @@ -0,0 +1,46 @@ +using Cysharp.Threading.Tasks; +using Life.Data.Effects; +using Life.Utilities; +using UnityEngine; +using UnityEngine.Pool; +using UnityEngine.VFX; + +namespace Life.Services.Effects +{ + internal class EffectsService : Service, IEffectsService + { + readonly ObjectPool visualEffectsPool; + + readonly EffectsConfig effectsConfig; + public EffectsService(EffectsConfig effectsConfig) + { + this.effectsConfig = effectsConfig; + + visualEffectsPool = new( + () => GameObject.Instantiate(effectsConfig.EffectPrefab), + x => x.gameObject.SetActive(true), + x => x.gameObject.SetActive(false)); + } + + public async UniTask PlayAt(VisualEffectAsset effectAsset, Vector3 position) + { + VisualEffect visualEffect = visualEffectsPool.Get(); + + visualEffect.visualEffectAsset = effectAsset; + visualEffect.transform.position = position; + + visualEffect.Play(); + + //todo:find better way to deal with effect lifetime + while (visualEffect.aliveParticleCount != 0) + await UniTask.Yield(DisposeCancellationToken); + + visualEffectsPool.Release(visualEffect); + } + + protected override void Dispose() + { + visualEffectsPool.Dispose(); + } + } +} diff --git a/Assets/_Game/_Code/Infrastructure/Services/Effects/EffectsService.cs.meta b/Assets/_Game/_Code/Infrastructure/Services/Effects/EffectsService.cs.meta new file mode 100644 index 0000000..98e593e --- /dev/null +++ b/Assets/_Game/_Code/Infrastructure/Services/Effects/EffectsService.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: bfa0dbb330dfbfc4e8ddc0d417ce938e \ No newline at end of file diff --git a/Assets/_Game/_Code/Infrastructure/Services/Effects/IEffectsService.cs b/Assets/_Game/_Code/Infrastructure/Services/Effects/IEffectsService.cs new file mode 100644 index 0000000..51c21e0 --- /dev/null +++ b/Assets/_Game/_Code/Infrastructure/Services/Effects/IEffectsService.cs @@ -0,0 +1,12 @@ +using Cysharp.Threading.Tasks; +using UnityEngine; +using UnityEngine.VFX; + +namespace Life.Services.Effects +{ + + internal interface IEffectsService + { + UniTask PlayAt(VisualEffectAsset effectAsset, Vector3 position); + } +} diff --git a/Assets/_Game/_Code/Infrastructure/Services/Effects/IEffectsService.cs.meta b/Assets/_Game/_Code/Infrastructure/Services/Effects/IEffectsService.cs.meta new file mode 100644 index 0000000..1375826 --- /dev/null +++ b/Assets/_Game/_Code/Infrastructure/Services/Effects/IEffectsService.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: aa4bb7ff3b9e9f94c83da009e388f7f3 \ No newline at end of file diff --git a/Assets/_Game/_Code/Infrastructure/Services/GameResources/GameResources.cs b/Assets/_Game/_Code/Infrastructure/Services/GameResources/GameResources.cs deleted file mode 100644 index 8f6d2e9..0000000 --- a/Assets/_Game/_Code/Infrastructure/Services/GameResources/GameResources.cs +++ /dev/null @@ -1,16 +0,0 @@ -using UnityEngine; - -namespace Xandudex.LifeGame -{ - internal class GameResources : IGameResources - { - GameResourcesConfig config; - public GameResources() - { - config = Resources.LoadAll("")[0]; - } - public GameObject FoodPrefab => config.FoodPrefab; - - public GameObject AnimalPrefab => config.AnimalPrefab; - } -} diff --git a/Assets/_Game/_Code/Infrastructure/Services/GameResources/GameResources.cs.meta b/Assets/_Game/_Code/Infrastructure/Services/GameResources/GameResources.cs.meta deleted file mode 100644 index a968f8e..0000000 --- a/Assets/_Game/_Code/Infrastructure/Services/GameResources/GameResources.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: c01bc69a85d320a43be2d7926f6485c3 \ No newline at end of file diff --git a/Assets/_Game/_Code/Infrastructure/Services/GameResources/IGameResources.cs b/Assets/_Game/_Code/Infrastructure/Services/GameResources/IGameResources.cs deleted file mode 100644 index 6db5a75..0000000 --- a/Assets/_Game/_Code/Infrastructure/Services/GameResources/IGameResources.cs +++ /dev/null @@ -1,10 +0,0 @@ -using UnityEngine; - -namespace Xandudex.LifeGame -{ - internal interface IGameResources - { - GameObject FoodPrefab { get; } - GameObject AnimalPrefab { get; } - } -} diff --git a/Assets/_Game/_Code/Infrastructure/Services/GameResources/IGameResources.cs.meta b/Assets/_Game/_Code/Infrastructure/Services/GameResources/IGameResources.cs.meta deleted file mode 100644 index 36ff2f8..0000000 --- a/Assets/_Game/_Code/Infrastructure/Services/GameResources/IGameResources.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 6e92c9513846b8d42a34bb95f4b5b248 \ No newline at end of file diff --git a/Assets/_Game/_Code/Infrastructure/Services/Save/ISaveData.cs b/Assets/_Game/_Code/Infrastructure/Services/Save/ISaveData.cs index b68cdc4..1c92113 100644 --- a/Assets/_Game/_Code/Infrastructure/Services/Save/ISaveData.cs +++ b/Assets/_Game/_Code/Infrastructure/Services/Save/ISaveData.cs @@ -1,4 +1,4 @@ -namespace Xandudex.LifeGame +namespace Life.Services.Save { interface ISaveData { diff --git a/Assets/_Game/_Code/Infrastructure/Services/Save/ISaveService.cs b/Assets/_Game/_Code/Infrastructure/Services/Save/ISaveService.cs index 1719392..7275da7 100644 --- a/Assets/_Game/_Code/Infrastructure/Services/Save/ISaveService.cs +++ b/Assets/_Game/_Code/Infrastructure/Services/Save/ISaveService.cs @@ -1,6 +1,6 @@ using System; -namespace Xandudex.LifeGame +namespace Life.Services.Save { internal interface ISaveService { diff --git a/Assets/_Game/_Code/Infrastructure/Services/Save/SaveService.cs b/Assets/_Game/_Code/Infrastructure/Services/Save/SaveService.cs index 4bc2c93..f7be165 100644 --- a/Assets/_Game/_Code/Infrastructure/Services/Save/SaveService.cs +++ b/Assets/_Game/_Code/Infrastructure/Services/Save/SaveService.cs @@ -1,10 +1,11 @@ -using System; +using Life.Utilities; +using System; using System.Collections.Generic; using System.Linq; -namespace Xandudex.LifeGame +namespace Life.Services.Save { - internal class SaveService : ISaveService + internal class SaveService : Service, ISaveService { public event Func Saving; public event Action Saved; @@ -55,12 +56,12 @@ public bool TryLoad(out T data) where T : ISaveData void SaveToFile() { - + //todo } void LoadFromFile() { - + //todo } } } diff --git a/Assets/_Game/_Code/Infrastructure/Services/SceneLoader/ISceneLoader.cs b/Assets/_Game/_Code/Infrastructure/Services/SceneLoader/ISceneLoader.cs deleted file mode 100644 index abac1d7..0000000 --- a/Assets/_Game/_Code/Infrastructure/Services/SceneLoader/ISceneLoader.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Xandudex.LifeGame -{ - internal record SceneLoading(); - internal record SceneLoadingFinished(); - internal record SceneLoaded(); - internal interface ISceneLoader - { - void Load(string name, bool manual = false); - void Load(string name, T payload, bool manual = false); - void FinishLoading(); - } -} diff --git a/Assets/_Game/_Code/Infrastructure/Services/SceneLoader/ISceneLoader.cs.meta b/Assets/_Game/_Code/Infrastructure/Services/SceneLoader/ISceneLoader.cs.meta deleted file mode 100644 index a981371..0000000 --- a/Assets/_Game/_Code/Infrastructure/Services/SceneLoader/ISceneLoader.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 09b68d7c99774ac4aa503a88681cfa33 \ No newline at end of file diff --git a/Assets/_Game/_Code/Infrastructure/Services/SceneLoader/ISceneLoaderService.cs b/Assets/_Game/_Code/Infrastructure/Services/SceneLoader/ISceneLoaderService.cs new file mode 100644 index 0000000..0f38cfb --- /dev/null +++ b/Assets/_Game/_Code/Infrastructure/Services/SceneLoader/ISceneLoaderService.cs @@ -0,0 +1,17 @@ +namespace Life.Services.SceneLoading +{ + + internal interface ISceneLoaderService + { + void Load(string name, bool manual = false); + void Load(string name, T payload, bool manual = false); + void FinishLoading(); + } + + public static class SceneLoaderServiceMessages + { + internal record SceneLoading(); + internal record SceneLoadingFinished(); + internal record SceneLoaded(); + } +} diff --git a/Assets/_Game/_Code/Infrastructure/Services/SceneLoader/ISceneLoaderService.cs.meta b/Assets/_Game/_Code/Infrastructure/Services/SceneLoader/ISceneLoaderService.cs.meta new file mode 100644 index 0000000..ea27650 --- /dev/null +++ b/Assets/_Game/_Code/Infrastructure/Services/SceneLoader/ISceneLoaderService.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: d4d41661839a37748a16b9ed41b85d55 \ No newline at end of file diff --git a/Assets/_Game/_Code/Infrastructure/Services/SceneLoader/SceneLoader.cs.meta b/Assets/_Game/_Code/Infrastructure/Services/SceneLoader/SceneLoader.cs.meta deleted file mode 100644 index 7cb2cf8..0000000 --- a/Assets/_Game/_Code/Infrastructure/Services/SceneLoader/SceneLoader.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: a236e47431090c747822391e001f3ebc \ No newline at end of file diff --git a/Assets/_Game/_Code/Infrastructure/Services/SceneLoader/SceneLoader.cs b/Assets/_Game/_Code/Infrastructure/Services/SceneLoader/SceneLoaderService.cs similarity index 50% rename from Assets/_Game/_Code/Infrastructure/Services/SceneLoader/SceneLoader.cs rename to Assets/_Game/_Code/Infrastructure/Services/SceneLoader/SceneLoaderService.cs index e1ad16d..01b5bbb 100644 --- a/Assets/_Game/_Code/Infrastructure/Services/SceneLoader/SceneLoader.cs +++ b/Assets/_Game/_Code/Infrastructure/Services/SceneLoader/SceneLoaderService.cs @@ -1,34 +1,25 @@ -using MessagePipe; -using System.Threading.Tasks; +using Cysharp.Threading.Tasks; +using Life.Utilities; +using MessagePipe; using UnityEngine; using UnityEngine.SceneManagement; using VContainer; using VContainer.Unity; -#nullable enable -namespace Xandudex.LifeGame +namespace Life.Services.SceneLoading { - internal class SceneLoader : ISceneLoader + internal class SceneLoaderService : Service, ISceneLoaderService { - AsyncOperation? asyncOperation; + AsyncOperation asyncOperation; LifetimeScope.ExtraInstallationScope extraInstallationScope; - private readonly IPublisher sceneLoadingPub; - private readonly IPublisher sceneLoadingFinishedPub; - private readonly IPublisher sceneLoadedPub; - - public SceneLoader(IPublisher sceneLoadingPub, - IPublisher sceneLoadingFinishedPub, - IPublisher sceneLoadedPub) - { - this.sceneLoadingPub = sceneLoadingPub; - this.sceneLoadingFinishedPub = sceneLoadingFinishedPub; - this.sceneLoadedPub = sceneLoadedPub; - } + [Inject] readonly IPublisher sceneLoadingMessage; + [Inject] readonly IPublisher sceneLoadingFinishedMessage; + [Inject] readonly IPublisher sceneLoadedMessage; public void Load(string name, bool manual = false) { - _ = LoadAsync(name); + LoadAsync(name).Forget(); } public async void Load(string name, T payload, bool manual = false) @@ -40,9 +31,9 @@ public async void Load(string name, T payload, bool manual = false) } } - async Task LoadAsync(string name, bool manual = false) + async UniTask LoadAsync(string name, bool manual = false) { - sceneLoadingPub.Publish(new()); + sceneLoadingMessage.Publish(new()); asyncOperation = SceneManager.LoadSceneAsync(name); asyncOperation.allowSceneActivation = false; @@ -53,12 +44,12 @@ async Task LoadAsync(string name, bool manual = false) if (!manual) asyncOperation.allowSceneActivation = true; - sceneLoadingFinishedPub.Publish(new()); + sceneLoadingFinishedMessage.Publish(new()); while (!asyncOperation.isDone) - await Awaitable.NextFrameAsync(); + await UniTask.Yield(); - sceneLoadedPub.Publish(new()); + sceneLoadedMessage.Publish(new()); } public void FinishLoading() diff --git a/Assets/_Game/_Code/Infrastructure/Services/SceneLoader/SceneLoaderService.cs.meta b/Assets/_Game/_Code/Infrastructure/Services/SceneLoader/SceneLoaderService.cs.meta new file mode 100644 index 0000000..8003feb --- /dev/null +++ b/Assets/_Game/_Code/Infrastructure/Services/SceneLoader/SceneLoaderService.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a765ab6f4cdc96c4c929c64aedde99b7 \ No newline at end of file diff --git a/Assets/_Game/_Code/Systems.meta b/Assets/_Game/_Code/Systems.meta new file mode 100644 index 0000000..67912cd --- /dev/null +++ b/Assets/_Game/_Code/Systems.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ddd71f1cf4daae94e83fdfeaf4bcc05e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Game/_Code/Systems/Bootsrapping.meta b/Assets/_Game/_Code/Systems/Bootsrapping.meta new file mode 100644 index 0000000..6b7aa8c --- /dev/null +++ b/Assets/_Game/_Code/Systems/Bootsrapping.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 565eb5a7fc2ee72449e8b507755310a5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Game/_Code/Systems/Bootsrapping/GameBootsrapper.cs b/Assets/_Game/_Code/Systems/Bootsrapping/GameBootsrapper.cs new file mode 100644 index 0000000..99b332d --- /dev/null +++ b/Assets/_Game/_Code/Systems/Bootsrapping/GameBootsrapper.cs @@ -0,0 +1,15 @@ +using UnityEngine; +using UnityEngine.SceneManagement; + +namespace Life.Systems.Bootstrapping +{ + internal class GameBootstrapper : MonoBehaviour + { + [SerializeField] + int startSceneIndex = 1; + void Awake() + { + SceneManager.LoadSceneAsync(startSceneIndex); + } + } +} diff --git a/Assets/_Game/_Code/Systems/Bootsrapping/GameBootsrapper.cs.meta b/Assets/_Game/_Code/Systems/Bootsrapping/GameBootsrapper.cs.meta new file mode 100644 index 0000000..d93deb9 --- /dev/null +++ b/Assets/_Game/_Code/Systems/Bootsrapping/GameBootsrapper.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 1d51d6cf436a19a4ab9fd3d245da2ec6 \ No newline at end of file diff --git a/Assets/_Game/_Code/Simulation.meta b/Assets/_Game/_Code/Systems/Simulation.meta similarity index 100% rename from Assets/_Game/_Code/Simulation.meta rename to Assets/_Game/_Code/Systems/Simulation.meta diff --git a/Assets/_Game/_Code/Simulation/Animals.meta b/Assets/_Game/_Code/Systems/Simulation/Animals.meta similarity index 100% rename from Assets/_Game/_Code/Simulation/Animals.meta rename to Assets/_Game/_Code/Systems/Simulation/Animals.meta diff --git a/Assets/_Game/_Code/Simulation/Animals/Animal.Mover.cs b/Assets/_Game/_Code/Systems/Simulation/Animals/Animal.Mover.cs similarity index 97% rename from Assets/_Game/_Code/Simulation/Animals/Animal.Mover.cs rename to Assets/_Game/_Code/Systems/Simulation/Animals/Animal.Mover.cs index 9635c66..113a8ce 100644 --- a/Assets/_Game/_Code/Simulation/Animals/Animal.Mover.cs +++ b/Assets/_Game/_Code/Systems/Simulation/Animals/Animal.Mover.cs @@ -2,7 +2,7 @@ using UnityEngine; using UnityEngine.AI; -namespace Xandudex.LifeGame +namespace Life.Systems.Simulation { internal partial class Animal { diff --git a/Assets/_Game/_Code/Simulation/Animals/Animal.Mover.cs.meta b/Assets/_Game/_Code/Systems/Simulation/Animals/Animal.Mover.cs.meta similarity index 100% rename from Assets/_Game/_Code/Simulation/Animals/Animal.Mover.cs.meta rename to Assets/_Game/_Code/Systems/Simulation/Animals/Animal.Mover.cs.meta diff --git a/Assets/_Game/_Code/Simulation/Animals/Animal.cs b/Assets/_Game/_Code/Systems/Simulation/Animals/Animal.cs similarity index 96% rename from Assets/_Game/_Code/Simulation/Animals/Animal.cs rename to Assets/_Game/_Code/Systems/Simulation/Animals/Animal.cs index 61a0211..dadf550 100644 --- a/Assets/_Game/_Code/Simulation/Animals/Animal.cs +++ b/Assets/_Game/_Code/Systems/Simulation/Animals/Animal.cs @@ -1,4 +1,5 @@ -using MessagePipe; +using Life.Factories; +using MessagePipe; using System; using System.Collections.Generic; using UnityEngine; @@ -6,7 +7,7 @@ using VContainer.Unity; using Xandudex.Utility.StateMachine; -namespace Xandudex.LifeGame +namespace Life.Systems.Simulation { internal record AnimalEat(Animal Animal); internal record AnimalStateChanged(Animal Animal); diff --git a/Assets/_Game/_Code/Simulation/Animals/Animal.cs.meta b/Assets/_Game/_Code/Systems/Simulation/Animals/Animal.cs.meta similarity index 100% rename from Assets/_Game/_Code/Simulation/Animals/Animal.cs.meta rename to Assets/_Game/_Code/Systems/Simulation/Animals/Animal.cs.meta diff --git a/Assets/_Game/_Code/Simulation/Animals/AnimalSpawner.cs b/Assets/_Game/_Code/Systems/Simulation/Animals/AnimalSpawner.cs similarity index 90% rename from Assets/_Game/_Code/Simulation/Animals/AnimalSpawner.cs rename to Assets/_Game/_Code/Systems/Simulation/Animals/AnimalSpawner.cs index b361ddf..8841827 100644 --- a/Assets/_Game/_Code/Simulation/Animals/AnimalSpawner.cs +++ b/Assets/_Game/_Code/Systems/Simulation/Animals/AnimalSpawner.cs @@ -1,4 +1,7 @@ -using MessagePipe; +using Life.Data.GameResources; +using Life.Factories; +using Life.Services.Save; +using MessagePipe; using System; using System.Collections.Generic; using System.Linq; @@ -7,7 +10,7 @@ using VContainer.Unity; using Random = UnityEngine.Random; -namespace Xandudex.LifeGame +namespace Life.Systems.Simulation { internal record AnimalSpawned(Animal Animal); internal record AnimalSpawnedFromSave(Animal Animal, AnimalSpawner.AnimalSaveData Data); @@ -17,7 +20,7 @@ internal class AnimalSpawner : IStartable, IDisposable private readonly AnimalSpawnerConfig animalSpawnerConfig; private readonly SimulationSettings settings; - private readonly IGameResources gameResources; + private readonly GameResourcesConfig gameResourcesConfig; private readonly GameFactory gameFactory; private readonly CancellationToken token; private readonly ISaveService saveService; @@ -26,7 +29,7 @@ internal class AnimalSpawner : IStartable, IDisposable public AnimalSpawner(AnimalSpawnerConfig animalSpawnerConfig, SimulationSettings settings, - IGameResources gameResources, + GameResourcesConfig gameResourcesConfig, GameFactory gameFactory, CancellationToken token, ISaveService saveService, @@ -35,7 +38,7 @@ public AnimalSpawner(AnimalSpawnerConfig animalSpawnerConfig, { this.animalSpawnerConfig = animalSpawnerConfig; this.settings = settings; - this.gameResources = gameResources; + this.gameResourcesConfig = gameResourcesConfig; this.gameFactory = gameFactory; this.animalSpawnedPub = animalSpawnedPub; this.animalSpawnedFromSavePub = animalSpawnedFromSavePub; @@ -66,7 +69,7 @@ async void IStartable.Start() if (preloaded && i < saveData.Animals.Count) animalData = saveData.Animals[i]; - animalObject = gameFactory.Instantiate(gameResources.AnimalPrefab, position, animalSpawnerConfig.Parent); + animalObject = gameFactory.Instantiate(gameResourcesConfig.AnimalPrefab, position, animalSpawnerConfig.Parent); animal = gameFactory.Create(animalObject); Animals.Add(animal); diff --git a/Assets/_Game/_Code/Simulation/Animals/AnimalSpawner.cs.meta b/Assets/_Game/_Code/Systems/Simulation/Animals/AnimalSpawner.cs.meta similarity index 100% rename from Assets/_Game/_Code/Simulation/Animals/AnimalSpawner.cs.meta rename to Assets/_Game/_Code/Systems/Simulation/Animals/AnimalSpawner.cs.meta diff --git a/Assets/_Game/_Code/Simulation/Animals/AnimalSpawnerConfig.cs b/Assets/_Game/_Code/Systems/Simulation/Animals/AnimalSpawnerConfig.cs similarity index 84% rename from Assets/_Game/_Code/Simulation/Animals/AnimalSpawnerConfig.cs rename to Assets/_Game/_Code/Systems/Simulation/Animals/AnimalSpawnerConfig.cs index c322002..948a888 100644 --- a/Assets/_Game/_Code/Simulation/Animals/AnimalSpawnerConfig.cs +++ b/Assets/_Game/_Code/Systems/Simulation/Animals/AnimalSpawnerConfig.cs @@ -1,7 +1,7 @@ using System; using UnityEngine; -namespace Xandudex.LifeGame +namespace Life.Systems.Simulation { [Serializable] class AnimalSpawnerConfig diff --git a/Assets/_Game/_Code/Simulation/Animals/AnimalSpawnerConfig.cs.meta b/Assets/_Game/_Code/Systems/Simulation/Animals/AnimalSpawnerConfig.cs.meta similarity index 100% rename from Assets/_Game/_Code/Simulation/Animals/AnimalSpawnerConfig.cs.meta rename to Assets/_Game/_Code/Systems/Simulation/Animals/AnimalSpawnerConfig.cs.meta diff --git a/Assets/_Game/_Code/Simulation/Animals/States.meta b/Assets/_Game/_Code/Systems/Simulation/Animals/States.meta similarity index 100% rename from Assets/_Game/_Code/Simulation/Animals/States.meta rename to Assets/_Game/_Code/Systems/Simulation/Animals/States.meta diff --git a/Assets/_Game/_Code/Simulation/Animals/States/BaseAnimalState.cs b/Assets/_Game/_Code/Systems/Simulation/Animals/States/BaseAnimalState.cs similarity index 89% rename from Assets/_Game/_Code/Simulation/Animals/States/BaseAnimalState.cs rename to Assets/_Game/_Code/Systems/Simulation/Animals/States/BaseAnimalState.cs index d4bdebe..400a936 100644 --- a/Assets/_Game/_Code/Simulation/Animals/States/BaseAnimalState.cs +++ b/Assets/_Game/_Code/Systems/Simulation/Animals/States/BaseAnimalState.cs @@ -1,6 +1,6 @@ using Xandudex.Utility.StateMachine; -namespace Xandudex.LifeGame +namespace Life.Systems.Simulation { internal abstract class BaseAnimalState : IExitableState { diff --git a/Assets/_Game/_Code/Simulation/Animals/States/BaseAnimalState.cs.meta b/Assets/_Game/_Code/Systems/Simulation/Animals/States/BaseAnimalState.cs.meta similarity index 100% rename from Assets/_Game/_Code/Simulation/Animals/States/BaseAnimalState.cs.meta rename to Assets/_Game/_Code/Systems/Simulation/Animals/States/BaseAnimalState.cs.meta diff --git a/Assets/_Game/_Code/Simulation/Animals/States/EatingFoodAnimalState.cs b/Assets/_Game/_Code/Systems/Simulation/Animals/States/EatingFoodAnimalState.cs similarity index 62% rename from Assets/_Game/_Code/Simulation/Animals/States/EatingFoodAnimalState.cs rename to Assets/_Game/_Code/Systems/Simulation/Animals/States/EatingFoodAnimalState.cs index 2f6a850..b84a17a 100644 --- a/Assets/_Game/_Code/Simulation/Animals/States/EatingFoodAnimalState.cs +++ b/Assets/_Game/_Code/Systems/Simulation/Animals/States/EatingFoodAnimalState.cs @@ -1,16 +1,20 @@ -using Xandudex.Utility.StateMachine; +using MessagePipe; +using VContainer; +using Xandudex.Utility.StateMachine; -namespace Xandudex.LifeGame +namespace Life.Systems.Simulation { internal partial class Animal { internal class EatingFoodAnimalState : BaseAnimalState, IPayloadedState { + [Inject] readonly IPublisher animalEatingMessage; public EatingFoodAnimalState(Animal animal) : base(animal) { } public async void Enter(Food food) { + animalEatingMessage.Publish(new()); await food.Eat(); Animal.food = null; Animal.ChangeState(); diff --git a/Assets/_Game/_Code/Simulation/Animals/States/EatingFoodAnimalState.cs.meta b/Assets/_Game/_Code/Systems/Simulation/Animals/States/EatingFoodAnimalState.cs.meta similarity index 100% rename from Assets/_Game/_Code/Simulation/Animals/States/EatingFoodAnimalState.cs.meta rename to Assets/_Game/_Code/Systems/Simulation/Animals/States/EatingFoodAnimalState.cs.meta diff --git a/Assets/_Game/_Code/Simulation/Animals/States/MovingToFoodAnimalState.cs b/Assets/_Game/_Code/Systems/Simulation/Animals/States/MovingToFoodAnimalState.cs similarity index 93% rename from Assets/_Game/_Code/Simulation/Animals/States/MovingToFoodAnimalState.cs rename to Assets/_Game/_Code/Systems/Simulation/Animals/States/MovingToFoodAnimalState.cs index 5f04f43..19a8a6e 100644 --- a/Assets/_Game/_Code/Simulation/Animals/States/MovingToFoodAnimalState.cs +++ b/Assets/_Game/_Code/Systems/Simulation/Animals/States/MovingToFoodAnimalState.cs @@ -1,6 +1,6 @@ using Xandudex.Utility.StateMachine; -namespace Xandudex.LifeGame +namespace Life.Systems.Simulation { internal partial class Animal { diff --git a/Assets/_Game/_Code/Simulation/Animals/States/MovingToFoodAnimalState.cs.meta b/Assets/_Game/_Code/Systems/Simulation/Animals/States/MovingToFoodAnimalState.cs.meta similarity index 100% rename from Assets/_Game/_Code/Simulation/Animals/States/MovingToFoodAnimalState.cs.meta rename to Assets/_Game/_Code/Systems/Simulation/Animals/States/MovingToFoodAnimalState.cs.meta diff --git a/Assets/_Game/_Code/Simulation/Animals/States/SearchFoodAnimalState.cs b/Assets/_Game/_Code/Systems/Simulation/Animals/States/SearchFoodAnimalState.cs similarity index 96% rename from Assets/_Game/_Code/Simulation/Animals/States/SearchFoodAnimalState.cs rename to Assets/_Game/_Code/Systems/Simulation/Animals/States/SearchFoodAnimalState.cs index 54ea2a4..202a102 100644 --- a/Assets/_Game/_Code/Simulation/Animals/States/SearchFoodAnimalState.cs +++ b/Assets/_Game/_Code/Systems/Simulation/Animals/States/SearchFoodAnimalState.cs @@ -3,7 +3,7 @@ using System; using Xandudex.Utility.StateMachine; -namespace Xandudex.LifeGame +namespace Life.Systems.Simulation { internal partial class Animal { diff --git a/Assets/_Game/_Code/Simulation/Animals/States/SearchFoodAnimalState.cs.meta b/Assets/_Game/_Code/Systems/Simulation/Animals/States/SearchFoodAnimalState.cs.meta similarity index 100% rename from Assets/_Game/_Code/Simulation/Animals/States/SearchFoodAnimalState.cs.meta rename to Assets/_Game/_Code/Systems/Simulation/Animals/States/SearchFoodAnimalState.cs.meta diff --git a/Assets/_Game/_Code/Simulation/Animals/States/SpawnAnimalState.cs b/Assets/_Game/_Code/Systems/Simulation/Animals/States/SpawnAnimalState.cs similarity index 91% rename from Assets/_Game/_Code/Simulation/Animals/States/SpawnAnimalState.cs rename to Assets/_Game/_Code/Systems/Simulation/Animals/States/SpawnAnimalState.cs index a3e2056..2ab05d4 100644 --- a/Assets/_Game/_Code/Simulation/Animals/States/SpawnAnimalState.cs +++ b/Assets/_Game/_Code/Systems/Simulation/Animals/States/SpawnAnimalState.cs @@ -1,6 +1,6 @@ using Xandudex.Utility.StateMachine; -namespace Xandudex.LifeGame +namespace Life.Systems.Simulation { internal partial class Animal { diff --git a/Assets/_Game/_Code/Simulation/Animals/States/SpawnAnimalState.cs.meta b/Assets/_Game/_Code/Systems/Simulation/Animals/States/SpawnAnimalState.cs.meta similarity index 100% rename from Assets/_Game/_Code/Simulation/Animals/States/SpawnAnimalState.cs.meta rename to Assets/_Game/_Code/Systems/Simulation/Animals/States/SpawnAnimalState.cs.meta diff --git a/Assets/_Game/_Code/Simulation/CameraMovement.cs b/Assets/_Game/_Code/Systems/Simulation/CameraMovement.cs similarity index 96% rename from Assets/_Game/_Code/Simulation/CameraMovement.cs rename to Assets/_Game/_Code/Systems/Simulation/CameraMovement.cs index 676a177..a654bde 100644 --- a/Assets/_Game/_Code/Simulation/CameraMovement.cs +++ b/Assets/_Game/_Code/Systems/Simulation/CameraMovement.cs @@ -1,7 +1,7 @@ using UnityEngine; using VContainer.Unity; -namespace Xandudex.LifeGame +namespace Life.Systems.Simulation { internal class CameraMovement : ITickable, IStartable { diff --git a/Assets/_Game/_Code/Simulation/CameraMovement.cs.meta b/Assets/_Game/_Code/Systems/Simulation/CameraMovement.cs.meta similarity index 100% rename from Assets/_Game/_Code/Simulation/CameraMovement.cs.meta rename to Assets/_Game/_Code/Systems/Simulation/CameraMovement.cs.meta diff --git a/Assets/_Game/_Code/Simulation/Food.meta b/Assets/_Game/_Code/Systems/Simulation/Food.meta similarity index 100% rename from Assets/_Game/_Code/Simulation/Food.meta rename to Assets/_Game/_Code/Systems/Simulation/Food.meta diff --git a/Assets/_Game/_Code/Simulation/Food/Food.cs b/Assets/_Game/_Code/Systems/Simulation/Food/Food.cs similarity index 59% rename from Assets/_Game/_Code/Simulation/Food/Food.cs rename to Assets/_Game/_Code/Systems/Simulation/Food/Food.cs index eee34c6..590b5a0 100644 --- a/Assets/_Game/_Code/Simulation/Food/Food.cs +++ b/Assets/_Game/_Code/Systems/Simulation/Food/Food.cs @@ -1,24 +1,27 @@ -using System.Threading; +using Life.Data.Effects; +using Life.Services.Effects; +using System.Threading; using UnityEngine; using UnityEngine.Pool; -using UnityEngine.VFX; -namespace Xandudex.LifeGame +namespace Life.Systems.Simulation { internal class Food { + private readonly IEffectsService effectsService; + private readonly EffectsConfig effectsConfig; private readonly GameObject foodObject; private readonly ObjectPool pool; private readonly CancellationToken token; private readonly Transform foodTransform; - private readonly VisualEffect vfx; - public Food(GameObject foodObject, ObjectPool pool, CancellationToken token) + public Food(IEffectsService effectsService, EffectsConfig effectsConfig, GameObject foodObject, ObjectPool pool, CancellationToken token) { + this.effectsService = effectsService; + this.effectsConfig = effectsConfig; this.foodObject = foodObject; this.pool = pool; this.token = token; this.foodTransform = foodObject.transform; - this.vfx = foodObject.GetComponent(); } public Vector3 Position @@ -29,9 +32,7 @@ public Vector3 Position public async Awaitable Eat() { - vfx.Play(); - - await Awaitable.WaitForSecondsAsync(1, token); + await effectsService.PlayAt(effectsConfig.FoodEatingEffect, foodObject.transform.position); if (foodObject) foodObject.SetActive(false); diff --git a/Assets/_Game/_Code/Simulation/Food/Food.cs.meta b/Assets/_Game/_Code/Systems/Simulation/Food/Food.cs.meta similarity index 100% rename from Assets/_Game/_Code/Simulation/Food/Food.cs.meta rename to Assets/_Game/_Code/Systems/Simulation/Food/Food.cs.meta diff --git a/Assets/_Game/_Code/Simulation/Food/FoodSpawner.cs b/Assets/_Game/_Code/Systems/Simulation/Food/FoodSpawner.cs similarity index 93% rename from Assets/_Game/_Code/Simulation/Food/FoodSpawner.cs rename to Assets/_Game/_Code/Systems/Simulation/Food/FoodSpawner.cs index 59fbd8b..85f4964 100644 --- a/Assets/_Game/_Code/Simulation/Food/FoodSpawner.cs +++ b/Assets/_Game/_Code/Systems/Simulation/Food/FoodSpawner.cs @@ -1,4 +1,6 @@ -using MessagePipe; +using Life.Data.GameResources; +using Life.Factories; +using MessagePipe; using R3; using System; using System.Collections.Generic; @@ -8,7 +10,7 @@ using UnityEngine.Pool; using VContainer.Unity; -namespace Xandudex.LifeGame +namespace Life.Systems.Simulation { internal record FoodSpawned(Food Food, Animal Animal); @@ -22,7 +24,7 @@ internal class FoodSpawner : IInitializable, IDisposable private readonly SimulationSettings settings; private readonly FoodSpawnerConfig config; - private readonly IGameResources gameResources; + private readonly GameResourcesConfig gameResourcesConfig; private readonly GameFactory gameFactory; private readonly ISubscriber animalStateChangedSub; private readonly ISubscriber animalSpawnedFromSaveSub; @@ -31,7 +33,7 @@ internal class FoodSpawner : IInitializable, IDisposable public FoodSpawner(SimulationSettings settings, FoodSpawnerConfig config, - IGameResources gameResources, + GameResourcesConfig gameResourcesConfig, GameFactory gameFactory, CancellationToken token, ISubscriber animalStateChangedSub, @@ -40,7 +42,7 @@ public FoodSpawner(SimulationSettings settings, { this.settings = settings; this.config = config; - this.gameResources = gameResources; + this.gameResourcesConfig = gameResourcesConfig; this.gameFactory = gameFactory; this.animalStateChangedSub = animalStateChangedSub; this.animalSpawnedFromSaveSub = animalSpawnedFromSaveSub; @@ -53,7 +55,7 @@ void IInitializable.Initialize() objectPool = new ObjectPool( createFunc: () => { - GameObject foodObject = gameFactory.Instantiate(gameResources.FoodPrefab, config.Parent); + GameObject foodObject = gameFactory.Instantiate(gameResourcesConfig.FoodPrefab, config.Parent); return gameFactory.Create(foodObject, objectPool); }, actionOnRelease: x => occupiedPositions.Remove(x) diff --git a/Assets/_Game/_Code/Simulation/Food/FoodSpawner.cs.meta b/Assets/_Game/_Code/Systems/Simulation/Food/FoodSpawner.cs.meta similarity index 100% rename from Assets/_Game/_Code/Simulation/Food/FoodSpawner.cs.meta rename to Assets/_Game/_Code/Systems/Simulation/Food/FoodSpawner.cs.meta diff --git a/Assets/_Game/_Code/Simulation/Food/FoodSpawnerConfig.cs b/Assets/_Game/_Code/Systems/Simulation/Food/FoodSpawnerConfig.cs similarity index 89% rename from Assets/_Game/_Code/Simulation/Food/FoodSpawnerConfig.cs rename to Assets/_Game/_Code/Systems/Simulation/Food/FoodSpawnerConfig.cs index 3cf07ad..ff3c128 100644 --- a/Assets/_Game/_Code/Simulation/Food/FoodSpawnerConfig.cs +++ b/Assets/_Game/_Code/Systems/Simulation/Food/FoodSpawnerConfig.cs @@ -1,7 +1,7 @@ using System; using UnityEngine; -namespace Xandudex.LifeGame +namespace Life.Systems.Simulation { [Serializable] internal class FoodSpawnerConfig diff --git a/Assets/_Game/_Code/Simulation/Food/FoodSpawnerConfig.cs.meta b/Assets/_Game/_Code/Systems/Simulation/Food/FoodSpawnerConfig.cs.meta similarity index 100% rename from Assets/_Game/_Code/Simulation/Food/FoodSpawnerConfig.cs.meta rename to Assets/_Game/_Code/Systems/Simulation/Food/FoodSpawnerConfig.cs.meta diff --git a/Assets/_Game/_Code/Simulation/GameBoard.meta b/Assets/_Game/_Code/Systems/Simulation/GameBoard.meta similarity index 100% rename from Assets/_Game/_Code/Simulation/GameBoard.meta rename to Assets/_Game/_Code/Systems/Simulation/GameBoard.meta diff --git a/Assets/_Game/_Code/Simulation/GameBoard/GameBoard.cs b/Assets/_Game/_Code/Systems/Simulation/GameBoard/GameBoard.cs similarity index 76% rename from Assets/_Game/_Code/Simulation/GameBoard/GameBoard.cs rename to Assets/_Game/_Code/Systems/Simulation/GameBoard/GameBoard.cs index 99b3645..c543427 100644 --- a/Assets/_Game/_Code/Simulation/GameBoard/GameBoard.cs +++ b/Assets/_Game/_Code/Systems/Simulation/GameBoard/GameBoard.cs @@ -1,20 +1,21 @@ -using System; +using Life.Services.Save; +using System; using UnityEngine; using VContainer.Unity; -namespace Xandudex.LifeGame +namespace Life.Systems.Simulation { internal class GameBoard : IStartable, IDisposable { private readonly GameBoardView view; - private readonly SimulationSettings settings; + private readonly SimulationSettings simulationSettings; private readonly GameBoardConfig config; private readonly ISaveService saveService; - public GameBoard(GameBoardView view, SimulationSettings settings, GameBoardConfig config, ISaveService saveService) + public GameBoard(GameBoardView view, SimulationSettings simulationSettings, GameBoardConfig config, ISaveService saveService) { this.view = view; - this.settings = settings; + this.simulationSettings = simulationSettings; this.config = config; this.saveService = saveService; @@ -22,12 +23,12 @@ public GameBoard(GameBoardView view, SimulationSettings settings, GameBoardConfi } private ISaveData OnSaving() => - settings; + simulationSettings; void IStartable.Start() { view.MeshFilter.sharedMesh = GenerateMesh(); - view.NavMeshSurface.tileSize = (int)(settings.Size * 18); + view.NavMeshSurface.tileSize = (int)(simulationSettings.Size * 18); view.NavMeshSurface.BuildNavMesh(); } @@ -35,7 +36,7 @@ Mesh GenerateMesh() { Mesh mesh = new Mesh(); - uint size = settings.Size; + uint size = simulationSettings.Size; float offset = size / 2f; Vector3[] verts = new Vector3[] diff --git a/Assets/_Game/_Code/Simulation/GameBoard/GameBoard.cs.meta b/Assets/_Game/_Code/Systems/Simulation/GameBoard/GameBoard.cs.meta similarity index 100% rename from Assets/_Game/_Code/Simulation/GameBoard/GameBoard.cs.meta rename to Assets/_Game/_Code/Systems/Simulation/GameBoard/GameBoard.cs.meta diff --git a/Assets/_Game/_Code/Simulation/GameBoard/GameBoardConfig.cs b/Assets/_Game/_Code/Systems/Simulation/GameBoard/GameBoardConfig.cs similarity index 72% rename from Assets/_Game/_Code/Simulation/GameBoard/GameBoardConfig.cs rename to Assets/_Game/_Code/Systems/Simulation/GameBoard/GameBoardConfig.cs index 5997165..071dc75 100644 --- a/Assets/_Game/_Code/Simulation/GameBoard/GameBoardConfig.cs +++ b/Assets/_Game/_Code/Systems/Simulation/GameBoard/GameBoardConfig.cs @@ -1,6 +1,6 @@ using System; -namespace Xandudex.LifeGame +namespace Life.Systems.Simulation { [Serializable] internal class GameBoardConfig diff --git a/Assets/_Game/_Code/Simulation/GameBoard/GameBoardConfig.cs.meta b/Assets/_Game/_Code/Systems/Simulation/GameBoard/GameBoardConfig.cs.meta similarity index 100% rename from Assets/_Game/_Code/Simulation/GameBoard/GameBoardConfig.cs.meta rename to Assets/_Game/_Code/Systems/Simulation/GameBoard/GameBoardConfig.cs.meta diff --git a/Assets/_Game/_Code/Simulation/GameBoard/GameBoardView.cs b/Assets/_Game/_Code/Systems/Simulation/GameBoard/GameBoardView.cs similarity index 90% rename from Assets/_Game/_Code/Simulation/GameBoard/GameBoardView.cs rename to Assets/_Game/_Code/Systems/Simulation/GameBoard/GameBoardView.cs index b869114..21c07f2 100644 --- a/Assets/_Game/_Code/Simulation/GameBoard/GameBoardView.cs +++ b/Assets/_Game/_Code/Systems/Simulation/GameBoard/GameBoardView.cs @@ -1,7 +1,7 @@ using Unity.AI.Navigation; using UnityEngine; -namespace Xandudex.LifeGame +namespace Life.Systems.Simulation { internal class GameBoardView : MonoBehaviour { diff --git a/Assets/_Game/_Code/Simulation/GameBoard/GameBoardView.cs.meta b/Assets/_Game/_Code/Systems/Simulation/GameBoard/GameBoardView.cs.meta similarity index 100% rename from Assets/_Game/_Code/Simulation/GameBoard/GameBoardView.cs.meta rename to Assets/_Game/_Code/Systems/Simulation/GameBoard/GameBoardView.cs.meta diff --git a/Assets/_Game/_Code/Simulation/SimulationSettings.cs b/Assets/_Game/_Code/Systems/Simulation/SimulationSettings.cs similarity index 87% rename from Assets/_Game/_Code/Simulation/SimulationSettings.cs rename to Assets/_Game/_Code/Systems/Simulation/SimulationSettings.cs index 6c6807c..597d4d3 100644 --- a/Assets/_Game/_Code/Simulation/SimulationSettings.cs +++ b/Assets/_Game/_Code/Systems/Simulation/SimulationSettings.cs @@ -1,7 +1,8 @@ -using System; +using Life.Services.Save; +using System; using UnityEngine; -namespace Xandudex.LifeGame +namespace Life.Systems.Simulation { [Serializable] internal class SimulationSettings : ISaveData diff --git a/Assets/_Game/_Code/Simulation/SimulationSettings.cs.meta b/Assets/_Game/_Code/Systems/Simulation/SimulationSettings.cs.meta similarity index 100% rename from Assets/_Game/_Code/Simulation/SimulationSettings.cs.meta rename to Assets/_Game/_Code/Systems/Simulation/SimulationSettings.cs.meta diff --git a/Assets/_Game/_Code/Systems/Simulation/SimulationSystemMessages.cs b/Assets/_Game/_Code/Systems/Simulation/SimulationSystemMessages.cs new file mode 100644 index 0000000..6aabeab --- /dev/null +++ b/Assets/_Game/_Code/Systems/Simulation/SimulationSystemMessages.cs @@ -0,0 +1,7 @@ +namespace Life.Systems.Simulation +{ + public static class SimulationSystemMessages + { + public record AnimalEating; + } +} diff --git a/Assets/_Game/_Code/Systems/Simulation/SimulationSystemMessages.cs.meta b/Assets/_Game/_Code/Systems/Simulation/SimulationSystemMessages.cs.meta new file mode 100644 index 0000000..5d0314c --- /dev/null +++ b/Assets/_Game/_Code/Systems/Simulation/SimulationSystemMessages.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: ac60349383fe11040bf9b0c1a2b54d26 \ No newline at end of file diff --git a/Assets/_Game/_Code/UI.meta b/Assets/_Game/_Code/UI.meta new file mode 100644 index 0000000..1eb481f --- /dev/null +++ b/Assets/_Game/_Code/UI.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b981336e6009ada479da0e2ff6831912 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Game/_Code/UI/Components.meta b/Assets/_Game/_Code/UI/Components.meta new file mode 100644 index 0000000..d45434d --- /dev/null +++ b/Assets/_Game/_Code/UI/Components.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 81708e40dc92343478ecfaee0b42e425 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Game/_Code/SimulationMenu/ExtendedSlider.cs b/Assets/_Game/_Code/UI/Components/ExtendedSlider.cs similarity index 98% rename from Assets/_Game/_Code/SimulationMenu/ExtendedSlider.cs rename to Assets/_Game/_Code/UI/Components/ExtendedSlider.cs index 9230ba0..5b973f4 100644 --- a/Assets/_Game/_Code/SimulationMenu/ExtendedSlider.cs +++ b/Assets/_Game/_Code/UI/Components/ExtendedSlider.cs @@ -3,7 +3,7 @@ using UnityEngine; using UnityEngine.UI; -namespace Xandudex.LifeGame +namespace Life.UI { internal class ExtendedSlider : MonoBehaviour { diff --git a/Assets/_Game/_Code/SimulationMenu/ExtendedSlider.cs.meta b/Assets/_Game/_Code/UI/Components/ExtendedSlider.cs.meta similarity index 100% rename from Assets/_Game/_Code/SimulationMenu/ExtendedSlider.cs.meta rename to Assets/_Game/_Code/UI/Components/ExtendedSlider.cs.meta diff --git a/Assets/_Game/_Code/SimulationMenu.meta b/Assets/_Game/_Code/UI/MainMenu.meta similarity index 100% rename from Assets/_Game/_Code/SimulationMenu.meta rename to Assets/_Game/_Code/UI/MainMenu.meta diff --git a/Assets/_Game/_Code/SimulationMenu/SimulationSettingsModel.cs b/Assets/_Game/_Code/UI/MainMenu/SimulationSettingsModel.cs similarity index 84% rename from Assets/_Game/_Code/SimulationMenu/SimulationSettingsModel.cs rename to Assets/_Game/_Code/UI/MainMenu/SimulationSettingsModel.cs index 9f7c9f1..953225a 100644 --- a/Assets/_Game/_Code/SimulationMenu/SimulationSettingsModel.cs +++ b/Assets/_Game/_Code/UI/MainMenu/SimulationSettingsModel.cs @@ -1,6 +1,7 @@ -using R3; +using Life.Systems.Simulation; +using R3; -namespace Xandudex.LifeGame +namespace Life.UI.MainMenu { internal class SimulationSettingsModel { diff --git a/Assets/_Game/_Code/SimulationMenu/SimulationSettingsModel.cs.meta b/Assets/_Game/_Code/UI/MainMenu/SimulationSettingsModel.cs.meta similarity index 100% rename from Assets/_Game/_Code/SimulationMenu/SimulationSettingsModel.cs.meta rename to Assets/_Game/_Code/UI/MainMenu/SimulationSettingsModel.cs.meta diff --git a/Assets/_Game/_Code/SimulationMenu/SimulationSettingsPresenter.cs b/Assets/_Game/_Code/UI/MainMenu/SimulationSettingsPresenter.cs similarity index 92% rename from Assets/_Game/_Code/SimulationMenu/SimulationSettingsPresenter.cs rename to Assets/_Game/_Code/UI/MainMenu/SimulationSettingsPresenter.cs index d649d1c..be32acd 100644 --- a/Assets/_Game/_Code/SimulationMenu/SimulationSettingsPresenter.cs +++ b/Assets/_Game/_Code/UI/MainMenu/SimulationSettingsPresenter.cs @@ -1,8 +1,12 @@ -using System; +using Life.Data.Simulation; +using Life.Services.Save; +using Life.Services.SceneLoading; +using Life.Systems.Simulation; +using System; using UnityEngine; using VContainer.Unity; -namespace Xandudex.LifeGame +namespace Life.UI.MainMenu { internal class SimulationSettingsPresenter : IStartable, IDisposable { @@ -12,13 +16,13 @@ internal class SimulationSettingsPresenter : IStartable, IDisposable private readonly SimulationConfig config; private readonly SimulationSettingsModel model; private readonly SimulationSettingsView view; - private readonly ISceneLoader sceneLoader; + private readonly ISceneLoaderService sceneLoader; private readonly ISaveService saveService; public SimulationSettingsPresenter(SimulationConfig config, SimulationSettingsModel model, SimulationSettingsView view, - ISceneLoader sceneLoader, + ISceneLoaderService sceneLoader, ISaveService saveService) { this.config = config; diff --git a/Assets/_Game/_Code/SimulationMenu/SimulationSettingsPresenter.cs.meta b/Assets/_Game/_Code/UI/MainMenu/SimulationSettingsPresenter.cs.meta similarity index 100% rename from Assets/_Game/_Code/SimulationMenu/SimulationSettingsPresenter.cs.meta rename to Assets/_Game/_Code/UI/MainMenu/SimulationSettingsPresenter.cs.meta diff --git a/Assets/_Game/_Code/SimulationMenu/SimulationSettingsView.cs b/Assets/_Game/_Code/UI/MainMenu/SimulationSettingsView.cs similarity index 95% rename from Assets/_Game/_Code/SimulationMenu/SimulationSettingsView.cs rename to Assets/_Game/_Code/UI/MainMenu/SimulationSettingsView.cs index 3c39239..f7d11c0 100644 --- a/Assets/_Game/_Code/SimulationMenu/SimulationSettingsView.cs +++ b/Assets/_Game/_Code/UI/MainMenu/SimulationSettingsView.cs @@ -1,7 +1,7 @@ using UnityEngine; using UnityEngine.UI; -namespace Xandudex.LifeGame +namespace Life.UI.MainMenu { internal class SimulationSettingsView : MonoBehaviour { diff --git a/Assets/_Game/_Code/SimulationMenu/SimulationSettingsView.cs.meta b/Assets/_Game/_Code/UI/MainMenu/SimulationSettingsView.cs.meta similarity index 100% rename from Assets/_Game/_Code/SimulationMenu/SimulationSettingsView.cs.meta rename to Assets/_Game/_Code/UI/MainMenu/SimulationSettingsView.cs.meta diff --git a/Assets/_Game/_Code/Simulation/UI.meta b/Assets/_Game/_Code/UI/SimulationHud.meta similarity index 100% rename from Assets/_Game/_Code/Simulation/UI.meta rename to Assets/_Game/_Code/UI/SimulationHud.meta diff --git a/Assets/_Game/_Code/Simulation/UI/SimulationUiPresenter.cs b/Assets/_Game/_Code/UI/SimulationHud/SimulationUiPresenter.cs similarity index 86% rename from Assets/_Game/_Code/Simulation/UI/SimulationUiPresenter.cs rename to Assets/_Game/_Code/UI/SimulationHud/SimulationUiPresenter.cs index 318a486..c8b267c 100644 --- a/Assets/_Game/_Code/Simulation/UI/SimulationUiPresenter.cs +++ b/Assets/_Game/_Code/UI/SimulationHud/SimulationUiPresenter.cs @@ -1,17 +1,19 @@ +using Life.Services.Save; +using Life.Services.SceneLoading; using System; using UnityEngine; using VContainer.Unity; -namespace Xandudex.LifeGame +namespace Life.UI.SimulationHud { internal class SimulationUiPresenter : IStartable, IDisposable { private const string MenuSceneName = "Menu Scene"; private readonly SimulationUiView view; - private readonly ISceneLoader sceneLoader; + private readonly ISceneLoaderService sceneLoader; private readonly ISaveService saveService; - public SimulationUiPresenter(SimulationUiView view, ISceneLoader sceneLoader, ISaveService saveService) + public SimulationUiPresenter(SimulationUiView view, ISceneLoaderService sceneLoader, ISaveService saveService) { this.view = view; this.sceneLoader = sceneLoader; diff --git a/Assets/_Game/_Code/Simulation/UI/SimulationUiPresenter.cs.meta b/Assets/_Game/_Code/UI/SimulationHud/SimulationUiPresenter.cs.meta similarity index 100% rename from Assets/_Game/_Code/Simulation/UI/SimulationUiPresenter.cs.meta rename to Assets/_Game/_Code/UI/SimulationHud/SimulationUiPresenter.cs.meta diff --git a/Assets/_Game/_Code/Simulation/UI/SimulationUiView.cs b/Assets/_Game/_Code/UI/SimulationHud/SimulationUiView.cs similarity index 92% rename from Assets/_Game/_Code/Simulation/UI/SimulationUiView.cs rename to Assets/_Game/_Code/UI/SimulationHud/SimulationUiView.cs index 2e147b1..ef01d5c 100644 --- a/Assets/_Game/_Code/Simulation/UI/SimulationUiView.cs +++ b/Assets/_Game/_Code/UI/SimulationHud/SimulationUiView.cs @@ -1,7 +1,7 @@ using UnityEngine; using UnityEngine.UI; -namespace Xandudex.LifeGame +namespace Life.UI.SimulationHud { internal class SimulationUiView : MonoBehaviour { diff --git a/Assets/_Game/_Code/Simulation/UI/SimulationUiView.cs.meta b/Assets/_Game/_Code/UI/SimulationHud/SimulationUiView.cs.meta similarity index 100% rename from Assets/_Game/_Code/Simulation/UI/SimulationUiView.cs.meta rename to Assets/_Game/_Code/UI/SimulationHud/SimulationUiView.cs.meta diff --git a/Assets/_Game/_Code/Utility.meta b/Assets/_Game/_Code/Utilities.meta similarity index 100% rename from Assets/_Game/_Code/Utility.meta rename to Assets/_Game/_Code/Utilities.meta diff --git a/Assets/_Game/_Code/Infrastructure/Important.meta b/Assets/_Game/_Code/Utilities/Important.meta similarity index 100% rename from Assets/_Game/_Code/Infrastructure/Important.meta rename to Assets/_Game/_Code/Utilities/Important.meta diff --git a/Assets/_Game/_Code/Infrastructure/Important/IsExternalInit.cs b/Assets/_Game/_Code/Utilities/Important/IsExternalInit.cs similarity index 100% rename from Assets/_Game/_Code/Infrastructure/Important/IsExternalInit.cs rename to Assets/_Game/_Code/Utilities/Important/IsExternalInit.cs diff --git a/Assets/_Game/_Code/Infrastructure/Important/IsExternalInit.cs.meta b/Assets/_Game/_Code/Utilities/Important/IsExternalInit.cs.meta similarity index 100% rename from Assets/_Game/_Code/Infrastructure/Important/IsExternalInit.cs.meta rename to Assets/_Game/_Code/Utilities/Important/IsExternalInit.cs.meta diff --git a/Assets/_Game/_Code/Utilities/Service.cs b/Assets/_Game/_Code/Utilities/Service.cs new file mode 100644 index 0000000..d954d49 --- /dev/null +++ b/Assets/_Game/_Code/Utilities/Service.cs @@ -0,0 +1,26 @@ +using R3; +using System; +using System.Threading; + +namespace Life.Utilities +{ + public abstract class Service : IDisposable + { + readonly CancellationTokenSource disposeCancellationTokenSource = new(); + readonly CompositeDisposable disposables = new(); + + public CancellationToken DisposeCancellationToken => disposeCancellationTokenSource.Token; + public CompositeDisposable Disposables => disposables; + + void IDisposable.Dispose() + { + disposeCancellationTokenSource.Cancel(); + disposeCancellationTokenSource.Dispose(); + + Dispose(); + } + + protected virtual void Dispose() { } + } +} + diff --git a/Assets/_Game/_Code/Utilities/Service.cs.meta b/Assets/_Game/_Code/Utilities/Service.cs.meta new file mode 100644 index 0000000..e6ca0b2 --- /dev/null +++ b/Assets/_Game/_Code/Utilities/Service.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b35c36458b4088a4ba002829f37a52f7 \ No newline at end of file diff --git a/Assets/_Game/_Code/Utility/StateMachine.meta b/Assets/_Game/_Code/Utilities/StateMachine.meta similarity index 100% rename from Assets/_Game/_Code/Utility/StateMachine.meta rename to Assets/_Game/_Code/Utilities/StateMachine.meta diff --git a/Assets/_Game/_Code/Utility/StateMachine/IExitableState.cs b/Assets/_Game/_Code/Utilities/StateMachine/IExitableState.cs similarity index 100% rename from Assets/_Game/_Code/Utility/StateMachine/IExitableState.cs rename to Assets/_Game/_Code/Utilities/StateMachine/IExitableState.cs diff --git a/Assets/_Game/_Code/Utility/StateMachine/IExitableState.cs.meta b/Assets/_Game/_Code/Utilities/StateMachine/IExitableState.cs.meta similarity index 100% rename from Assets/_Game/_Code/Utility/StateMachine/IExitableState.cs.meta rename to Assets/_Game/_Code/Utilities/StateMachine/IExitableState.cs.meta diff --git a/Assets/_Game/_Code/Utility/StateMachine/IPayloadedState.cs b/Assets/_Game/_Code/Utilities/StateMachine/IPayloadedState.cs similarity index 100% rename from Assets/_Game/_Code/Utility/StateMachine/IPayloadedState.cs rename to Assets/_Game/_Code/Utilities/StateMachine/IPayloadedState.cs diff --git a/Assets/_Game/_Code/Utility/StateMachine/IPayloadedState.cs.meta b/Assets/_Game/_Code/Utilities/StateMachine/IPayloadedState.cs.meta similarity index 100% rename from Assets/_Game/_Code/Utility/StateMachine/IPayloadedState.cs.meta rename to Assets/_Game/_Code/Utilities/StateMachine/IPayloadedState.cs.meta diff --git a/Assets/_Game/_Code/Utility/StateMachine/IState.cs b/Assets/_Game/_Code/Utilities/StateMachine/IState.cs similarity index 100% rename from Assets/_Game/_Code/Utility/StateMachine/IState.cs rename to Assets/_Game/_Code/Utilities/StateMachine/IState.cs diff --git a/Assets/_Game/_Code/Utility/StateMachine/IState.cs.meta b/Assets/_Game/_Code/Utilities/StateMachine/IState.cs.meta similarity index 100% rename from Assets/_Game/_Code/Utility/StateMachine/IState.cs.meta rename to Assets/_Game/_Code/Utilities/StateMachine/IState.cs.meta diff --git a/Assets/_Game/_Code/Utility/StateMachine/IStateMachine.cs b/Assets/_Game/_Code/Utilities/StateMachine/IStateMachine.cs similarity index 100% rename from Assets/_Game/_Code/Utility/StateMachine/IStateMachine.cs rename to Assets/_Game/_Code/Utilities/StateMachine/IStateMachine.cs diff --git a/Assets/_Game/_Code/Utility/StateMachine/IStateMachine.cs.meta b/Assets/_Game/_Code/Utilities/StateMachine/IStateMachine.cs.meta similarity index 100% rename from Assets/_Game/_Code/Utility/StateMachine/IStateMachine.cs.meta rename to Assets/_Game/_Code/Utilities/StateMachine/IStateMachine.cs.meta diff --git a/Packages/manifest.json b/Packages/manifest.json index ec1c8cc..4c2c86b 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -3,12 +3,13 @@ "com.cysharp.messagepipe": "1.8.1", "com.cysharp.messagepipe.vcontainer": "1.8.1", "com.cysharp.unitask": "2.5.5", - "com.unity.ai.navigation": "2.0.0", - "com.unity.collab-proxy": "2.4.3", + "com.unity.ai.navigation": "2.0.4", + "com.unity.collab-proxy": "2.5.2", "com.unity.ide.visualstudio": "2.0.22", - "com.unity.inputsystem": "1.8.2", + "com.unity.inputsystem": "1.11.1", + "com.unity.multiplayer.center": "1.0.0", "com.unity.render-pipelines.universal": "17.0.3", - "com.unity.test-framework": "1.4.4", + "com.unity.test-framework": "1.4.5", "com.unity.timeline": "1.8.7", "com.unity.ugui": "2.0.0", "com.unity.visualeffectgraph": "17.0.3", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 8fe929b..a13c39c 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -22,7 +22,7 @@ "url": "https://package.openupm.com" }, "com.unity.ai.navigation": { - "version": "2.0.0", + "version": "2.0.4", "depth": 0, "source": "registry", "dependencies": { @@ -31,7 +31,7 @@ "url": "https://packages.unity.com" }, "com.unity.burst": { - "version": "1.8.16", + "version": "1.8.18", "depth": 2, "source": "registry", "dependencies": { @@ -41,20 +41,20 @@ "url": "https://packages.unity.com" }, "com.unity.collab-proxy": { - "version": "2.4.3", + "version": "2.5.2", "depth": 0, "source": "registry", "dependencies": {}, "url": "https://packages.unity.com" }, "com.unity.collections": { - "version": "2.4.1", + "version": "2.5.1", "depth": 2, "source": "registry", "dependencies": { - "com.unity.burst": "1.8.13", + "com.unity.burst": "1.8.17", + "com.unity.test-framework": "1.4.5", "com.unity.nuget.mono-cecil": "1.11.4", - "com.unity.test-framework": "1.4.3", "com.unity.test-framework.performance": "3.0.3" }, "url": "https://packages.unity.com" @@ -76,7 +76,7 @@ "url": "https://packages.unity.com" }, "com.unity.inputsystem": { - "version": "1.8.2", + "version": "1.11.1", "depth": 0, "source": "registry", "dependencies": { @@ -91,6 +91,14 @@ "dependencies": {}, "url": "https://packages.unity.com" }, + "com.unity.multiplayer.center": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.uielements": "1.0.0" + } + }, "com.unity.nuget.mono-cecil": { "version": "1.11.4", "depth": 3, @@ -106,7 +114,7 @@ "com.unity.burst": "1.8.14", "com.unity.mathematics": "1.3.2", "com.unity.ugui": "2.0.0", - "com.unity.collections": "2.4.1", + "com.unity.collections": "2.4.3", "com.unity.modules.physics": "1.0.0", "com.unity.modules.terrain": "1.0.0", "com.unity.modules.jsonserialize": "1.0.0", @@ -158,7 +166,7 @@ } }, "com.unity.test-framework": { - "version": "1.4.4", + "version": "1.4.5", "depth": 0, "source": "registry", "dependencies": { @@ -183,9 +191,9 @@ "depth": 0, "source": "registry", "dependencies": { + "com.unity.modules.audio": "1.0.0", "com.unity.modules.director": "1.0.0", "com.unity.modules.animation": "1.0.0", - "com.unity.modules.audio": "1.0.0", "com.unity.modules.particlesystem": "1.0.0" }, "url": "https://packages.unity.com" diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset index e7538b9..d13aab7 100644 --- a/ProjectSettings/EditorBuildSettings.asset +++ b/ProjectSettings/EditorBuildSettings.asset @@ -8,12 +8,12 @@ EditorBuildSettings: - enabled: 1 path: Assets/_Game/Scenes/Bootstrap Scene.unity guid: 99c9720ab356a0642a771bea13969a05 - - enabled: 1 - path: Assets/_Game/Scenes/Game Scene.unity - guid: bab3afbf1921bc045abbc50884b016d2 - enabled: 1 path: Assets/_Game/Scenes/Menu Scene.unity guid: 96553a87764559644bd228d17735c7d3 + - enabled: 1 + path: Assets/_Game/Scenes/Game Scene.unity + guid: bab3afbf1921bc045abbc50884b016d2 m_configObjects: com.unity.input.settings.actions: {fileID: -944628639613478452, guid: 052faaac586de48259a63d0c4782560b, type: 3} m_UseUCBPForAssetBundles: 0 diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index 1af070b..11b73a4 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 6000.0.9f1 -m_EditorVersionWithRevision: 6000.0.9f1 (1490908003ac) +m_EditorVersion: 6000.0.23f1 +m_EditorVersionWithRevision: 6000.0.23f1 (1c4764c07fb4)