diff --git a/Assets/Art/BigTile-9Slice.png b/Assets/Art/BigTile-9Slice.png new file mode 100644 index 0000000..44dc279 Binary files /dev/null and b/Assets/Art/BigTile-9Slice.png differ diff --git a/Assets/Art/BigTile-9Slice.png.meta b/Assets/Art/BigTile-9Slice.png.meta new file mode 100644 index 0000000..0f6452d --- /dev/null +++ b/Assets/Art/BigTile-9Slice.png.meta @@ -0,0 +1,130 @@ +fileFormatVersion: 2 +guid: e76da6b4d6427e84097b6d764b9a91bf +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 0 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 30 + spriteBorder: {x: 14, y: 14, z: 14, w: 14} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 4 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + customData: + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 1537655665 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/BuildingMenuItem.prefab b/Assets/Prefabs/BuildingMenuItem.prefab index a924cc6..e9399c4 100644 --- a/Assets/Prefabs/BuildingMenuItem.prefab +++ b/Assets/Prefabs/BuildingMenuItem.prefab @@ -58,7 +58,7 @@ MonoBehaviour: m_SelectOnDown: {fileID: 0} m_SelectOnLeft: {fileID: 0} m_SelectOnRight: {fileID: 0} - m_Transition: 1 + m_Transition: 2 m_Colors: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} @@ -68,10 +68,11 @@ MonoBehaviour: m_ColorMultiplier: 1 m_FadeDuration: 0.1 m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} + m_HighlightedSprite: {fileID: 21300000, guid: 451e6df5541d3f4498972852b96985a0, + type: 3} + m_PressedSprite: {fileID: 21300000, guid: 451e6df5541d3f4498972852b96985a0, type: 3} + m_SelectedSprite: {fileID: 21300000, guid: fd64923844b14084ead7988cb85f3f18, type: 3} + m_DisabledSprite: {fileID: 21300000, guid: fd64923844b14084ead7988cb85f3f18, type: 3} m_AnimationTriggers: m_NormalTrigger: Normal m_HighlightedTrigger: Highlighted @@ -111,8 +112,8 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 0} - m_Type: 0 + m_Sprite: {fileID: 21300000, guid: fd64923844b14084ead7988cb85f3f18, type: 3} + m_Type: 1 m_PreserveAspect: 0 m_FillCenter: 1 m_FillMethod: 4 @@ -120,7 +121,7 @@ MonoBehaviour: m_FillClockwise: 1 m_FillOrigin: 0 m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 + m_PixelsPerUnitMultiplier: 1.5 --- !u!1 &6459787310772140154 GameObject: m_ObjectHideFlags: 0 @@ -179,7 +180,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_Color: {r: 0.96862745, g: 0.94509804, b: 0.8862745, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 @@ -187,8 +188,8 @@ MonoBehaviour: m_PersistentCalls: m_Calls: [] m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 65 + m_Font: {fileID: 12800000, guid: 25598a8975ed29243bb850b56f191920, type: 3} + m_FontSize: 55 m_FontStyle: 0 m_BestFit: 0 m_MinSize: 5 diff --git a/Assets/Prefabs/Buildings/Registry.asset b/Assets/Prefabs/Buildings/Registry.asset index 223be46..7aeacf8 100644 --- a/Assets/Prefabs/Buildings/Registry.asset +++ b/Assets/Prefabs/Buildings/Registry.asset @@ -14,17 +14,22 @@ MonoBehaviour: m_EditorClassIdentifier: Fruitomation::Fruitomation.Game.BuildingRegistry Buildings: - Name: Fan + Requirement: 2 Prefab: {fileID: 8624048914473773482, guid: 1b5c88b3f8d08674a9b15155d6ba9a36, type: 3} - Name: Stair + Requirement: 0 Prefab: {fileID: 2132872997366704715, guid: 3cf8228c3f6c43d4cb60319693b11828, type: 3} - Name: Wall + Requirement: 0 Prefab: {fileID: 1970033728917450326, guid: 3492b31295b69c148bb5a0660e598878, type: 3} - Name: Spring + Requirement: 0 Prefab: {fileID: 8624048914473773482, guid: 6060f6928011bf54dad9c5ef16fb1048, type: 3} - Name: Slicer + Requirement: 0 Prefab: {fileID: 8624048914473773482, guid: d26b0bb551b891e41a14009e6df42019, type: 3} diff --git a/Assets/Scenes/GameScene.unity b/Assets/Scenes/GameScene.unity index 0ccd177..7e6cab5 100644 --- a/Assets/Scenes/GameScene.unity +++ b/Assets/Scenes/GameScene.unity @@ -146,7 +146,7 @@ RectTransform: m_GameObject: {fileID: 48907754} 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_LocalScale: {x: 0.25, y: 0.25, z: 0.25} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1951065946} @@ -169,7 +169,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_Color: {r: 0.96862745, g: 0.94509804, b: 0.8862745, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 @@ -177,17 +177,17 @@ MonoBehaviour: m_PersistentCalls: m_Calls: [] m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 35 + m_Font: {fileID: 12800000, guid: 25598a8975ed29243bb850b56f191920, type: 3} + m_FontSize: 140 m_FontStyle: 0 m_BestFit: 0 m_MinSize: 0 - m_MaxSize: 40 + m_MaxSize: 140 m_Alignment: 4 m_AlignByGeometry: 0 m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 m_LineSpacing: 1 m_Text: Edit --- !u!222 &48907757 @@ -225,7 +225,7 @@ RectTransform: m_GameObject: {fileID: 80689890} 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_LocalScale: {x: 0.25, y: 0.25, z: 0.25} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1347333877} @@ -248,7 +248,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_Color: {r: 0.96862745, g: 0.94509804, b: 0.8862745, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 @@ -256,17 +256,17 @@ MonoBehaviour: m_PersistentCalls: m_Calls: [] m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 35 + m_Font: {fileID: 12800000, guid: 25598a8975ed29243bb850b56f191920, type: 3} + m_FontSize: 140 m_FontStyle: 0 m_BestFit: 0 m_MinSize: 0 - m_MaxSize: 40 + m_MaxSize: 140 m_Alignment: 4 m_AlignByGeometry: 0 m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 m_LineSpacing: 1 m_Text: Pause --- !u!222 &80689893 @@ -352,7 +352,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 0} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 m_OnCullStateChanged: @@ -480,7 +480,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 1200, y: 0} - m_SizeDelta: {x: 175, y: 175} + m_SizeDelta: {x: 175, y: 125} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &264715585 MonoBehaviour: @@ -501,7 +501,7 @@ MonoBehaviour: m_SelectOnDown: {fileID: 0} m_SelectOnLeft: {fileID: 0} m_SelectOnRight: {fileID: 0} - m_Transition: 1 + m_Transition: 2 m_Colors: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} @@ -511,10 +511,11 @@ MonoBehaviour: m_ColorMultiplier: 1 m_FadeDuration: 0.1 m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} + m_HighlightedSprite: {fileID: 21300000, guid: 451e6df5541d3f4498972852b96985a0, + type: 3} + m_PressedSprite: {fileID: 21300000, guid: 451e6df5541d3f4498972852b96985a0, type: 3} + m_SelectedSprite: {fileID: 21300000, guid: fd64923844b14084ead7988cb85f3f18, type: 3} + m_DisabledSprite: {fileID: 21300000, guid: fd64923844b14084ead7988cb85f3f18, type: 3} m_AnimationTriggers: m_NormalTrigger: Normal m_HighlightedTrigger: Highlighted @@ -546,7 +547,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Sprite: {fileID: 21300000, guid: fd64923844b14084ead7988cb85f3f18, type: 3} m_Type: 1 m_PreserveAspect: 0 m_FillCenter: 1 @@ -555,7 +556,7 @@ MonoBehaviour: m_FillClockwise: 1 m_FillOrigin: 0 m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 + m_PixelsPerUnitMultiplier: 2 --- !u!222 &264715587 CanvasRenderer: m_ObjectHideFlags: 0 @@ -601,7 +602,7 @@ Camera: m_Enabled: 1 serializedVersion: 2 m_ClearFlags: 2 - m_BackGroundColor: {r: 0, g: 0.45490196, b: 1, a: 1} + m_BackGroundColor: {r: 0.96862745, g: 0.94509804, b: 0.8862745, a: 1} m_projectionMatrixMode: 1 m_GateFitMode: 2 m_FOVAxisMode: 0 @@ -879,15 +880,15 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0.5849056, g: 0.5849056, b: 0.5849056, a: 1} + m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 0} - m_Type: 0 + m_Sprite: {fileID: 21300000, guid: e76da6b4d6427e84097b6d764b9a91bf, type: 3} + m_Type: 1 m_PreserveAspect: 0 m_FillCenter: 1 m_FillMethod: 4 @@ -895,7 +896,7 @@ MonoBehaviour: m_FillClockwise: 1 m_FillOrigin: 0 m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 + m_PixelsPerUnitMultiplier: 0.25 --- !u!222 &412089096 CanvasRenderer: m_ObjectHideFlags: 0 @@ -1208,7 +1209,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 1600, y: 0} - m_SizeDelta: {x: 175, y: 175} + m_SizeDelta: {x: 175, y: 125} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &873667507 MonoBehaviour: @@ -1229,7 +1230,7 @@ MonoBehaviour: m_SelectOnDown: {fileID: 0} m_SelectOnLeft: {fileID: 0} m_SelectOnRight: {fileID: 0} - m_Transition: 1 + m_Transition: 2 m_Colors: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} @@ -1239,10 +1240,11 @@ MonoBehaviour: m_ColorMultiplier: 1 m_FadeDuration: 0.1 m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} + m_HighlightedSprite: {fileID: 21300000, guid: 451e6df5541d3f4498972852b96985a0, + type: 3} + m_PressedSprite: {fileID: 21300000, guid: 451e6df5541d3f4498972852b96985a0, type: 3} + m_SelectedSprite: {fileID: 21300000, guid: fd64923844b14084ead7988cb85f3f18, type: 3} + m_DisabledSprite: {fileID: 21300000, guid: fd64923844b14084ead7988cb85f3f18, type: 3} m_AnimationTriggers: m_NormalTrigger: Normal m_HighlightedTrigger: Highlighted @@ -1274,7 +1276,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Sprite: {fileID: 21300000, guid: fd64923844b14084ead7988cb85f3f18, type: 3} m_Type: 1 m_PreserveAspect: 0 m_FillCenter: 1 @@ -1283,7 +1285,7 @@ MonoBehaviour: m_FillClockwise: 1 m_FillOrigin: 0 m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 + m_PixelsPerUnitMultiplier: 2 --- !u!222 &873667509 CanvasRenderer: m_ObjectHideFlags: 0 @@ -1416,7 +1418,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_UiScaleMode: 1 - m_ReferencePixelsPerUnit: 100 + m_ReferencePixelsPerUnit: 30 m_ScaleFactor: 1 m_ReferenceResolution: {x: 3840, y: 2160} m_ScreenMatchMode: 1 @@ -1578,7 +1580,7 @@ RectTransform: m_GameObject: {fileID: 1314545342} 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_LocalScale: {x: 0.25, y: 0.25, z: 0.25} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 873667506} @@ -1601,7 +1603,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_Color: {r: 0.96862745, g: 0.94509804, b: 0.8862745, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 @@ -1609,17 +1611,17 @@ MonoBehaviour: m_PersistentCalls: m_Calls: [] m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 35 + m_Font: {fileID: 12800000, guid: 25598a8975ed29243bb850b56f191920, type: 3} + m_FontSize: 140 m_FontStyle: 0 m_BestFit: 0 m_MinSize: 0 - m_MaxSize: 40 + m_MaxSize: 140 m_Alignment: 4 m_AlignByGeometry: 0 m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 m_LineSpacing: 1 m_Text: Build --- !u!222 &1314545345 @@ -1657,7 +1659,7 @@ RectTransform: m_GameObject: {fileID: 1326837323} 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_LocalScale: {x: 0.25, y: 0.25, z: 0.25} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1511006085} @@ -1680,7 +1682,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_Color: {r: 0.96862745, g: 0.94509804, b: 0.8862745, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 @@ -1688,17 +1690,17 @@ MonoBehaviour: m_PersistentCalls: m_Calls: [] m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 35 + m_Font: {fileID: 12800000, guid: 25598a8975ed29243bb850b56f191920, type: 3} + m_FontSize: 140 m_FontStyle: 0 m_BestFit: 0 m_MinSize: 0 - m_MaxSize: 40 + m_MaxSize: 140 m_Alignment: 4 m_AlignByGeometry: 0 m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 m_LineSpacing: 1 m_Text: Upgrades --- !u!222 &1326837326 @@ -1811,6 +1813,7 @@ MonoBehaviour: GridPosition: {x: 0, y: 0} SelectedBuildingToBuild: Name: + Requirement: 0 Prefab: {fileID: 0} FlipCurrentBuilding: 0 --- !u!58 &1330313879 @@ -1886,7 +1889,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 1800, y: 0} - m_SizeDelta: {x: 175, y: 175} + m_SizeDelta: {x: 175, y: 125} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1347333878 MonoBehaviour: @@ -1907,7 +1910,7 @@ MonoBehaviour: m_SelectOnDown: {fileID: 0} m_SelectOnLeft: {fileID: 0} m_SelectOnRight: {fileID: 0} - m_Transition: 1 + m_Transition: 2 m_Colors: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} @@ -1917,10 +1920,11 @@ MonoBehaviour: m_ColorMultiplier: 1 m_FadeDuration: 0.1 m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} + m_HighlightedSprite: {fileID: 21300000, guid: 451e6df5541d3f4498972852b96985a0, + type: 3} + m_PressedSprite: {fileID: 21300000, guid: 451e6df5541d3f4498972852b96985a0, type: 3} + m_SelectedSprite: {fileID: 21300000, guid: fd64923844b14084ead7988cb85f3f18, type: 3} + m_DisabledSprite: {fileID: 21300000, guid: fd64923844b14084ead7988cb85f3f18, type: 3} m_AnimationTriggers: m_NormalTrigger: Normal m_HighlightedTrigger: Highlighted @@ -1952,7 +1956,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Sprite: {fileID: 21300000, guid: fd64923844b14084ead7988cb85f3f18, type: 3} m_Type: 1 m_PreserveAspect: 0 m_FillCenter: 1 @@ -1961,7 +1965,7 @@ MonoBehaviour: m_FillClockwise: 1 m_FillOrigin: 0 m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 + m_PixelsPerUnitMultiplier: 2 --- !u!222 &1347333880 CanvasRenderer: m_ObjectHideFlags: 0 @@ -2067,7 +2071,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 1400, y: 0} - m_SizeDelta: {x: 175, y: 175} + m_SizeDelta: {x: 175, y: 125} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1511006086 MonoBehaviour: @@ -2088,7 +2092,7 @@ MonoBehaviour: m_SelectOnDown: {fileID: 0} m_SelectOnLeft: {fileID: 0} m_SelectOnRight: {fileID: 0} - m_Transition: 1 + m_Transition: 2 m_Colors: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} @@ -2098,10 +2102,11 @@ MonoBehaviour: m_ColorMultiplier: 1 m_FadeDuration: 0.1 m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} + m_HighlightedSprite: {fileID: 21300000, guid: 451e6df5541d3f4498972852b96985a0, + type: 3} + m_PressedSprite: {fileID: 21300000, guid: 451e6df5541d3f4498972852b96985a0, type: 3} + m_SelectedSprite: {fileID: 21300000, guid: fd64923844b14084ead7988cb85f3f18, type: 3} + m_DisabledSprite: {fileID: 21300000, guid: fd64923844b14084ead7988cb85f3f18, type: 3} m_AnimationTriggers: m_NormalTrigger: Normal m_HighlightedTrigger: Highlighted @@ -2133,7 +2138,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Sprite: {fileID: 21300000, guid: fd64923844b14084ead7988cb85f3f18, type: 3} m_Type: 1 m_PreserveAspect: 0 m_FillCenter: 1 @@ -2142,7 +2147,7 @@ MonoBehaviour: m_FillClockwise: 1 m_FillOrigin: 0 m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 + m_PixelsPerUnitMultiplier: 2 --- !u!222 &1511006088 CanvasRenderer: m_ObjectHideFlags: 0 @@ -2335,7 +2340,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 1000, y: 0} - m_SizeDelta: {x: 175, y: 175} + m_SizeDelta: {x: 175, y: 125} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1951065947 MonoBehaviour: @@ -2356,7 +2361,7 @@ MonoBehaviour: m_SelectOnDown: {fileID: 0} m_SelectOnLeft: {fileID: 0} m_SelectOnRight: {fileID: 0} - m_Transition: 1 + m_Transition: 2 m_Colors: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} @@ -2366,10 +2371,11 @@ MonoBehaviour: m_ColorMultiplier: 1 m_FadeDuration: 0.1 m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} + m_HighlightedSprite: {fileID: 21300000, guid: 451e6df5541d3f4498972852b96985a0, + type: 3} + m_PressedSprite: {fileID: 21300000, guid: 451e6df5541d3f4498972852b96985a0, type: 3} + m_SelectedSprite: {fileID: 21300000, guid: fd64923844b14084ead7988cb85f3f18, type: 3} + m_DisabledSprite: {fileID: 21300000, guid: fd64923844b14084ead7988cb85f3f18, type: 3} m_AnimationTriggers: m_NormalTrigger: Normal m_HighlightedTrigger: Highlighted @@ -2401,7 +2407,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Sprite: {fileID: 21300000, guid: fd64923844b14084ead7988cb85f3f18, type: 3} m_Type: 1 m_PreserveAspect: 0 m_FillCenter: 1 @@ -2410,7 +2416,7 @@ MonoBehaviour: m_FillClockwise: 1 m_FillOrigin: 0 m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 + m_PixelsPerUnitMultiplier: 2 --- !u!222 &1951065949 CanvasRenderer: m_ObjectHideFlags: 0 @@ -2613,7 +2619,7 @@ RectTransform: m_GameObject: {fileID: 2106145556} 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_LocalScale: {x: 0.25, y: 0.25, z: 0.25} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 264715584} @@ -2636,7 +2642,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_Color: {r: 0.96862745, g: 0.94509804, b: 0.8862745, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 @@ -2644,17 +2650,17 @@ MonoBehaviour: m_PersistentCalls: m_Calls: [] m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 35 + m_Font: {fileID: 12800000, guid: 25598a8975ed29243bb850b56f191920, type: 3} + m_FontSize: 140 m_FontStyle: 0 m_BestFit: 0 m_MinSize: 0 - m_MaxSize: 40 + m_MaxSize: 140 m_Alignment: 4 m_AlignByGeometry: 0 m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 m_LineSpacing: 1 m_Text: Simulate --- !u!222 &2106145559 @@ -2708,7 +2714,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: -980} - m_SizeDelta: {x: 6000, y: 200} + m_SizeDelta: {x: 3840, y: 200} m_Pivot: {x: 0.5, y: 0.5} --- !u!61 &2112507920 BoxCollider2D: @@ -2754,7 +2760,7 @@ BoxCollider2D: drawMode: 0 adaptiveTiling: 0 m_AutoTiling: 0 - m_Size: {x: 3840, y: 200} + m_Size: {x: 5000, y: 200} m_EdgeRadius: 0 --- !u!114 &2112507921 MonoBehaviour: @@ -2769,15 +2775,15 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0, g: 0, b: 0, a: 1} + m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 0} - m_Type: 0 + m_Sprite: {fileID: 21300000, guid: e76da6b4d6427e84097b6d764b9a91bf, type: 3} + m_Type: 1 m_PreserveAspect: 0 m_FillCenter: 1 m_FillMethod: 4 @@ -2785,7 +2791,7 @@ MonoBehaviour: m_FillClockwise: 1 m_FillOrigin: 0 m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 + m_PixelsPerUnitMultiplier: 0.25 --- !u!222 &2112507922 CanvasRenderer: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Game/UpgradeManager.cs b/Assets/Scripts/Game/UpgradeManager.cs index c69a48f..84d4209 100644 --- a/Assets/Scripts/Game/UpgradeManager.cs +++ b/Assets/Scripts/Game/UpgradeManager.cs @@ -77,19 +77,28 @@ namespace Fruitomation.Game { [Serializable] public class Serialized { + [SerializeField] private BuildingUnlock[] BuildingUnlocks; [SerializeField] private BasicUpgrade[] BasicUpgrades; private Serialized() { - // All logic done in Serialize + // All logic done in Serialize() function } - + public UnlockedUpgrades Unserialize() { UnlockedUpgrades upgrades = new(); - foreach (BasicUpgrade upgrade in BasicUpgrades) + + if (BuildingUnlocks is not null) { - upgrades.Unlocks.Add(upgrade); + foreach (BuildingUnlock unlock in BuildingUnlocks) + upgrades.Buildings.Add(unlock); + } + + if (BasicUpgrades is not null) + { + foreach (BasicUpgrade upgrade in BasicUpgrades) + upgrades.Unlocks.Add(upgrade); } return upgrades; @@ -99,15 +108,16 @@ namespace Fruitomation.Game { Serialized serialized = new() { - BasicUpgrades = upgrades.Unlocks.ToArray() + BuildingUnlocks = upgrades.Buildings.ToArray(), + BasicUpgrades = upgrades.Unlocks.ToArray(), }; return serialized; } } - private HashSet Buildings = new(); - private HashSet Unlocks = new(); + private readonly HashSet Buildings = new(); + private readonly HashSet Unlocks = new(); [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Unlock(BuildingUnlock unlock) => Buildings.Add(unlock); @@ -168,12 +178,8 @@ namespace Fruitomation.Game public static void Unlock(BasicUpgrade upgrade) => CurrentUpgrades.Unlock(upgrade); [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool Is(BuildingUnlock unlock) - { - return unlock == BuildingUnlock.None - ? throw new ArgumentOutOfRangeException(nameof(unlock)) - : CurrentUpgrades.IsUnlocked(unlock); - } + public static bool Is(BuildingUnlock unlock) => + unlock == BuildingUnlock.None || CurrentUpgrades.IsUnlocked(unlock); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool Is(BasicUpgrade upgrade) => CurrentUpgrades.IsUnlocked(upgrade); diff --git a/Assets/Scripts/UI/BasicUpgradeButton.cs b/Assets/Scripts/UI/BasicUpgradeButton.cs index 83f29c1..a1ebd47 100644 --- a/Assets/Scripts/UI/BasicUpgradeButton.cs +++ b/Assets/Scripts/UI/BasicUpgradeButton.cs @@ -164,7 +164,7 @@ namespace Fruitomation.UI UpgradeState.Viewable => $"{formatted}", UpgradeState.Unlockable => $"{formatted}\n{Cost.AsString()}", UpgradeState.Unlocked => $"{formatted}\nUnlocked", - _ => throw new ArgumentOutOfRangeException() + var _ => throw new ArgumentOutOfRangeException() }; } diff --git a/Assets/Scripts/UI/BuildiingUnlockButton.cs b/Assets/Scripts/UI/BuildiingUnlockButton.cs new file mode 100644 index 0000000..00fff9c --- /dev/null +++ b/Assets/Scripts/UI/BuildiingUnlockButton.cs @@ -0,0 +1,16 @@ +using UnityEngine; + +public class BuildiingUnlockButton : MonoBehaviour +{ + // Start is called once before the first execution of Update after the MonoBehaviour is created + void Start() + { + + } + + // Update is called once per frame + void Update() + { + + } +} diff --git a/Assets/Scripts/UI/BuildiingUnlockButton.cs.meta b/Assets/Scripts/UI/BuildiingUnlockButton.cs.meta new file mode 100644 index 0000000..629c7db --- /dev/null +++ b/Assets/Scripts/UI/BuildiingUnlockButton.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 062558955cb2e0447a23f174dd90d495 \ No newline at end of file diff --git a/Assets/Scripts/UI/BuildingMenu.cs b/Assets/Scripts/UI/BuildingMenu.cs index 1437b80..31c530a 100644 --- a/Assets/Scripts/UI/BuildingMenu.cs +++ b/Assets/Scripts/UI/BuildingMenu.cs @@ -1,4 +1,5 @@ -using Fruitomation.Global; +using System; +using Fruitomation.Global; using Fruitomation.Game; using UnityEngine.UI; using UnityEngine; @@ -13,16 +14,19 @@ namespace Fruitomation.UI [SerializeField] private GameObject MenuGrid; [SerializeField] private GameObject MenuItemPrefab; [SerializeField] private BuildingRegistry BuildingPrefabs; - - private void Update() - { + + private void Update() => Menu.SetActive(GameStateController.Is(GameState.BuildingMenu)); - } private void Start() { foreach (BuildingRegistry.BuildingInfo info in BuildingPrefabs.GetBuildings()) { + if (!UpgradeManager.Is(info.Requirement)) + { + continue; + } + GameObject go = Instantiate(MenuItemPrefab, MenuGrid.transform); Text text = go.GetComponentInChildren(); diff --git a/Assets/Scripts/UI/GridViewController.cs b/Assets/Scripts/UI/GridViewController.cs index fa7325a..866dd92 100644 --- a/Assets/Scripts/UI/GridViewController.cs +++ b/Assets/Scripts/UI/GridViewController.cs @@ -49,7 +49,11 @@ namespace Fruitomation.UI return result; } - private void Update() => - Image.enabled = GameStateController.Is(GameState.Building); + private void Update() + { + Image.enabled = + GameStateController.Is(GameState.Building) || + GameStateController.Is(GameState.Editing); + } } }