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/UI/SimulationUI.cs b/Assets/Scripts/Presentation/UI/SimulationUI.cs index b1e5ae50017fa9709cb1d6604f734f7d65503688..99e26eae1d5cca4e8d5632993f5bf36cb1bb34e4 100644 --- a/Assets/Scripts/Presentation/UI/SimulationUI.cs +++ b/Assets/Scripts/Presentation/UI/SimulationUI.cs @@ -35,7 +35,7 @@ public class SimulationUI : MonoBehaviour { private UIState _lastUiState; private PauseOverlay _pauseOverlay; private Barrack _selectedBarrack; - private TowerTypeData _selectedTowerType; + private ITowerData _selectedTowerType; private SimulationManager _simulationManager; private TowerPlacingUI _towerPlacing; @@ -203,7 +203,7 @@ public class SimulationUI : MonoBehaviour { } } - private void OnUnitPurchased(UnitTypeData unitType) { + private void OnUnitPurchased(IUnitData unitType) { var command = new PurchaseUnitCommand(GameOverview.GetTeam(_activePlayer), unitType); if (GameOverview.Commands.Issue(command)) _unitDeployment.UpdateBoughtUnitCount(unitType); } @@ -233,7 +233,7 @@ public class SimulationUI : MonoBehaviour { UpdateUiState(UIState.UnitDeployment); } - private void OnTowerTypeSelected(TowerTypeData towerType) { + private void OnTowerTypeSelected(ITowerData towerType) { _selectedTowerType = towerType; _towerPlacing.ShowTowerTypeStats(towerType); OnTowerSelected?.Invoke(null); diff --git a/Assets/Scripts/Presentation/UI/TowerPlacingUI.cs b/Assets/Scripts/Presentation/UI/TowerPlacingUI.cs index c4b7c051ca6770b7cf9b54ec976ba70410a930b7..23db44127046c53151585cdfd5e420da8eeac803 100644 --- a/Assets/Scripts/Presentation/UI/TowerPlacingUI.cs +++ b/Assets/Scripts/Presentation/UI/TowerPlacingUI.cs @@ -42,7 +42,7 @@ public class TowerPlacingUI : MonoBehaviour { private VisualTreeAsset cardComponent; [SerializeField] - private List<TowerTypeData> towersToPlace; + private List<TowerData> towersToPlace; private readonly List<VisualElement> _tabs = new List<VisualElement>(); @@ -136,7 +136,7 @@ public class TowerPlacingUI : MonoBehaviour { var cardList = RootElement.Q<VisualElement>(BottomPanel); cardList.Clear(); - foreach (TowerTypeData towerType in towersToPlace) { + foreach (ITowerData towerType in towersToPlace) { TemplateContainer card = cardComponent.Instantiate(); var content = card.Q<VisualElement>(CardContent); @@ -157,7 +157,7 @@ public class TowerPlacingUI : MonoBehaviour { /// <summary> /// Displays the stats of a tower type /// </summary> - public void ShowTowerTypeStats(TowerTypeData towerType) { + public void ShowTowerTypeStats(ITowerData towerType) { HideTabs(); VisualElement tab = RootElement.Q(TowerTypeStats); tab.style.display = DisplayStyle.Flex; @@ -165,7 +165,7 @@ public class TowerPlacingUI : MonoBehaviour { ShowTowerTypeStats(towerType, tab.Q<VisualElement>(TowerStats)); } - private void ShowTowerTypeStats(TowerTypeData towerType, VisualElement statsContainer) { + private void ShowTowerTypeStats(ITowerData towerType, VisualElement statsContainer) { statsContainer.Clear(); if (towerType != null) { string[] stats = new[] { @@ -224,11 +224,11 @@ public class TowerPlacingUI : MonoBehaviour { if (_showDeployedStats) { manageContainer.style.display = DisplayStyle.None; statsContainer.style.display = DisplayStyle.Flex; - ShowTowerTypeStats(tower.Type as TowerTypeData, statsContainer); + ShowTowerTypeStats(tower.Type as ITowerData, statsContainer); } else { manageContainer.style.display = DisplayStyle.Flex; statsContainer.style.display = DisplayStyle.None; - var afterUpgrade = tower.Type.AfterUpgradeType as TowerTypeData; + var afterUpgrade = tower.Type.AfterUpgradeType as ITowerData; VisualElement container = manageContainer.Q(UpgradeContainer); if (afterUpgrade != null) { @@ -262,6 +262,6 @@ public class TowerPlacingUI : MonoBehaviour { /// <summary> /// Invoked when a tower type is selected /// </summary> - public event Action<TowerTypeData> OnTowerTypeSelected; + public event Action<ITowerData> OnTowerTypeSelected; } } diff --git a/Assets/Scripts/Presentation/UI/UnitDeploymentUI.cs b/Assets/Scripts/Presentation/UI/UnitDeploymentUI.cs index 1e849669dee57cef0ab22cc5f4022eeb6b2495dd..0f94ce05ddcf5cd3ec531634dad44db7b37d9595 100644 --- a/Assets/Scripts/Presentation/UI/UnitDeploymentUI.cs +++ b/Assets/Scripts/Presentation/UI/UnitDeploymentUI.cs @@ -26,9 +26,9 @@ public class UnitDeploymentUI : MonoBehaviour { private UIDocument ui; [SerializeField] - private List<UnitTypeData> unitTypes; + private List<UnitData> unitTypes; - private readonly Dictionary<UnitTypeData, VisualElement> _unitCards = new Dictionary<UnitTypeData, VisualElement>(); + private readonly Dictionary<IUnitData, VisualElement> _unitCards = new Dictionary<IUnitData, VisualElement>(); private Color _activePlayer = Color.Red; private UnityEngine.Color _teamBlueColor = UnityEngine.Color.magenta; @@ -54,8 +54,8 @@ public class UnitDeploymentUI : MonoBehaviour { var cardList = RootElement.Q<VisualElement>(BottomPanel); cardList.Clear(); - foreach (UnitTypeData unitType in unitTypes) { - UnitTypeData unit = unitType; + foreach (IUnitData unitType in unitTypes) { + IUnitData unit = unitType; TemplateContainer card = cardComponent.Instantiate(); var content = card.Q<VisualElement>(CardContent); content.style.backgroundImage = new StyleBackground(unitType.PreviewSprite); @@ -78,7 +78,7 @@ public class UnitDeploymentUI : MonoBehaviour { /// <summary> /// Increments the bought unit count of a given type /// </summary> - public void UpdateBoughtUnitCount(UnitTypeData unit) { + public void UpdateBoughtUnitCount(IUnitData unit) { if (_unitCards.TryGetValue(unit, out VisualElement card)) UpdateCardUnitCount(card, 1); else @@ -139,14 +139,14 @@ public class UnitDeploymentUI : MonoBehaviour { VisualElement container = RootElement.Q(DeployedUnitsContainer); container.Clear(); - foreach (UnitTypeData type in unitTypes) + foreach (IUnitData type in unitTypes) container.Add(new Label { text = $"{type.Name}: {team.GetDeployedUnitTypeCount(type)}" }); } /// <summary> /// Invoked when a unit purchase card is clicked /// </summary> - public event Action<UnitTypeData> OnUnitPurchased; + public event Action<IUnitData> OnUnitPurchased; /// <summary> /// Invoked when the next button is clicked diff --git a/Assets/Scripts/Presentation/World/ITowerData.cs b/Assets/Scripts/Presentation/World/ITowerData.cs new file mode 100644 index 0000000000000000000000000000000000000000..4305b678c360abacac675412d2dd7cc660fc5332 --- /dev/null +++ b/Assets/Scripts/Presentation/World/ITowerData.cs @@ -0,0 +1,16 @@ +using Logic.Data.World; +using UnityEngine; + +namespace Presentation.World { +/// <summary> +/// Extends the <see cref="ITowerTypeData"/> interface with visualization-related properties. +/// </summary> +public interface ITowerData : ITowerTypeData { + public Sprite PreviewSprite { get; } + public Sprite SpriteColored { get; } + public Sprite SpriteConstant { get; } + public Sprite SpriteBackground { get; } + public Color BlueColor { get; } + public Color RedColor { get; } +} +} diff --git a/Assets/Scripts/Presentation/World/TowerTypeData.cs.meta b/Assets/Scripts/Presentation/World/ITowerData.cs.meta similarity index 100% rename from Assets/Scripts/Presentation/World/TowerTypeData.cs.meta rename to Assets/Scripts/Presentation/World/ITowerData.cs.meta diff --git a/Assets/Scripts/Presentation/World/IUnitData.cs b/Assets/Scripts/Presentation/World/IUnitData.cs new file mode 100644 index 0000000000000000000000000000000000000000..0aa6ae47859ed8711c8f85eab0742af2a9856d87 --- /dev/null +++ b/Assets/Scripts/Presentation/World/IUnitData.cs @@ -0,0 +1,16 @@ +using Logic.Data.World; +using UnityEngine; + +namespace Presentation.World { +/// <summary> +/// Extends the <see cref="IUnitTypeData"/> interface with visualization-related properties. +/// </summary> +public interface IUnitData : IUnitTypeData { + public Color BlueColor { get; } + public Color RedColor { get; } + public Sprite PreviewSprite { get; } + public Sprite AliveSpriteConstant { get; } + public Sprite AliveSpriteColored { get; } + public bool Airborne { get; } +} +} diff --git a/Assets/Scripts/Presentation/World/UnitTypeData.cs.meta b/Assets/Scripts/Presentation/World/IUnitData.cs.meta similarity index 100% rename from Assets/Scripts/Presentation/World/UnitTypeData.cs.meta rename to Assets/Scripts/Presentation/World/IUnitData.cs.meta diff --git a/Assets/Scripts/Presentation/World/MainMenuSimulationSupervisor.cs b/Assets/Scripts/Presentation/World/MainMenuSimulationSupervisor.cs index 9ba6b12744d243d72c4547700ba1b161264e4f1d..9dd795a13f4f3dca730e10d1806a20c7bab56d70 100644 --- a/Assets/Scripts/Presentation/World/MainMenuSimulationSupervisor.cs +++ b/Assets/Scripts/Presentation/World/MainMenuSimulationSupervisor.cs @@ -2,23 +2,18 @@ using System; using System.Collections; using System.Collections.Generic; using System.Linq; -using System.Reflection; using Logic.Command; using Logic.Command.Tower; 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; @@ -53,62 +48,31 @@ public class MainMenuSimulationSupervisor : MonoBehaviour { private float towerPlacingDelay = .125f; [SerializeField] - private List<TowerTypeData> towerTypes; + private List<TowerData> towerTypes; + + [SerializeField] + private List<UnitData> unitTypes; [SerializeField] - private List<UnitTypeData> unitTypes; + private SimulationManager simulationManager; - private readonly List<UnitTypeData> _modifiedUnitTypes = new List<UnitTypeData>(); + private readonly List<IUnitData> _modifiedUnitTypes = new List<IUnitData>(); private IEnumerator _simulationCoroutine; private void Start() { - _simulationCoroutine = null; // we don't want to destroy castles - foreach (UnitTypeData unitType in unitTypes) { - UnitTypeData modifiedUnitType = Instantiate(unitType); - FieldInfo prop = modifiedUnitType.GetType().GetField("damage", - BindingFlags.NonPublic | BindingFlags.Instance); - - Debug.Assert(prop != null); - prop.SetValue(modifiedUnitType, 0.0f); - _modifiedUnitTypes.Add(modifiedUnitType); - } + _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); @@ -186,11 +150,24 @@ 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; + + public NoDamageUnitDataProxy(IUnitData source) { + this.source = source; + } + + public float Damage => 0; //Only this property is changed + public string Name => source.Name; + public float Health => source.Health; + public float Speed => source.Speed; + public int Cost => source.Cost; + public Color BlueColor => source.BlueColor; + public Color RedColor => source.RedColor; + public Sprite PreviewSprite => source.PreviewSprite; + public Sprite AliveSpriteConstant => source.AliveSpriteConstant; + public Sprite AliveSpriteColored => source.AliveSpriteColored; + public bool Airborne => source.Airborne; } } } 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/Tower.cs b/Assets/Scripts/Presentation/World/Tower.cs index 6209d84a15d256bc8e761aab8baed9c33f0fa177..17d791a09d2aac9746a51dfd19e3b5ccfd633617 100644 --- a/Assets/Scripts/Presentation/World/Tower.cs +++ b/Assets/Scripts/Presentation/World/Tower.cs @@ -45,7 +45,7 @@ public class Tower : Structure { /// </summary> public void SetData(Logic.Data.World.Tower data) { _data = data; - var type = (TowerTypeData) data.Type; + var type = (ITowerData) data.Type; Color color = _data.OwnerColor == Logic.Data.Color.Blue ? type.BlueColor : type.RedColor; backgroundSprite.sprite = type.SpriteBackground; diff --git a/Assets/Scripts/Presentation/World/TowerTypeData.cs b/Assets/Scripts/Presentation/World/TowerData.cs similarity index 87% rename from Assets/Scripts/Presentation/World/TowerTypeData.cs rename to Assets/Scripts/Presentation/World/TowerData.cs index fea73bcf0096c5de0a1f6a06ebd559740a07d367..f38210806e05861bbb156f2583aa838c873f1755 100644 --- a/Assets/Scripts/Presentation/World/TowerTypeData.cs +++ b/Assets/Scripts/Presentation/World/TowerData.cs @@ -1,12 +1,12 @@ -using Logic.Data.World; +ďťżusing Logic.Data.World; using UnityEngine; namespace Presentation.World { /// <summary> -/// Enables the tower visualization settings to be configured in the Unity Editor +/// Enables the tower settings to be configured in the Unity Editor /// </summary> [CreateAssetMenu(fileName = "New Tower Type", menuName = "World/Structures/Tower Type", order = 1)] -public class TowerTypeData : ScriptableObject, ITowerTypeData { +public class TowerData : ScriptableObject, ITowerData { [Header("Presentation-specific values")] [SerializeField] private Sprite previewSprite; @@ -55,7 +55,7 @@ public class TowerTypeData : ScriptableObject, ITowerTypeData { private int upgradeCost; [SerializeField] - private TowerTypeData afterUpgradeType; + private TowerData afterUpgradeType; public Sprite PreviewSprite => previewSprite; public Sprite SpriteColored => spriteColored; diff --git a/Assets/Scripts/Presentation/World/TowerData.cs.meta b/Assets/Scripts/Presentation/World/TowerData.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..54ea2c879dedf337d142f54dae556ffc0616c209 --- /dev/null +++ b/Assets/Scripts/Presentation/World/TowerData.cs.meta @@ -0,0 +1,3 @@ +ďťżfileFormatVersion: 2 +guid: 951ce2d6e2af48e4999c3cc2f9ad6fab +timeCreated: 1651325101 \ No newline at end of file diff --git a/Assets/Scripts/Presentation/World/Unit.cs b/Assets/Scripts/Presentation/World/Unit.cs index 3e53e9a0bdb81333ccb2550673f29f0406d9d54e..57245fdfd5868e8183fa258b2312b02a84a02992 100644 --- a/Assets/Scripts/Presentation/World/Unit.cs +++ b/Assets/Scripts/Presentation/World/Unit.cs @@ -41,7 +41,7 @@ public class Unit : MonoBehaviour { /// </summary> public void SetData(Logic.Data.World.Unit data) { _data = data; - var unitData = (UnitTypeData) _data.Type; + var unitData = (IUnitData) _data.Type; if (unitData.Airborne) { constantSprite.sortingLayerName = "UnitAirborne"; coloredSprite.sortingLayerName = "UnitAirborne"; diff --git a/Assets/Scripts/Presentation/World/UnitTypeData.cs b/Assets/Scripts/Presentation/World/UnitData.cs similarity index 86% rename from Assets/Scripts/Presentation/World/UnitTypeData.cs rename to Assets/Scripts/Presentation/World/UnitData.cs index fa2dfcc62cc804779d26ab440ea99e1446ea3cd3..8bf1a456f1a04e19791425bfd4c61f3afa42f38a 100644 --- a/Assets/Scripts/Presentation/World/UnitTypeData.cs +++ b/Assets/Scripts/Presentation/World/UnitData.cs @@ -1,12 +1,11 @@ -using Logic.Data.World; -using UnityEngine; +ďťżusing UnityEngine; namespace Presentation.World { /// <summary> -/// Enables the unit visualization settings to be configured in the Unity Editor +/// Enables the unit settings to be configured in the Unity Editor /// </summary> [CreateAssetMenu(fileName = "New Unit Type", menuName = "World/Unit Type", order = 1)] -public class UnitTypeData : ScriptableObject, IUnitTypeData { +public class UnitData : ScriptableObject, IUnitData { [Header("Presentation-specific values")] [SerializeField] private Color blueColor; diff --git a/Assets/Scripts/Presentation/World/UnitData.cs.meta b/Assets/Scripts/Presentation/World/UnitData.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..5923d94425a743c14a6b0bcdc4f360cf77070214 --- /dev/null +++ b/Assets/Scripts/Presentation/World/UnitData.cs.meta @@ -0,0 +1,3 @@ +ďťżfileFormatVersion: 2 +guid: d13d174e95cf442aaef0e6a1c6beaa30 +timeCreated: 1651325338 \ No newline at end of file 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/Assets/World/Structures/Towers/DmgTowerLvl1Type.asset b/Assets/World/Structures/Towers/DmgTowerLvl1Type.asset index 25ecb976bb71d70a6d42d4ed6a89274eb2b4ea19..c18468eb62eb9ca3f0a54c5a7832bca69af80be7 100644 --- a/Assets/World/Structures/Towers/DmgTowerLvl1Type.asset +++ b/Assets/World/Structures/Towers/DmgTowerLvl1Type.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a046f9e3c8344bada9e6404adcc932c1, type: 3} + m_Script: {fileID: 11500000, guid: 951ce2d6e2af48e4999c3cc2f9ad6fab, type: 3} m_Name: DmgTowerLvl1Type m_EditorClassIdentifier: previewSprite: {fileID: 21300000, guid: 7d101f63fc97f4d4d9e0c136b2ea179c, type: 3} diff --git a/Assets/World/Structures/Towers/DmgTowerLvl2Type.asset b/Assets/World/Structures/Towers/DmgTowerLvl2Type.asset index f19508742653d74fc42030a50a030b4e5a230893..08bc7f39aee1f4212bb049f4951653dff6460fc8 100644 --- a/Assets/World/Structures/Towers/DmgTowerLvl2Type.asset +++ b/Assets/World/Structures/Towers/DmgTowerLvl2Type.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a046f9e3c8344bada9e6404adcc932c1, type: 3} + m_Script: {fileID: 11500000, guid: 951ce2d6e2af48e4999c3cc2f9ad6fab, type: 3} m_Name: DmgTowerLvl2Type m_EditorClassIdentifier: previewSprite: {fileID: 21300000, guid: 7d101f63fc97f4d4d9e0c136b2ea179c, type: 3} diff --git a/Assets/World/Structures/Towers/DmgTowerLvl3Type.asset b/Assets/World/Structures/Towers/DmgTowerLvl3Type.asset index 9ef9a48400c8c89d5dbc944177cc895ef876b09a..df2b46dc12b8b3fb7d97cf67920ba346177ee102 100644 --- a/Assets/World/Structures/Towers/DmgTowerLvl3Type.asset +++ b/Assets/World/Structures/Towers/DmgTowerLvl3Type.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a046f9e3c8344bada9e6404adcc932c1, type: 3} + m_Script: {fileID: 11500000, guid: 951ce2d6e2af48e4999c3cc2f9ad6fab, type: 3} m_Name: DmgTowerLvl3Type m_EditorClassIdentifier: previewSprite: {fileID: 21300000, guid: 7d101f63fc97f4d4d9e0c136b2ea179c, type: 3} diff --git a/Assets/World/Structures/Towers/FrtTowerLvl1Type.asset b/Assets/World/Structures/Towers/FrtTowerLvl1Type.asset index f73e862f44c8d3b172cabd4b00cc8fd58c73cbcd..4672e95604d966e08a9bbdf73f1a0a899afab4ea 100644 --- a/Assets/World/Structures/Towers/FrtTowerLvl1Type.asset +++ b/Assets/World/Structures/Towers/FrtTowerLvl1Type.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a046f9e3c8344bada9e6404adcc932c1, type: 3} + m_Script: {fileID: 11500000, guid: 951ce2d6e2af48e4999c3cc2f9ad6fab, type: 3} m_Name: FrtTowerLvl1Type m_EditorClassIdentifier: previewSprite: {fileID: 21300000, guid: 02fd48bbc114d324f826747f41900514, type: 3} diff --git a/Assets/World/Structures/Towers/FrtTowerLvl2Type.asset b/Assets/World/Structures/Towers/FrtTowerLvl2Type.asset index 5d2b487c603286e6f963bec4ac1ee5ed90d870db..0974f02bffa317f859663692fd9f42d9cf3da4a6 100644 --- a/Assets/World/Structures/Towers/FrtTowerLvl2Type.asset +++ b/Assets/World/Structures/Towers/FrtTowerLvl2Type.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a046f9e3c8344bada9e6404adcc932c1, type: 3} + m_Script: {fileID: 11500000, guid: 951ce2d6e2af48e4999c3cc2f9ad6fab, type: 3} m_Name: FrtTowerLvl2Type m_EditorClassIdentifier: previewSprite: {fileID: 21300000, guid: 02fd48bbc114d324f826747f41900514, type: 3} diff --git a/Assets/World/Structures/Towers/FrtTowerLvl3Type.asset b/Assets/World/Structures/Towers/FrtTowerLvl3Type.asset index f40337faa80574ca43364eee7b1d1a5c86c6a820..05a8dafd87520fa0665593cab527052a0f11f7b2 100644 --- a/Assets/World/Structures/Towers/FrtTowerLvl3Type.asset +++ b/Assets/World/Structures/Towers/FrtTowerLvl3Type.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a046f9e3c8344bada9e6404adcc932c1, type: 3} + m_Script: {fileID: 11500000, guid: 951ce2d6e2af48e4999c3cc2f9ad6fab, type: 3} m_Name: FrtTowerLvl3Type m_EditorClassIdentifier: previewSprite: {fileID: 21300000, guid: 02fd48bbc114d324f826747f41900514, type: 3} diff --git a/Assets/World/Structures/Towers/RngTowerLvl1Type.asset b/Assets/World/Structures/Towers/RngTowerLvl1Type.asset index 3f3c54099d554aa2314d9f695913b399a04a2c82..289551201d4b64616a0aa90cc2d81bedbb89627b 100644 --- a/Assets/World/Structures/Towers/RngTowerLvl1Type.asset +++ b/Assets/World/Structures/Towers/RngTowerLvl1Type.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a046f9e3c8344bada9e6404adcc932c1, type: 3} + m_Script: {fileID: 11500000, guid: 951ce2d6e2af48e4999c3cc2f9ad6fab, type: 3} m_Name: RngTowerLvl1Type m_EditorClassIdentifier: previewSprite: {fileID: 21300000, guid: 7d69bc6151ffe184bb5822ba7a7dd059, type: 3} diff --git a/Assets/World/Structures/Towers/RngTowerLvl2Type.asset b/Assets/World/Structures/Towers/RngTowerLvl2Type.asset index cfa11ed53e072ba72eb1355250502386424387ec..8b181d46a119c8226f8878a479ed5c9ea7a6864e 100644 --- a/Assets/World/Structures/Towers/RngTowerLvl2Type.asset +++ b/Assets/World/Structures/Towers/RngTowerLvl2Type.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a046f9e3c8344bada9e6404adcc932c1, type: 3} + m_Script: {fileID: 11500000, guid: 951ce2d6e2af48e4999c3cc2f9ad6fab, type: 3} m_Name: RngTowerLvl2Type m_EditorClassIdentifier: previewSprite: {fileID: 21300000, guid: 7d69bc6151ffe184bb5822ba7a7dd059, type: 3} diff --git a/Assets/World/Structures/Towers/RngTowerLvl3Type.asset b/Assets/World/Structures/Towers/RngTowerLvl3Type.asset index 728a057fdb8ae3ba6e419943bba473aa883e71a0..31f725e1f1211d814dbb44ce82ce986af3efdf98 100644 --- a/Assets/World/Structures/Towers/RngTowerLvl3Type.asset +++ b/Assets/World/Structures/Towers/RngTowerLvl3Type.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a046f9e3c8344bada9e6404adcc932c1, type: 3} + m_Script: {fileID: 11500000, guid: 951ce2d6e2af48e4999c3cc2f9ad6fab, type: 3} m_Name: RngTowerLvl3Type m_EditorClassIdentifier: previewSprite: {fileID: 21300000, guid: 7d69bc6151ffe184bb5822ba7a7dd059, type: 3} diff --git a/Assets/World/Structures/Towers/WallTowerType.asset b/Assets/World/Structures/Towers/WallTowerType.asset index f9ceaa7f5999c84b625488298a73006f2ab41450..c4c608213a92eb816cb73a60de3129a1ed226fd4 100644 --- a/Assets/World/Structures/Towers/WallTowerType.asset +++ b/Assets/World/Structures/Towers/WallTowerType.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a046f9e3c8344bada9e6404adcc932c1, type: 3} + m_Script: {fileID: 11500000, guid: 951ce2d6e2af48e4999c3cc2f9ad6fab, type: 3} m_Name: WallTowerType m_EditorClassIdentifier: previewSprite: {fileID: 21300000, guid: 609ce9e4dc32560499c5a0bd5dac1c3f, type: 3} diff --git a/Assets/World/Units/FastUnitType.asset b/Assets/World/Units/FastUnitType.asset index 82368f7d04b06b9c37f7cbdbdf318a88dafdacdf..4210f89648403e9832ecb1b94214c188d1657764 100644 --- a/Assets/World/Units/FastUnitType.asset +++ b/Assets/World/Units/FastUnitType.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 3bc0fee426f84030b94afd263d5e1c32, type: 3} + m_Script: {fileID: 11500000, guid: d13d174e95cf442aaef0e6a1c6beaa30, type: 3} m_Name: FastUnitType m_EditorClassIdentifier: blueColor: {r: 0, g: 0.3296814, b: 1, a: 1} diff --git a/Assets/World/Units/SlowUnitType.asset b/Assets/World/Units/SlowUnitType.asset index fdcf3e4da7a5dc83d7c5dce45f7ac2865dba261d..78f932a069c71f66127b97701e2b2dc710152d5c 100644 --- a/Assets/World/Units/SlowUnitType.asset +++ b/Assets/World/Units/SlowUnitType.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 3bc0fee426f84030b94afd263d5e1c32, type: 3} + m_Script: {fileID: 11500000, guid: d13d174e95cf442aaef0e6a1c6beaa30, type: 3} m_Name: SlowUnitType m_EditorClassIdentifier: blueColor: {r: 0, g: 0.3296814, b: 1, a: 1} 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: {}