diff --git a/.consulo/workspace.xml b/.consulo/workspace.xml index 8dc43c9a1..fdbf64846 100644 --- a/.consulo/workspace.xml +++ b/.consulo/workspace.xml @@ -2,7 +2,14 @@ - + + + + + + + + @@ -474,8 +481,8 @@ - - + + @@ -483,11 +490,11 @@ - - + + - - + + @@ -498,8 +505,8 @@ - - + + @@ -507,12 +514,14 @@ - - + + - - - + + + + + @@ -553,11 +562,11 @@ - + - - + + @@ -568,18 +577,18 @@ - - + + - + - - + + @@ -596,6 +605,7 @@ cheat instance. DBmanager. + collectBtn Instance. @@ -619,18 +629,18 @@ @@ -658,6 +668,7 @@ + @@ -715,7 +726,6 @@ - @@ -803,11 +813,12 @@ + - diff --git a/Assets/Game/Scenes/GameScene/GameScene.unity b/Assets/Game/Scenes/GameScene/GameScene.unity index c768629b6..bfc0b2a07 100644 --- a/Assets/Game/Scenes/GameScene/GameScene.unity +++ b/Assets/Game/Scenes/GameScene/GameScene.unity @@ -1686,11 +1686,11 @@ RectTransform: - {fileID: 1602310475} - {fileID: 2049647376} m_Father: {fileID: 546537819} - m_RootOrder: 0 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 417.81, y: 0} + m_AnchoredPosition: {x: 895.87, y: 0} m_SizeDelta: {x: 0, y: 90} m_Pivot: {x: 1, y: 0.5} --- !u!114 &16466549 @@ -23360,7 +23360,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: -29.000061} + m_AnchoredPosition: {x: 0, y: -29} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &219528609 @@ -57260,6 +57260,8 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: + - {fileID: 1665232125} + - {fileID: 1293333285} - {fileID: 16466548} - {fileID: 1934658492} m_Father: {fileID: 662308939} @@ -57302,7 +57304,7 @@ MonoBehaviour: m_Top: 0 m_Bottom: 0 m_ChildAlignment: 4 - m_Spacing: 60.5 + m_Spacing: 27.89 m_ChildForceExpandWidth: 0 m_ChildForceExpandHeight: 0 m_ChildControlWidth: 1 @@ -70872,7 +70874,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: -29.000061} + m_AnchoredPosition: {x: 0, y: -29} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &687012548 @@ -101845,6 +101847,8 @@ MonoBehaviour: usernameTxt: {fileID: 99594038} coinsTxt: {fileID: 1602310476} gemsTxt: {fileID: 809069760} + metalTxt: {fileID: 1225876156} + oxygenTxt: {fileID: 1428544882} --- !u!4 &981460998 Transform: m_ObjectHideFlags: 0 @@ -108596,6 +108600,81 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 4015e071c1c47b3418d5ea02a291e62e, type: 3} +--- !u!1 &1044515040 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1044515041} + - component: {fileID: 1044515043} + - component: {fileID: 1044515042} + m_Layer: 5 + m_Name: Icon_Gem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1044515041 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1044515040} + 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: 1293333285} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 57} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1044515042 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1044515040} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.3301887, g: 0.3301887, b: 0.3301887, 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: 21300000, guid: 5beec98b0123b460392fbd67e7157727, type: 3} + m_Type: 1 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1044515043 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1044515040} + m_CullTransparentMesh: 0 --- !u!1001 &1044804692 PrefabInstance: m_ObjectHideFlags: 0 @@ -127591,6 +127670,140 @@ Transform: m_CorrespondingSourceObject: {fileID: 4450907741644114, guid: 6155ce0de57271a4380ca2565b5f63ff, type: 3} m_PrefabInstance: {fileID: 1933876692} m_PrefabAsset: {fileID: 0} +--- !u!1 &1225876154 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1225876155} + - component: {fileID: 1225876157} + - component: {fileID: 1225876156} + m_Layer: 5 + m_Name: Text_Value + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1225876155 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1225876154} + 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: 1293333285} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 30.2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1225876156 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1225876154} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + 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_text: 500 + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 5094b715585444e90b7306721788dae5, type: 2} + m_sharedMaterial: {fileID: 2393364598115949451, guid: 5094b715585444e90b7306721788dae5, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4291077993 + m_fontColor: {r: 0.4117647, g: 0.654902, b: 0.76862746, a: 1} + m_enableVertexGradient: 1 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 36 + m_fontSizeBase: 36 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 0 + m_fontSizeMax: 36 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 1 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 24, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &1225876157 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1225876154} + m_CullTransparentMesh: 0 --- !u!1 &1226376405 GameObject: m_ObjectHideFlags: 0 @@ -133398,6 +133611,125 @@ Transform: m_CorrespondingSourceObject: {fileID: 4190823331431948, guid: 23f4c7b05a0027945a769c2e9b0ec5cf, type: 3} m_PrefabInstance: {fileID: 677216219} m_PrefabAsset: {fileID: 0} +--- !u!1 &1293333284 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1293333285} + - component: {fileID: 1293333289} + - component: {fileID: 1293333288} + - component: {fileID: 1293333287} + - component: {fileID: 1293333286} + m_Layer: 5 + m_Name: Status_Metal + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1293333285 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1293333284} + 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: 1044515041} + - {fileID: 1225876155} + m_Father: {fileID: 546537819} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 450.16998, y: 0} + m_SizeDelta: {x: 0, y: 90} + m_Pivot: {x: 1, y: 0.5} +--- !u!114 &1293333286 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1293333284} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalFit: 2 + m_VerticalFit: 0 +--- !u!114 &1293333287 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1293333284} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 22 + m_Right: 22 + m_Top: 3 + m_Bottom: 0 + m_ChildAlignment: 4 + m_Spacing: 29 + m_ChildForceExpandWidth: 0 + m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 1 + m_ChildControlHeight: 0 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 0 + m_ReverseArrangement: 0 +--- !u!114 &1293333288 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1293333284} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.8862745, g: 0.85490197, b: 0.80784315, 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: 21300000, guid: 02c01c7f97bd046a58d55fe088b521bf, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1293333289 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1293333284} + m_CullTransparentMesh: 0 --- !u!1 &1293564750 stripped GameObject: m_CorrespondingSourceObject: {fileID: 1150648504801014, guid: 0cc6e50db7e29c74e9c377075d0c6140, type: 3} @@ -144142,6 +144474,140 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 6e6d70c03966a564aa69aed103ead6fc, type: 3} +--- !u!1 &1428544880 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1428544881} + - component: {fileID: 1428544883} + - component: {fileID: 1428544882} + m_Layer: 5 + m_Name: Text_Value + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1428544881 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1428544880} + 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: 1665232125} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 30.2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1428544882 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1428544880} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + 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_text: 500 + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 5094b715585444e90b7306721788dae5, type: 2} + m_sharedMaterial: {fileID: 2393364598115949451, guid: 5094b715585444e90b7306721788dae5, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4291077993 + m_fontColor: {r: 0.4117647, g: 0.654902, b: 0.76862746, a: 1} + m_enableVertexGradient: 1 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 36 + m_fontSizeBase: 36 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 0 + m_fontSizeMax: 36 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 1 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 24, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &1428544883 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1428544880} + m_CullTransparentMesh: 0 --- !u!4 &1428623155 stripped Transform: m_CorrespondingSourceObject: {fileID: 4260669499274196, guid: cf6a3dc1746cbde4bbfdbf46e06a8842, type: 3} @@ -159028,7 +159494,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: -29.000061} + m_AnchoredPosition: {x: 0, y: -29} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1567429822 @@ -168631,6 +169097,125 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 9dd3fb8ac8fed334fa8c89fad4607d76, type: 3} +--- !u!1 &1665232124 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1665232125} + - component: {fileID: 1665232129} + - component: {fileID: 1665232128} + - component: {fileID: 1665232127} + - component: {fileID: 1665232126} + m_Layer: 5 + m_Name: Status_Oxygen + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1665232125 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1665232124} + 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: 1756130657} + - {fileID: 1428544881} + m_Father: {fileID: 546537819} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 211.14, y: 0} + m_SizeDelta: {x: 0, y: 90} + m_Pivot: {x: 1, y: 0.5} +--- !u!114 &1665232126 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1665232124} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalFit: 2 + m_VerticalFit: 0 +--- !u!114 &1665232127 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1665232124} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 22 + m_Right: 22 + m_Top: 3 + m_Bottom: 0 + m_ChildAlignment: 4 + m_Spacing: 29 + m_ChildForceExpandWidth: 0 + m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 1 + m_ChildControlHeight: 0 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 0 + m_ReverseArrangement: 0 +--- !u!114 &1665232128 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1665232124} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.8862745, g: 0.85490197, b: 0.80784315, 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: 21300000, guid: 02c01c7f97bd046a58d55fe088b521bf, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1665232129 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1665232124} + m_CullTransparentMesh: 0 --- !u!4 &1665232743 stripped Transform: m_CorrespondingSourceObject: {fileID: 4260669499274196, guid: cf6a3dc1746cbde4bbfdbf46e06a8842, type: 3} @@ -177613,6 +178198,81 @@ Transform: m_CorrespondingSourceObject: {fileID: 4505198361830228, guid: 38a3e938a02b8f54c8d2fd90258d2fb9, type: 3} m_PrefabInstance: {fileID: 860911459} m_PrefabAsset: {fileID: 0} +--- !u!1 &1756130656 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1756130657} + - component: {fileID: 1756130659} + - component: {fileID: 1756130658} + m_Layer: 5 + m_Name: Icon_Gem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1756130657 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1756130656} + 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: 1665232125} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 57} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1756130658 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1756130656} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.28366464, g: 0.6037736, b: 0.17372729, 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: 21300000, guid: 5beec98b0123b460392fbd67e7157727, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1756130659 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1756130656} + m_CullTransparentMesh: 0 --- !u!1001 &1756271782 PrefabInstance: m_ObjectHideFlags: 0 @@ -195444,11 +196104,11 @@ RectTransform: - {fileID: 809069759} - {fileID: 195368258} m_Father: {fileID: 546537819} - m_RootOrder: 1 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 788.45, y: 0} + m_AnchoredPosition: {x: 1233.9, y: 0} m_SizeDelta: {x: 0, y: 90} m_Pivot: {x: 1, y: 0.5} --- !u!114 &1934658493 @@ -212648,6 +213308,7 @@ MonoBehaviour: collectableAmount: 0 btn: {fileID: 2098386628} txt: {fileID: 1959732800} + resourceType: 0 --- !u!1001 &2098658831 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/Assets/Game/ScriptableObjects/BuildingData/O2Mine.asset b/Assets/Game/ScriptableObjects/BuildingData/O2Mine.asset index 19c6feb9b..f9b0ef84e 100644 --- a/Assets/Game/ScriptableObjects/BuildingData/O2Mine.asset +++ b/Assets/Game/ScriptableObjects/BuildingData/O2Mine.asset @@ -23,5 +23,6 @@ MonoBehaviour: price: 20000 description: This is an Oxygen Mine collectable: 1 + resourceType: 1 productinoRates: - 1 diff --git a/Assets/Game/Scripts/BuildingData.cs b/Assets/Game/Scripts/BuildingData.cs index 12da139bf..faf7c62e3 100644 --- a/Assets/Game/Scripts/BuildingData.cs +++ b/Assets/Game/Scripts/BuildingData.cs @@ -12,9 +12,17 @@ public class BuildingData : ScriptableObject public string description; public bool collectable; + public CollectablesData.ResourceType resourceType; public float[] productinoRates; } +public static class CollectablesData{ + public enum ResourceType{ + Metal, + Oxygen + } +} + [System.Serializable] public class BuildingStat{ public string name; diff --git a/Assets/Game/Scripts/CollectBtn.cs b/Assets/Game/Scripts/CollectBtn.cs index 7e7c3bac8..69077b353 100644 --- a/Assets/Game/Scripts/CollectBtn.cs +++ b/Assets/Game/Scripts/CollectBtn.cs @@ -6,11 +6,18 @@ using UnityEngine.UI; public class CollectBtn : MonoBehaviour { public DateTime lastCollected; + public string buildingId; public float productionRate; public double collectableAmount; public Button btn; public TMP_Text txt; + public CollectablesData.ResourceType resourceType; + + + void Start(){ + btn.onClick.AddListener(OnClick); + } void Update() { @@ -20,8 +27,25 @@ public class CollectBtn : MonoBehaviour btn.interactable = collectableAmount > 1; } - public void Set(DateTime _lastCollected, float _productionRate){ + public void Set(string id,DateTime _lastCollected, float _productionRate, CollectablesData.ResourceType _resourceType){ + buildingId = id; lastCollected = _lastCollected; productionRate=_productionRate; + resourceType = _resourceType; + } + + void OnClick(){ + collectableAmount=((DateTime.Now - lastCollected).TotalSeconds * productionRate); + lastCollected = DBmanager.GetNetworkTime(); + switch (resourceType){ + case CollectablesData.ResourceType.Metal: + DBmanager.SetMetal(DBmanager.Metal + (int)collectableAmount); + break; + + case CollectablesData.ResourceType.Oxygen: + DBmanager.SetOxygen(DBmanager.Oxygen + (int)collectableAmount); + break; + } + DBmanager.CollectBuilding(buildingId); } } diff --git a/Assets/Game/Scripts/DBmanager.cs b/Assets/Game/Scripts/DBmanager.cs index 1cd630b71..998168f56 100644 --- a/Assets/Game/Scripts/DBmanager.cs +++ b/Assets/Game/Scripts/DBmanager.cs @@ -15,11 +15,16 @@ public class DBmanager : MonoBehaviour public static string username = null; private static int coins = 0; private static int gems = 0; + private static int metal = 0; + private static int oxygen = 0; public static List buildingStates = new List(); public static UnityEvent OnStateChanged = new UnityEvent(); public static int Coins => coins; public static int Gems => gems; + public static int Metal => metal; + public static int Oxygen => oxygen; + public static bool LoggedIn { get { return username != null; } } public static void LogOut() @@ -78,7 +83,7 @@ public class DBmanager : MonoBehaviour return networkDateTime.ToLocalTime(); } - // stackoverflow.com/a/3294698/162671 + static uint SwapEndianness(ulong x) { return (uint) (((x & 0x000000ff) << 24) + @@ -132,7 +137,52 @@ public class DBmanager : MonoBehaviour GameManagerInstance.gameManager.RefreshData(); } - public static void GetBuildingStates(string rawData){ + public async static void SetMetal(int newValue,bool justOffline=false){ + WWWForm form = new WWWForm(); + form.AddField("name", username); + form.AddField("metal", newValue); + if(justOffline){metal=newValue; return;} + using(UnityWebRequest www = UnityWebRequest.Post(phpRoot + "set_metal.php",form)){ + var operation = www.SendWebRequest(); + while(!operation.isDone){ + await Task.Yield(); + } + + if(www.downloadHandler.text=="0"){ + metal = newValue; + }else{ + Debug.Log("Response : " + www.downloadHandler.text); + Debug.LogWarning("Failed to set metal to " + newValue); + } + } + + GameManagerInstance.gameManager.RefreshData(); + } + + public async static void SetOxygen(int newValue,bool justOffline=false){ + WWWForm form = new WWWForm(); + form.AddField("name", username); + form.AddField("oxygen", newValue); + if(justOffline){oxygen=newValue; return;} + using(UnityWebRequest www = UnityWebRequest.Post(phpRoot + "set_oxygen.php",form)){ + var operation = www.SendWebRequest(); + while(!operation.isDone){ + await Task.Yield(); + } + + if(www.downloadHandler.text=="0"){ + oxygen = newValue; + }else{ + Debug.Log("Response : " + www.downloadHandler.text); + Debug.LogWarning("Failed to set oxygen to " + newValue); + } + } + + GameManagerInstance.gameManager.RefreshData(); + } + + public static bool GetBuildingStates(string rawData){ + bool success = false; try{ buildingStates = JsonConvert.DeserializeObject>(rawData); @@ -140,12 +190,15 @@ public class DBmanager : MonoBehaviour if(buildingStates==null){ buildingStates = new List(); } + success=true; }catch(Exception e){ Debug.LogError(e.Message); Debug.LogError("Error updating buildings from server, Response:" + rawData); + success=false; } OnStateChanged.Invoke(); + return success; } public async static Task AddBuilding(BuildingData buildingData){ @@ -178,6 +231,21 @@ public class DBmanager : MonoBehaviour OnStateChanged.Invoke(); } + + public async static Task CollectBuilding(string id){ + for(int i=0; i < buildingStates.Count; i++){ + if(buildingStates[i].id == id){ + buildingStates[i].lastCollectedTimestamp = GetNetworkTime(); + Debug.Log("Setting " + id + " last collected to " + buildingStates[i].lastCollectedTimestamp); + break; + } + } + + await UpdateBuildingsToServer(); + + OnStateChanged.Invoke(); + } + public async static Task RelocateBuilding(string id, Vector3 newPosition){ for(int i=0; i < buildingStates.Count; i++){ if(buildingStates[i].id == id){ diff --git a/Assets/Game/Scripts/GameManager.cs b/Assets/Game/Scripts/GameManager.cs index 675715240..bbe6e6a62 100644 --- a/Assets/Game/Scripts/GameManager.cs +++ b/Assets/Game/Scripts/GameManager.cs @@ -10,6 +10,8 @@ public class GameManager : MonoBehaviour public TMP_Text usernameTxt; public TMP_Text coinsTxt; public TMP_Text gemsTxt; + public TMP_Text metalTxt; + public TMP_Text oxygenTxt; void Start() { @@ -35,6 +37,8 @@ public class GameManager : MonoBehaviour public void RefreshData(){ coinsTxt.text = DBmanager.Coins.ToString(); gemsTxt.text = DBmanager.Gems.ToString(); + metalTxt.text = DBmanager.Metal.ToString(); + oxygenTxt.text = DBmanager.Oxygen.ToString(); } } diff --git a/Assets/Game/Scripts/LoginManager.cs b/Assets/Game/Scripts/LoginManager.cs index 816226cb5..27d37af05 100644 --- a/Assets/Game/Scripts/LoginManager.cs +++ b/Assets/Game/Scripts/LoginManager.cs @@ -86,7 +86,9 @@ public class LoginManager : MonoBehaviour PlayerPrefs.SetString("password", login_password.text); PlayerPrefs.Save();} DBmanager.username = login_username.text; - DBmanager.GetBuildingStates(www.text.Split('\t')[3]); + DBmanager.GetBuildingStates(www.text.Split('\t')[5]); + DBmanager.SetOxygen(int.Parse(www.text.Split('\t')[4]),true); + DBmanager.SetMetal(int.Parse(www.text.Split('\t')[3]),true); DBmanager.SetGems(int.Parse(www.text.Split('\t')[2]),true); DBmanager.SetCoins(int.Parse(www.text.Split('\t')[1]),true); diff --git a/Assets/Game/Scripts/SelectedItemMenu.cs b/Assets/Game/Scripts/SelectedItemMenu.cs index d3014e661..ddb30378a 100644 --- a/Assets/Game/Scripts/SelectedItemMenu.cs +++ b/Assets/Game/Scripts/SelectedItemMenu.cs @@ -52,7 +52,7 @@ public class SelectedItemMenu : MonoBehaviour if(Selector.selectedData.collectable){ collectBtn.gameObject.SetActive(true); Debug.Log("Last collected : " +Selector.selectedBuilding.lastCollected ); - collectBtn.Set(Selector.selectedBuilding.lastCollected,Selector.selectedData.productinoRates[Selector.selectedBuilding.curLevel]); + collectBtn.Set(Selector.selectedData.buildingName,Selector.selectedBuilding.lastCollected,Selector.selectedData.productinoRates[Selector.selectedBuilding.curLevel],Selector.selectedData.resourceType); }else{ collectBtn.gameObject.SetActive(false); }