diff --git a/Assets/Scenes/MainMenu.unity b/Assets/Scenes/MainMenu.unity index 806b0f617068c05b5681ac61008263a94b63cc30..8af5e208c4e11239a9a7ceb1dd62c8c59b4389f0 100644 --- a/Assets/Scenes/MainMenu.unity +++ b/Assets/Scenes/MainMenu.unity @@ -168,7 +168,7 @@ Camera: far clip plane: 1000 field of view: 60 orthographic: 1 - orthographic size: 5 + orthographic size: 15 m_Depth: -1 m_CullingMask: serializedVersion: 2 @@ -176,12 +176,12 @@ Camera: m_RenderingPath: -1 m_TargetTexture: {fileID: 0} m_TargetDisplay: 0 - m_TargetEye: 3 + m_TargetEye: 0 m_HDR: 1 - m_AllowMSAA: 1 + m_AllowMSAA: 0 m_AllowDynamicResolution: 0 m_ForceIntoRT: 0 - m_OcclusionCulling: 1 + m_OcclusionCulling: 0 m_StereoConvergence: 10 m_StereoSeparation: 0.022 --- !u!4 &22100159 @@ -192,7 +192,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 22100156} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalPosition: {x: -10, y: -1, z: -10} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} @@ -221,7 +221,7 @@ MonoBehaviour: m_Bits: 1 m_VolumeTrigger: {fileID: 0} m_VolumeFrameworkUpdateModeOption: 2 - m_RenderPostProcessing: 0 + m_RenderPostProcessing: 1 m_Antialiasing: 0 m_AntialiasingQuality: 2 m_StopNaN: 0 @@ -298,8 +298,9 @@ GameObject: m_Component: - component: {fileID: 1584077027} - component: {fileID: 1584077026} + - component: {fileID: 1584077028} m_Layer: 0 - m_Name: Simulation Supervisor + m_Name: Simulation m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -335,6 +336,7 @@ MonoBehaviour: unitTypes: - {fileID: 11400000, guid: 990eddc6120b95548a91484d5cad18ff, type: 2} - {fileID: 11400000, guid: 7cde7bea9bf73ac44bd6563d6b5d7aeb, type: 2} + simulationManager: {fileID: 1584077028} --- !u!4 &1584077027 Transform: m_ObjectHideFlags: 0 @@ -343,12 +345,28 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1584077025} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -3.1338203, y: -0.28453794, z: -38.83009} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1584077028 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1584077025} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cf7c5a8235d14edca54533665a0d3ee8, type: 3} + m_Name: + m_EditorClassIdentifier: + overviewConfig: {fileID: 11400000, guid: 7c8cbf053badd4b41b80657b3ac3f9b0, type: 2} + economyConfig: {fileID: 11400000, guid: 81bfec33eeaebc34587067be5f4845a9, type: 2} + worldConfig: {fileID: 11400000, guid: f37879d5fb4127c42985f515a7ab96c3, type: 2} + mainCamera: {fileID: 22100158} --- !u!1 &1622117628 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/Simulation.unity b/Assets/Scenes/Simulation.unity index 472d2de98e2bcf6bc5eb1a7a6740025ea79da474..220b73672343ac19a706893f6487cdfc7ad31b94 100644 --- a/Assets/Scenes/Simulation.unity +++ b/Assets/Scenes/Simulation.unity @@ -184,92 +184,6 @@ MonoBehaviour: m_ParentUI: {fileID: 0} sourceAsset: {fileID: 9197481963319205126, guid: f9de41cf7d846754c941d7b53b94451f, type: 3} m_SortingOrder: 0 ---- !u!1 &115605301 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 115605303} - - component: {fileID: 115605302} - - component: {fileID: 115605304} - m_Layer: 0 - m_Name: World Light - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &115605302 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 115605301} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 073797afb82c5a1438f328866b10b3f0, type: 3} - m_Name: - m_EditorClassIdentifier: - m_LightType: 1 - m_BlendStyleIndex: 0 - m_FalloffIntensity: 0.6 - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_Intensity: 0.6 - m_LightVolumeOpacity: 0 - m_ApplyToSortingLayers: 25f3810c000000001d2c89f43d6c3ed311650b1f49d0a7b8ffbd4d6b857aff912f3a3480f1cc4664294bc3991bba19c81fcc8c06ad50f4cc - m_LightCookieSprite: {fileID: 0} - m_UseNormalMap: 0 - m_LightOrder: 0 - m_AlphaBlendOnOverlap: 0 - m_ShadowIntensity: 0 - m_ShadowVolumeIntensity: 0 - m_PointLightInnerAngle: 360 - m_PointLightOuterAngle: 360 - m_PointLightInnerRadius: 0 - m_PointLightOuterRadius: 1 - m_PointLightDistance: 3 - m_PointLightQuality: 1 - m_ShapeLightParametricSides: 4 - m_ShapeLightParametricAngleOffset: 0 - m_ShapeLightParametricRadius: 1 - m_ShapeLightFalloffSize: 10 - m_ShapeLightFalloffOffset: {x: 0, y: 0} - m_ShapePath: - - {x: -0.5, y: -0.5, z: 0} - - {x: 0.5, y: -0.5, z: 0} - - {x: 0.5, y: 0.5, z: 0} - - {x: -0.5, y: 0.5, z: 0} ---- !u!4 &115605303 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 115605301} - 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_Children: [] - m_Father: {fileID: 1772625070} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &115605304 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 115605301} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 43da71e1cff6405d81016c17e173d9be, type: 3} - m_Name: - m_EditorClassIdentifier: - shapeLight: {fileID: 115605302} --- !u!1 &240370939 GameObject: m_ObjectHideFlags: 0 @@ -443,7 +357,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 3 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &519420028 GameObject: @@ -646,59 +560,6 @@ MonoBehaviour: unitTypes: - {fileID: 11400000, guid: 990eddc6120b95548a91484d5cad18ff, type: 2} - {fileID: 11400000, guid: 7cde7bea9bf73ac44bd6563d6b5d7aeb, type: 2} ---- !u!1 &1772625069 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1772625070} - - component: {fileID: 1772625071} - m_Layer: 0 - m_Name: World - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1772625070 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1772625069} - 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_Children: - - {fileID: 115605303} - m_Father: {fileID: 0} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1772625071 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1772625069} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5895d66a18c34b22a2a30b9da3831f80, type: 3} - m_Name: - m_EditorClassIdentifier: - tilePrefab: {fileID: 1691539168291297187, guid: 846a201408892e848b6101f9025eadd3, type: 3} - barrackPrefab: {fileID: 1733402779209516526, guid: 0353290a5d72b7741b57f1ba3d700f9e, type: 3} - obstaclePrefab: {fileID: 75571796123299443, guid: 00a3c959845a40a4cbe845f0810fb4af, type: 3} - towerPrefab: {fileID: 1091641560809420229, guid: 7453f2c5b0de1434f8b333c2b8f45a29, type: 3} - castlePrefab: {fileID: 9084711428161005313, guid: 14fe3b5463cc4d24c8a07b1d1f912fd7, type: 3} - unitPrefab: {fileID: 8268301215112136559, guid: 89351f8508198b049a8fa60e02fb638d, type: 3} - tileHighlightPrefab: {fileID: 1691539168291297187, guid: 7784762b60ea8a84580dfd13cebd6afb, type: 3} - towerRadiusHighlightPrefab: {fileID: 7967503270793754117, guid: f9c1e45b237058c49ae2d4c09f8715dd, type: 3} - environmentPrefab: {fileID: 5874974756031650793, guid: 71e9029c69294b34988f957accd09dbf, type: 3} --- !u!1 &1799972800 GameObject: m_ObjectHideFlags: 0 @@ -733,7 +594,7 @@ Transform: - {fileID: 43726851} - {fileID: 1998696471} m_Father: {fileID: 0} - m_RootOrder: 5 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &1799972802 MonoBehaviour: @@ -819,7 +680,7 @@ PrefabInstance: m_Modifications: - target: {fileID: 2360183991406698723, guid: 87a9db821fc436b488939bd8b9b24982, type: 3} propertyPath: m_RootOrder - value: 4 + value: 2 objectReference: {fileID: 0} - target: {fileID: 2360183991406698723, guid: 87a9db821fc436b488939bd8b9b24982, type: 3} propertyPath: m_LocalPosition.x @@ -867,60 +728,3 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 87a9db821fc436b488939bd8b9b24982, type: 3} ---- !u!1001 &3535550307983769005 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 3535550307654630185, guid: 6c3b1882f9a6da24c92bdbb31c5c0d1a, type: 3} - propertyPath: m_Name - value: Post-Process Volume - objectReference: {fileID: 0} - - target: {fileID: 3535550307654630187, guid: 6c3b1882f9a6da24c92bdbb31c5c0d1a, type: 3} - propertyPath: m_RootOrder - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 3535550307654630187, guid: 6c3b1882f9a6da24c92bdbb31c5c0d1a, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3535550307654630187, guid: 6c3b1882f9a6da24c92bdbb31c5c0d1a, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3535550307654630187, guid: 6c3b1882f9a6da24c92bdbb31c5c0d1a, type: 3} - propertyPath: m_LocalPosition.z - value: -10 - objectReference: {fileID: 0} - - target: {fileID: 3535550307654630187, guid: 6c3b1882f9a6da24c92bdbb31c5c0d1a, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 3535550307654630187, guid: 6c3b1882f9a6da24c92bdbb31c5c0d1a, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3535550307654630187, guid: 6c3b1882f9a6da24c92bdbb31c5c0d1a, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3535550307654630187, guid: 6c3b1882f9a6da24c92bdbb31c5c0d1a, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3535550307654630187, guid: 6c3b1882f9a6da24c92bdbb31c5c0d1a, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3535550307654630187, guid: 6c3b1882f9a6da24c92bdbb31c5c0d1a, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3535550307654630187, guid: 6c3b1882f9a6da24c92bdbb31c5c0d1a, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 6c3b1882f9a6da24c92bdbb31c5c0d1a, type: 3} diff --git a/Assets/Scenes/SimulationCore.unity b/Assets/Scenes/SimulationCore.unity new file mode 100644 index 0000000000000000000000000000000000000000..15b8e1764265bb24e47e919ad149ccd8111f0234 --- /dev/null +++ b/Assets/Scenes/SimulationCore.unity @@ -0,0 +1,321 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &664004130 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 664004131} + - component: {fileID: 664004133} + - component: {fileID: 664004132} + m_Layer: 0 + m_Name: World Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &664004131 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 664004130} + 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_Children: [] + m_Father: {fileID: 1952138355} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &664004132 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 664004130} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 43da71e1cff6405d81016c17e173d9be, type: 3} + m_Name: + m_EditorClassIdentifier: + shapeLight: {fileID: 664004133} +--- !u!114 &664004133 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 664004130} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 073797afb82c5a1438f328866b10b3f0, type: 3} + m_Name: + m_EditorClassIdentifier: + m_LightType: 1 + m_BlendStyleIndex: 0 + m_FalloffIntensity: 0.6 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 0.6 + m_LightVolumeOpacity: 0 + m_ApplyToSortingLayers: 25f3810c000000001d2c89f43d6c3ed311650b1f49d0a7b8ffbd4d6b857aff912f3a3480f1cc4664294bc3991bba19c81fcc8c06ad50f4cc + m_LightCookieSprite: {fileID: 0} + m_UseNormalMap: 0 + m_LightOrder: 0 + m_AlphaBlendOnOverlap: 0 + m_ShadowIntensity: 0 + m_ShadowVolumeIntensity: 0 + m_PointLightInnerAngle: 360 + m_PointLightOuterAngle: 360 + m_PointLightInnerRadius: 0 + m_PointLightOuterRadius: 1 + m_PointLightDistance: 3 + m_PointLightQuality: 1 + m_ShapeLightParametricSides: 4 + m_ShapeLightParametricAngleOffset: 0 + m_ShapeLightParametricRadius: 1 + m_ShapeLightFalloffSize: 10 + m_ShapeLightFalloffOffset: {x: 0, y: 0} + m_ShapePath: + - {x: -0.5, y: -0.5, z: 0} + - {x: 0.5, y: -0.5, z: 0} + - {x: 0.5, y: 0.5, z: 0} + - {x: -0.5, y: 0.5, z: 0} +--- !u!1001 &1489965357 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 3535550307654630185, guid: 6c3b1882f9a6da24c92bdbb31c5c0d1a, type: 3} + propertyPath: m_Name + value: Post-Process Volume + objectReference: {fileID: 0} + - target: {fileID: 3535550307654630187, guid: 6c3b1882f9a6da24c92bdbb31c5c0d1a, type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3535550307654630187, guid: 6c3b1882f9a6da24c92bdbb31c5c0d1a, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3535550307654630187, guid: 6c3b1882f9a6da24c92bdbb31c5c0d1a, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3535550307654630187, guid: 6c3b1882f9a6da24c92bdbb31c5c0d1a, type: 3} + propertyPath: m_LocalPosition.z + value: -10 + objectReference: {fileID: 0} + - target: {fileID: 3535550307654630187, guid: 6c3b1882f9a6da24c92bdbb31c5c0d1a, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3535550307654630187, guid: 6c3b1882f9a6da24c92bdbb31c5c0d1a, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3535550307654630187, guid: 6c3b1882f9a6da24c92bdbb31c5c0d1a, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3535550307654630187, guid: 6c3b1882f9a6da24c92bdbb31c5c0d1a, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3535550307654630187, guid: 6c3b1882f9a6da24c92bdbb31c5c0d1a, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3535550307654630187, guid: 6c3b1882f9a6da24c92bdbb31c5c0d1a, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3535550307654630187, guid: 6c3b1882f9a6da24c92bdbb31c5c0d1a, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 6c3b1882f9a6da24c92bdbb31c5c0d1a, type: 3} +--- !u!1 &1952138353 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1952138355} + - component: {fileID: 1952138354} + m_Layer: 0 + m_Name: World + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1952138354 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1952138353} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5895d66a18c34b22a2a30b9da3831f80, type: 3} + m_Name: + m_EditorClassIdentifier: + tilePrefab: {fileID: 1691539168291297187, guid: 846a201408892e848b6101f9025eadd3, type: 3} + barrackPrefab: {fileID: 1733402779209516526, guid: 0353290a5d72b7741b57f1ba3d700f9e, type: 3} + obstaclePrefab: {fileID: 75571796123299443, guid: 00a3c959845a40a4cbe845f0810fb4af, type: 3} + towerPrefab: {fileID: 1091641560809420229, guid: 7453f2c5b0de1434f8b333c2b8f45a29, type: 3} + castlePrefab: {fileID: 9084711428161005313, guid: 14fe3b5463cc4d24c8a07b1d1f912fd7, type: 3} + unitPrefab: {fileID: 8268301215112136559, guid: 89351f8508198b049a8fa60e02fb638d, type: 3} + tileHighlightPrefab: {fileID: 1691539168291297187, guid: 7784762b60ea8a84580dfd13cebd6afb, type: 3} + towerRadiusHighlightPrefab: {fileID: 7967503270793754117, guid: f9c1e45b237058c49ae2d4c09f8715dd, type: 3} + environmentPrefab: {fileID: 5874974756031650793, guid: 71e9029c69294b34988f957accd09dbf, type: 3} +--- !u!4 &1952138355 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1952138353} + 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_Children: + - {fileID: 664004131} + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/Scenes/SimulationCore.unity.meta b/Assets/Scenes/SimulationCore.unity.meta new file mode 100644 index 0000000000000000000000000000000000000000..c1c3d2b1ca599544ab17b9303546a8df1c338807 --- /dev/null +++ b/Assets/Scenes/SimulationCore.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2e0470e306cf0064fa5eaec70be06fcf +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Presentation/World/MainMenuSimulationSupervisor.cs b/Assets/Scripts/Presentation/World/MainMenuSimulationSupervisor.cs index f331301e4e3007a311bf002270204dcc786a7eb8..9dd795a13f4f3dca730e10d1806a20c7bab56d70 100644 --- a/Assets/Scripts/Presentation/World/MainMenuSimulationSupervisor.cs +++ b/Assets/Scripts/Presentation/World/MainMenuSimulationSupervisor.cs @@ -8,17 +8,12 @@ using Logic.Command.Unit; using Logic.Data; using Logic.Data.World; using Logic.Event; -using Presentation.UI; using UnityEngine; -using UnityEngine.SceneManagement; using Color = UnityEngine.Color; using Random = UnityEngine.Random; namespace Presentation.World { public class MainMenuSimulationSupervisor : MonoBehaviour { - private const string SimulationScenePath = "Scenes/Simulation"; - private const string SimulationSceneName = "Simulation"; - [SerializeField] private int minTowerPlacingAttempts = 5; @@ -58,50 +53,26 @@ public class MainMenuSimulationSupervisor : MonoBehaviour { [SerializeField] private List<UnitData> unitTypes; + [SerializeField] + private SimulationManager simulationManager; + private readonly List<IUnitData> _modifiedUnitTypes = new List<IUnitData>(); private IEnumerator _simulationCoroutine; private void Start() { - _simulationCoroutine = null; - // we don't want to destroy castles _modifiedUnitTypes.AddRange(unitTypes.Select(unit => new NoDamageUnitDataProxy(unit))); - SceneManager.sceneLoaded += OnSceneLoaded; - SceneManager.LoadScene(SimulationScenePath, LoadSceneMode.Additive); + _simulationCoroutine = StartSimulation(); + StartCoroutine(_simulationCoroutine); } private void OnDestroy() { - SceneManager.sceneLoaded -= OnSceneLoaded; if (_simulationCoroutine != null) StopCoroutine(_simulationCoroutine); } - private static T FindObjectInRootObjects<T>(Scene scene) where T : MonoBehaviour { - return scene.GetRootGameObjects() - .Select(rootGameObject => rootGameObject.GetComponent<T>()) - .FirstOrDefault(component => component != null); - } - - private static void RemoveSimulationUI(Scene scene) { - var simulationUI = FindObjectInRootObjects<SimulationUI>(scene); - simulationUI.gameObject.SetActive(false); - } - - private static void MoveWorld(Scene scene) { - var simulationCamera = FindObjectInRootObjects<SimulationCamera>(scene); - - simulationCamera.transform.position = new Vector3(-10, -2, -10); - simulationCamera.GetComponent<Camera>().orthographicSize = 15; - } - - private IEnumerator StartSimulation(Scene scene) { - RemoveSimulationUI(scene); - MoveWorld(scene); - - var manager = FindObjectInRootObjects<SimulationManager>(scene); - yield return new WaitUntil(() => manager.GameOverview != null); - - IGameOverview overview = manager.GameOverview; + private IEnumerator StartSimulation() { + IGameOverview overview = simulationManager.GameOverview; if (overview.CurrentPhase == GamePhase.Prepare) yield return PreparePhase(overview); overview.Events.AddListener<PhaseAdvancedEvent>(OnPhaseAdvanced); @@ -179,13 +150,6 @@ public class MainMenuSimulationSupervisor : MonoBehaviour { } } - private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { - if (scene.name != SimulationSceneName || mode != LoadSceneMode.Additive) return; - if (_simulationCoroutine != null) Debug.LogError("The simulation is already running"); - _simulationCoroutine = StartSimulation(scene); - StartCoroutine(_simulationCoroutine); - } - private class NoDamageUnitDataProxy : IUnitData { private readonly IUnitData source; diff --git a/Assets/Scripts/Presentation/World/SimulationManager.cs b/Assets/Scripts/Presentation/World/SimulationManager.cs index 3661e7fdd9a51581cb40a99707b5622a7dc8aad0..db2dd02ce43c5df55ad6db9aeb202cca6b0a8dd4 100644 --- a/Assets/Scripts/Presentation/World/SimulationManager.cs +++ b/Assets/Scripts/Presentation/World/SimulationManager.cs @@ -5,6 +5,7 @@ using Logic.Data.World; using Presentation.UI; using Presentation.World.Config; using UnityEngine; +using UnityEngine.SceneManagement; using UnityEngine.UIElements; using Random = UnityEngine.Random; @@ -32,6 +33,8 @@ public class SimulationManager : MonoBehaviour { public IGameOverview GameOverview { get; private set; } private void Awake() { + SceneManager.LoadScene("Scenes/SimulationCore", LoadSceneMode.Additive); + void ExceptionHandler(Exception e) { Debug.LogError($"[Logic Exception]: ${e} {e.InnerException}"); } diff --git a/Assets/Scripts/Presentation/World/World.cs b/Assets/Scripts/Presentation/World/World.cs index a15fdfa6fc83335e4f15d1f7a1736295c9213c50..f47c8f842ab99bbd5df5d9993ce3bf154b41b774 100644 --- a/Assets/Scripts/Presentation/World/World.cs +++ b/Assets/Scripts/Presentation/World/World.cs @@ -283,6 +283,8 @@ public class World : MonoBehaviour { float remainingTime = 0.15f; while (remainingTime > 0) { yield return new WaitForFixedUpdate(); + if (laserRenderer == null) yield break; //the tower got destroyed + remainingTime -= Time.fixedDeltaTime; if (e.Target.IsAlive) { diff --git a/Assets/World/Config/MainMenuWorldConfig.asset b/Assets/World/Config/MainMenuWorldConfig.asset new file mode 100644 index 0000000000000000000000000000000000000000..365a57c7f46653b10b2a8b8c2f4e1c5f2733482f --- /dev/null +++ b/Assets/World/Config/MainMenuWorldConfig.asset @@ -0,0 +1,22 @@ +%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: 50503fc21cc44b48bb7e0f7915b28965, type: 3} + m_Name: MainMenuWorldConfig + m_EditorClassIdentifier: + minWidth: 16 + maxWidth: 16 + minHeight: 16 + maxHeight: 16 + barrackSpawnCooldownTime: 0.6 + castleStartingHealth: 10 + maxBuildingDistance: 3 + barrackSpawnTimeOffset: 0.1 diff --git a/Assets/World/Config/MainMenuWorldConfig.asset.meta b/Assets/World/Config/MainMenuWorldConfig.asset.meta new file mode 100644 index 0000000000000000000000000000000000000000..9089961f700984513c114ce6a383b58f00571556 --- /dev/null +++ b/Assets/World/Config/MainMenuWorldConfig.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f37879d5fb4127c42985f515a7ab96c3 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset index f4d16825c952738f390c577619d6063c873d5cab..a8160766ba218c5e004c80c283deef970909d362 100644 --- a/ProjectSettings/EditorBuildSettings.asset +++ b/ProjectSettings/EditorBuildSettings.asset @@ -11,4 +11,7 @@ EditorBuildSettings: - enabled: 1 path: Assets/Scenes/Simulation.unity guid: 2cda990e2423bbf4892e6590ba056729 + - enabled: 1 + path: Assets/Scenes/SimulationCore.unity + guid: 2e0470e306cf0064fa5eaec70be06fcf m_configObjects: {}