diff --git a/Assets/Fonts/NEW/NexaRegular COOL.asset b/Assets/Fonts/NEW/NexaRegular COOL.asset index aec0ddf..2c2bea4 100644 --- a/Assets/Fonts/NEW/NexaRegular COOL.asset +++ b/Assets/Fonts/NEW/NexaRegular COOL.asset @@ -11349,7 +11349,7 @@ Material: - _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767} - _EnvMatrixRotation: {r: 0, g: 0, b: 0, a: 0} - _FaceColor: {r: 1, g: 1, b: 1, a: 1} - - _GlowColor: {r: 1, g: 0.8115379, b: 0, a: 1} + - _GlowColor: {r: 0, g: 1, b: 0.14974451, a: 1} - _MaskCoord: {r: 0, g: 0, b: 32767, a: 32767} - _OutlineColor: {r: 0.554717, g: 0.554717, b: 0.554717, a: 1} - _ReflectFaceColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/Scenes/GameScene3D.unity b/Assets/Scenes/GameScene3D.unity index c18a26d..cdb54c7 100644 --- a/Assets/Scenes/GameScene3D.unity +++ b/Assets/Scenes/GameScene3D.unity @@ -218,6 +218,143 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2014457} m_CullTransparentMesh: 1 +--- !u!1 &6558518 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6558519} + - component: {fileID: 6558521} + - component: {fileID: 6558520} + m_Layer: 5 + m_Name: instruction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &6558519 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6558518} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1746408322} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -253, y: -95} + m_SizeDelta: {x: 603.2, y: 261.4} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &6558520 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6558518} + 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: "\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0441\u0444\u043E\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0440\u0443\u0439\u0442\u0435 + \u043F\u043E\u0431\u0435\u0434\u043D\u044B\u0439 \u044D\u043A\u0440\u0430\u043D.\n\n\u041E\u0442\u0441\u043A\u0430\u043D\u0438\u0440\u0443\u0439\u0442\u0435 + QR-\u043A\u043E\u0434, \u043F\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 + \u043F\u043E \u0441\u0441\u044B\u043B\u043A\u0435." + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 3f10bbcf486189d4f95b8de6dc2e2177, type: 2} + m_sharedMaterial: {fileID: 4262305343556741190, guid: 3f10bbcf486189d4f95b8de6dc2e2177, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + 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: 32 + m_fontSizeBase: 32 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 16 + m_fontSizeMax: 64 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + 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: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, 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 &6558521 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6558518} + m_CullTransparentMesh: 1 --- !u!224 &18039639 stripped RectTransform: m_CorrespondingSourceObject: {fileID: 6633440379787528243, guid: db23caa1fa265364da1d9d9233646a06, type: 3} @@ -3400,6 +3537,7 @@ MonoBehaviour: - {fileID: 2083880677} - {fileID: 1601987967} AccentColor: {r: 1, g: 0.5563114, b: 0, a: 1} + ClickClip: {fileID: 8300000, guid: 1c48900c9ab0aa8418920a8193050870, type: 3} --- !u!1 &145377366 GameObject: m_ObjectHideFlags: 0 @@ -5519,6 +5657,7 @@ MonoBehaviour: - {fileID: 285779266} enabledColor: {r: 1, g: 1, b: 1, a: 1} disabledColor: {r: 0, g: 0, b: 0, a: 0} + PrizeText: {fileID: 285779266} --- !u!114 &248271432 MonoBehaviour: m_ObjectHideFlags: 0 @@ -5796,7 +5935,7 @@ MonoBehaviour: m_EditorClassIdentifier: Rows: 7 Cols: 7 - dummyBots: 0 + dummyBots: 1 botsAmount: 5 dummyPreset: {fileID: 11400000, guid: 35ba7f84d7557e8479f7f086269256f6, type: 2} MistressPreset: {fileID: 11400000, guid: 9aec48759dff81140a8ede5cbefe07d5, type: 2} @@ -5877,6 +6016,7 @@ MonoBehaviour: enterPasswordPanel: {fileID: 403995020} soundManager: {fileID: 151433694} vitrinaPanel: {fileID: 61619038} + qrPanel: {fileID: 1060301113} --- !u!4 &259182280 Transform: m_ObjectHideFlags: 0 @@ -6219,6 +6359,140 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 273486443} m_CullTransparentMesh: 1 +--- !u!1 &275313343 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 275313344} + - component: {fileID: 275313346} + - component: {fileID: 275313345} + m_Layer: 5 + m_Name: Prize + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &275313344 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 275313343} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1746408322} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -253, y: 95} + m_SizeDelta: {x: 603.2, y: 261.4} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &275313345 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 275313343} + 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: + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 3f10bbcf486189d4f95b8de6dc2e2177, type: 2} + m_sharedMaterial: {fileID: 4262305343556741190, guid: 3f10bbcf486189d4f95b8de6dc2e2177, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + 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: 32 + m_fontSizeBase: 32 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 16 + m_fontSizeMax: 64 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + 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: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, 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 &275313346 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 275313343} + m_CullTransparentMesh: 1 --- !u!1 &285779264 GameObject: m_ObjectHideFlags: 0 @@ -6230,7 +6504,6 @@ GameObject: - component: {fileID: 285779265} - component: {fileID: 285779267} - component: {fileID: 285779266} - - component: {fileID: 285779268} m_Layer: 5 m_Name: value m_TagString: Untagged @@ -6354,23 +6627,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 285779264} m_CullTransparentMesh: 1 ---- !u!114 &285779268 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 285779264} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 3a3ea547a8c834648ae7cd81280d5cb6, type: 3} - m_Name: - m_EditorClassIdentifier: - prefsType: 0 - prefix: - suffix: - prefsKey: SpecialPrize - defaultText: "<\u043D\u0435 \u0443\u043A\u0430\u0437\u0430\u043D\u043E>" --- !u!1 &295854237 GameObject: m_ObjectHideFlags: 0 @@ -8425,7 +8681,6 @@ GameObject: - component: {fileID: 411367487} - component: {fileID: 411367486} - component: {fileID: 411367485} - - component: {fileID: 411367484} m_Layer: 5 m_Name: '[Notifications CANVAS]' m_TagString: Untagged @@ -8433,23 +8688,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &411367484 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 411367483} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 --- !u!114 &411367485 MonoBehaviour: m_ObjectHideFlags: 0 @@ -9443,7 +9681,6 @@ GameObject: - component: {fileID: 446139684} - component: {fileID: 446139683} - component: {fileID: 446139682} - - component: {fileID: 446139681} m_Layer: 5 m_Name: BackgroundCanvas m_TagString: Untagged @@ -9451,23 +9688,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &446139681 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 446139680} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 --- !u!114 &446139682 MonoBehaviour: m_ObjectHideFlags: 0 @@ -11488,8 +11708,8 @@ Camera: m_GameObject: {fileID: 519420028} m_Enabled: 1 serializedVersion: 2 - m_ClearFlags: 4 - m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0} + m_ClearFlags: 2 + m_BackGroundColor: {r: 0, g: 0, b: 0, a: 1} m_projectionMatrixMode: 1 m_GateFitMode: 2 m_FOVAxisMode: 0 @@ -24484,74 +24704,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 875450963} m_CullTransparentMesh: 1 ---- !u!1 &876915625 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 876915628} - - component: {fileID: 876915627} - - component: {fileID: 876915626} - m_Layer: 0 - m_Name: EventSystem - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &876915626 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 876915625} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} - m_Name: - m_EditorClassIdentifier: - m_SendPointerHoverToParent: 1 - m_HorizontalAxis: Horizontal - m_VerticalAxis: Vertical - m_SubmitButton: Submit - m_CancelButton: Cancel - m_InputActionsPerSecond: 10 - m_RepeatDelay: 0.5 - m_ForceModuleActive: 0 ---- !u!114 &876915627 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 876915625} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} - m_Name: - m_EditorClassIdentifier: - m_FirstSelected: {fileID: 0} - m_sendNavigationEvents: 1 - m_DragThreshold: 10 ---- !u!4 &876915628 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 876915625} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &886731937 GameObject: m_ObjectHideFlags: 0 @@ -32737,6 +32889,58 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 +--- !u!1 &1060301111 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1060301112} + - component: {fileID: 1060301113} + m_Layer: 5 + m_Name: Qr GET prize + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &1060301112 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1060301111} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1746408322} + m_Father: {fileID: 1122363135} + 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: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1060301113 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1060301111} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 421d421d64446204498c3d34dc5965e2, type: 3} + m_Name: + m_EditorClassIdentifier: + QrImage: {fileID: 1776154339} + Label: {fileID: 275313345} + timer: 0 --- !u!1 &1065644473 GameObject: m_ObjectHideFlags: 0 @@ -33793,6 +33997,37 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1092824965} m_CullTransparentMesh: 1 +--- !u!1 &1094267206 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1094267207} + m_Layer: 0 + m_Name: UnityMainThreadDispatcher + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1094267207 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1094267206} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1099580096 GameObject: m_ObjectHideFlags: 0 @@ -34163,7 +34398,6 @@ GameObject: - component: {fileID: 1122363135} - component: {fileID: 1122363134} - component: {fileID: 1122363133} - - component: {fileID: 1122363132} m_Layer: 5 m_Name: '[CANVAS]' m_TagString: Untagged @@ -34171,23 +34405,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &1122363132 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1122363131} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 --- !u!114 &1122363133 MonoBehaviour: m_ObjectHideFlags: 0 @@ -34274,6 +34491,7 @@ RectTransform: - {fileID: 403995019} - {fileID: 1603925512} - {fileID: 61619037} + - {fileID: 1060301112} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -35778,6 +35996,140 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 47a33fadb3b3c8443879b1887024e089, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!1 &1212503068 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1212503069} + - component: {fileID: 1212503071} + - component: {fileID: 1212503070} + m_Layer: 5 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1212503069 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1212503068} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1746408322} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 1} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: 0, y: -75.20001} + m_SizeDelta: {x: 400, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1212503070 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1212503068} + 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: "\u041F\u043E\u0437\u0434\u0440\u0430\u0432\u043B\u044F\u0435\u043C!" + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 3f10bbcf486189d4f95b8de6dc2e2177, type: 2} + m_sharedMaterial: {fileID: 4262305343556741190, guid: 3f10bbcf486189d4f95b8de6dc2e2177, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + 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: 50 + m_fontSizeBase: 50 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 16 + m_fontSizeMax: 64 + 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: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, 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 &1212503071 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1212503068} + m_CullTransparentMesh: 1 --- !u!1 &1214332435 GameObject: m_ObjectHideFlags: 0 @@ -36759,7 +37111,7 @@ GameObject: - component: {fileID: 1250035842} - component: {fileID: 1250035844} m_Layer: 5 - m_Name: Text (TMP) + m_Name: Serial number m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -49950,6 +50302,7 @@ MonoBehaviour: CharacterNameLabel: {fileID: 38089729} CharacterIcon: {fileID: 1329533187} ChangeCharacterInterval: 0.15 + ClickSound: {fileID: 8300000, guid: 1c48900c9ab0aa8418920a8193050870, type: 3} --- !u!1 &1602294394 GameObject: m_ObjectHideFlags: 0 @@ -52060,6 +52413,86 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1738381898} m_CullTransparentMesh: 1 +--- !u!1 &1746408321 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1746408322} + - component: {fileID: 1746408324} + - component: {fileID: 1746408323} + m_Layer: 5 + m_Name: Panel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1746408322 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1746408321} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1212503069} + - {fileID: 1776154338} + - {fileID: 275313344} + - {fileID: 6558519} + - {fileID: 2039158353} + m_Father: {fileID: 1060301112} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 1300, y: 800} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1746408323 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1746408321} + 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, g: 0, b: 0, 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: 1304898661, guid: bff7731f029e97345b55849f0e330c32, 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 &1746408324 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1746408321} + m_CullTransparentMesh: 1 --- !u!1 &1749880613 GameObject: m_ObjectHideFlags: 0 @@ -52994,6 +53427,81 @@ MonoBehaviour: m_FlexibleWidth: -1 m_FlexibleHeight: -1 m_LayoutPriority: 1 +--- !u!1 &1776154337 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1776154338} + - component: {fileID: 1776154340} + - component: {fileID: 1776154339} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1776154338 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1776154337} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1746408322} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 330, y: 0} + m_SizeDelta: {x: 457.12, y: 457.12} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1776154339 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1776154337} + 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: 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_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 &1776154340 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1776154337} + m_CullTransparentMesh: 1 --- !u!1 &1784614871 GameObject: m_ObjectHideFlags: 0 @@ -56003,7 +56511,7 @@ MonoBehaviour: rgba: 4294967295 m_fontColor: {r: 1, g: 1, b: 1, a: 1} m_enableVertexGradient: 0 - m_colorMode: 3 + m_colorMode: 0 m_fontColorGradient: topLeft: {r: 1, g: 1, b: 1, a: 1} topRight: {r: 1, g: 1, b: 1, a: 1} @@ -57994,6 +58502,142 @@ MonoBehaviour: m_ChildScaleWidth: 0 m_ChildScaleHeight: 0 m_ReverseArrangement: 0 +--- !u!1 &2039158352 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2039158353} + - component: {fileID: 2039158355} + - component: {fileID: 2039158354} + m_Layer: 5 + m_Name: Text (TMP) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2039158353 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2039158352} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1746408322} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -285, y: -280} + m_SizeDelta: {x: 625.7, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &2039158354 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2039158352} + 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: "\u0427\u0442\u043E\u0431\u044B \u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C, + \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0439\u0442\u0435 \u041B\u044E\u0431\u0443\u044E + \u043A\u043D\u043E\u043F\u043A\u0443 \"\u0412\u043B\u0435\u0432\u043E\" 3 \u0441\u0435\u043A\u0443\u043D\u0434\u044B" + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 3f10bbcf486189d4f95b8de6dc2e2177, type: 2} + m_sharedMaterial: {fileID: 4262305343556741190, guid: 3f10bbcf486189d4f95b8de6dc2e2177, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + 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: 32 + m_fontSizeBase: 32 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 16 + m_fontSizeMax: 64 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + 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: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, 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 &2039158355 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2039158352} + m_CullTransparentMesh: 1 --- !u!1 &2043408353 GameObject: m_ObjectHideFlags: 0 @@ -58380,6 +59024,7 @@ MonoBehaviour: m_EditorClassIdentifier: TypeNameLabel: {fileID: 1317264169} ChangeTypeInterval: 0.15 + ClickSound: {fileID: 8300000, guid: 1c48900c9ab0aa8418920a8193050870, type: 3} --- !u!1 &2057785455 GameObject: m_ObjectHideFlags: 0 @@ -72848,8 +73493,8 @@ SceneRoots: - {fileID: 411367487} - {fileID: 1542626845} - {fileID: 1851050357} - - {fileID: 876915628} - {fileID: 2115833904} - {fileID: 1165555974} - {fileID: 592995719} - {fileID: 2090837466} + - {fileID: 1094267207} diff --git a/Assets/Scripts/CoinCounter.cs b/Assets/Scripts/CoinCounter.cs index df4ec63..6b9d8ba 100644 --- a/Assets/Scripts/CoinCounter.cs +++ b/Assets/Scripts/CoinCounter.cs @@ -36,7 +36,8 @@ public class CoinCounter : MonoBehaviour public void SetRevengePriceVisibility(bool visibility) { - if(revengeSignGo != null) revengeSignGo.SetActive(visibility); + if(revengeSignGo != null) + revengeSignGo.SetActive(visibility); int priceRevenge = PlayerPrefs.GetInt("PriceRevenge", 10); int pricePve = PlayerPrefs.GetInt("PricePVE", 10); diff --git a/Assets/Scripts/EnterPasswordPanel.cs b/Assets/Scripts/EnterPasswordPanel.cs index 6c31442..c235fa0 100644 --- a/Assets/Scripts/EnterPasswordPanel.cs +++ b/Assets/Scripts/EnterPasswordPanel.cs @@ -150,6 +150,7 @@ public class EnterPasswordPanel : MonoBehaviour "R2" => R2, "A1" => D1, "A2" => D2, + _ => L1 }; GameObject spawned = Instantiate(prefab, slots[enteredSymbols]); diff --git a/Assets/Scripts/GameFSM/ChipFallingState.cs b/Assets/Scripts/GameFSM/ChipFallingState.cs index bb95939..57b148a 100644 --- a/Assets/Scripts/GameFSM/ChipFallingState.cs +++ b/Assets/Scripts/GameFSM/ChipFallingState.cs @@ -9,7 +9,7 @@ public class ChipFallingState : IState const float BOUNCE_SPEEDY_TRESHOLD = 5; const float MAX_ANGULAR_SPEED = 500; - const bool USE_BOUNCE = false; + bool USE_BOUNCE = false; int rowIndex; int colIndex; diff --git a/Assets/Scripts/GameFSM/PrizeState.cs b/Assets/Scripts/GameFSM/PrizeState.cs new file mode 100644 index 0000000..1499e66 --- /dev/null +++ b/Assets/Scripts/GameFSM/PrizeState.cs @@ -0,0 +1,75 @@ +using PrizeSystem; +using UnityEngine; + + +public class PrizeState : IState +{ + private GameManager gm; + private IState nextState; + + + private VitrinaPanel vitrina; + private QrPanel qr; + + public PrizeState(IState nextState) + { + this.nextState = nextState; + } + public void enter() + { + Debug.Log("Çàøåë â ïðèç"); + gm = GameManager.instance; + + gm.timerManager.StopAllTimers(); + if(PrizeSystemManager.HasVitrinaPrizeToGive) + { + if(gm.vitrinaPanel.TryGetComponent(out vitrina)) + { + vitrina.OnComplete += OnComplete; + gm.vitrinaPanel.gameObject.SetActive(true); + VitrinaPrize prize = PrizeSystemManager.DequeueVitrinaPrize(); + gm.vitrinaPanel.Initialize(prize.Boxes); + } + } + else if (PrizeSystemManager.HasQrPrizeToGive) + { + if (gm.qrPanel.TryGetComponent(out qr)) + { + qr.OnComplete += OnComplete; + gm.qrPanel.gameObject.SetActive(true); + QrPrize prize = PrizeSystemManager.DequeueQrPrize(); + gm.qrPanel.Initialize(prize); + } + + } + //äîáàâèòü qr ïàíåëü-âûäàò÷èê. + else + { + gm.stateMachine.ChangeState(nextState); + } + + + + + } + + private void OnComplete() + { + + gm.stateMachine.ChangeState(nextState); + } + + public void exit() + { + if (vitrina != null) + { + vitrina.OnComplete -= OnComplete; + vitrina = null; + } + } + + public void update() + { + + } +} diff --git a/Assets/Scripts/GameFSM/PrizeState.cs.meta b/Assets/Scripts/GameFSM/PrizeState.cs.meta new file mode 100644 index 0000000..184d144 --- /dev/null +++ b/Assets/Scripts/GameFSM/PrizeState.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1aa945d28720e3c42838820bfc351306 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/GameFSM/VictoryState.cs b/Assets/Scripts/GameFSM/VictoryState.cs index fe141c8..ddd9cd3 100644 --- a/Assets/Scripts/GameFSM/VictoryState.cs +++ b/Assets/Scripts/GameFSM/VictoryState.cs @@ -5,7 +5,6 @@ public class VictoryState : IState { VictoryScale scale; GameManager gameManager; - bool givePrize; TextMeshProUGUI ToMenuLabel; TextMeshProUGUI TimerLabel; @@ -14,7 +13,6 @@ public class VictoryState : IState IState nextState; - string timerTextCache; public void enter() { @@ -23,7 +21,6 @@ public class VictoryState : IState gameManager.timerManager.StopAllTimers(); ToMenuLabel = gameManager.ToMenuLabel; - timerTextCache = ToMenuLabel.text; //ToMenuLabel.text = "До перехода"; TimerLabel = gameManager.TimerLabel; @@ -34,7 +31,6 @@ public class VictoryState : IState //определÑ�ем Ñ� какой шкалой мы имеем дело if (gameManager.gameMode == GameMode.pvp) { - givePrize = false; nextState = new ShowWinnerState(gameManager.lastResult); if (gameManager.currentPlayer == CellState.Player1) { @@ -50,13 +46,9 @@ public class VictoryState : IState else { //победили ботов - givePrize = true; scale = gameManager.botScale; gameManager.winPanel.ShowWin(CellState.Empty); - //Ñ�то в меню переход. Ð�адо в показ видео и лидерборд - //nextState = new ClearFieldState(true, CellState.Player1); - //Ð� вот Ñ�то переход в показ видео и заполнение в таблицу лидеров nextState = new VictoryVideoState(new EnterNameState()); } @@ -70,7 +62,6 @@ public class VictoryState : IState //выкл анимацию приза scale.SetIdleState(); scale.winParticles.Stop(); - //ToMenuLabel.text = timerTextCache; //не выводит \n почему то gameManager.winPanel.CloseWin(); ToMenuLabel.gameObject.SetActive(false); } @@ -80,11 +71,7 @@ public class VictoryState : IState //полинг инпутов if (In.GetButtonDownAnyPlayer(PlayerAction.down)) { - /*if (gameManager.gameMode == GameMode.pve) - gameManager.stateMachine.ChangeState(new VictoryVideoState(new EnterNameState())); - else*/ - gameManager.stateMachine.ChangeState(nextState); - + gameManager.stateMachine.ChangeState(nextState); } TimerProcessing(); } @@ -105,7 +92,7 @@ public class VictoryState : IState TimerLabel.text = getTimeText(); } - string getTimeText()//в утилити бы Ñ�то вынеÑ�ти + private string getTimeText()//в утилити бы Ñ�то вынеÑ�ти { string minutes = ((int)(TimeRest / 60)).ToString(); string seconds = ((int)(TimeRest % 60)).ToString(); diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 5defd8a..3875709 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -433,6 +433,7 @@ public class GameManager : MonoBehaviour public SoundManager soundManager; public VitrinaPanel vitrinaPanel; + public QrPanel qrPanel; void Awake() { Cursor.lockState = CursorLockMode.Locked; diff --git a/Assets/Scripts/Gameplay/EndOfTurnHandler.cs b/Assets/Scripts/Gameplay/EndOfTurnHandler.cs index eadbdd6..eb44ea5 100644 --- a/Assets/Scripts/Gameplay/EndOfTurnHandler.cs +++ b/Assets/Scripts/Gameplay/EndOfTurnHandler.cs @@ -1,5 +1,4 @@ using PrizeSystem; -using Unity.VisualScripting; using UnityEngine; public static class EndOfTurnHandler @@ -12,7 +11,7 @@ public static class EndOfTurnHandler gm = GameManager.instance; gm.lastResult = result; - + bool wrapToPrizeState = false; IState nextState = new ShowWinnerState(result);//âðåìåííî @@ -29,14 +28,8 @@ public static class EndOfTurnHandler PveEndroundHandler(); if (gm.currentPlayer == CellState.Player1) {//àâòîïåðåõîä íà íåêñò áîòà. - - //Òóò íóæíî ïåðåéòè â ïðèçîâîå ñîñòîÿíèå - //Ïîòîì èç íåãî èäòè äàëüøå. - ShowWinnerState showWinner = CreateAutoTransitionState(result, 4); - - - - nextState = showWinner; + wrapToPrizeState = true; + nextState = CreateAutoTransitionState(result, 4); } } @@ -57,6 +50,9 @@ public static class EndOfTurnHandler nextState = new StartTurnState(); } + if(wrapToPrizeState) + nextState = new PrizeState(nextState: nextState); + gm.stateMachine.ChangeState(nextState); } diff --git a/Assets/Scripts/Inputs/ComSystem/ComWrapper.cs b/Assets/Scripts/Inputs/ComSystem/ComWrapper.cs index cd29d32..1ce0858 100644 --- a/Assets/Scripts/Inputs/ComSystem/ComWrapper.cs +++ b/Assets/Scripts/Inputs/ComSystem/ComWrapper.cs @@ -40,7 +40,7 @@ public static class ComWrapper AvailablePorts = availablePorts; if (_lifetimeCts != null) return; - _ = OpenPort(AvailablePorts); + _ = OpenPortAsync(AvailablePorts); if (h <= 0) { Log("Порт не открылÑ�Ñ� при инициализации"); @@ -269,7 +269,7 @@ public static class ComWrapper _ = StartKeepAliveProcessAsync(ct); } - private static async Task OpenPort(string[] availablePorts) + private static async Task OpenPortAsync(string[] availablePorts) { Log("ИнициализациÑ� порта"); @@ -494,7 +494,7 @@ public static class ComWrapper CancelAllWaiters(); ClosePort(); - OpenPort(AvailablePorts); + OpenPortAsync(AvailablePorts); if (h <= 0) { Log($"Ошибка при переподключении."); diff --git a/Assets/Scripts/PrizeSystem/Config menu/CharacterPrizeConfigurator.cs b/Assets/Scripts/PrizeSystem/Config menu/CharacterPrizeConfigurator.cs index 939d3c0..65a03e5 100644 --- a/Assets/Scripts/PrizeSystem/Config menu/CharacterPrizeConfigurator.cs +++ b/Assets/Scripts/PrizeSystem/Config menu/CharacterPrizeConfigurator.cs @@ -15,6 +15,7 @@ namespace PrizeSystem [SerializeField] List controlPanels; [SerializeField] private Color AccentColor; + [SerializeField] private AudioClip ClickClip; int controlIndex = 0; @@ -116,6 +117,7 @@ namespace PrizeSystem LightOnPanel(false); controlIndex = (controlIndex + 1 + controlPanels.Count) % controlPanels.Count; LightOnPanel(true); + if(ClickClip!= null) {SoundManager.instance.playClip(ClickClip); } } private void LightOnPanel(bool on) @@ -164,9 +166,6 @@ namespace PrizeSystem { GameManager.instance.stateMachine.ChangeState(new SettingsState()); } - - - IEnumerator BlinkAnimation(Graphic graphic) { while (true) diff --git a/Assets/Scripts/PrizeSystem/Config menu/Controls/CharacterSelectionPanel.cs b/Assets/Scripts/PrizeSystem/Config menu/Controls/CharacterSelectionPanel.cs index 6db33f6..18d0682 100644 --- a/Assets/Scripts/PrizeSystem/Config menu/Controls/CharacterSelectionPanel.cs +++ b/Assets/Scripts/PrizeSystem/Config menu/Controls/CharacterSelectionPanel.cs @@ -12,7 +12,7 @@ public class CharacterSelectionPanel : MonoBehaviour, IControl [SerializeField] TextMeshProUGUI CharacterNameLabel; [SerializeField] Image CharacterIcon; [SerializeField] float ChangeCharacterInterval = 0.15f; - + [SerializeField] AudioClip ClickSound; private float LastSwipeTime = 0; private Character[] characters; @@ -35,6 +35,7 @@ public class CharacterSelectionPanel : MonoBehaviour, IControl { if (CanSwipe) { + if (ClickSound != null) { SoundManager.instance.playClip(ClickSound); } BeforeCharacterChange?.Invoke(SelectedCharacter); CharacterIndex = (CharacterIndex + direction + CharactersCount) % CharactersCount; diff --git a/Assets/Scripts/PrizeSystem/Config menu/Controls/TypeSelectionPanel.cs b/Assets/Scripts/PrizeSystem/Config menu/Controls/TypeSelectionPanel.cs index 22f167e..502eea8 100644 --- a/Assets/Scripts/PrizeSystem/Config menu/Controls/TypeSelectionPanel.cs +++ b/Assets/Scripts/PrizeSystem/Config menu/Controls/TypeSelectionPanel.cs @@ -9,6 +9,7 @@ namespace PrizeSystem{ [SerializeField] TextMeshProUGUI TypeNameLabel; [SerializeField] float ChangeTypeInterval = 0.15f; + [SerializeField] AudioClip ClickSound; private int index = 0; private float LastSwipeTime = 0; @@ -25,6 +26,7 @@ namespace PrizeSystem{ { if (CanSwipe) { + if(ClickSound!=null) { SoundManager.instance.playClip(ClickSound); } index = (index + direction + PrizeTypes.Length) % PrizeTypes.Length; RefresfUI(); OnTypeChanged?.Invoke(SelectedType); diff --git a/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/CountedPrizeInput.cs b/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/CountedPrizeInput.cs index 88a9a28..d739e9a 100644 --- a/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/CountedPrizeInput.cs +++ b/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/CountedPrizeInput.cs @@ -48,11 +48,12 @@ namespace PrizeSystem public override void Swipe(int direction) { + if (CanSwipe) { - if(Value+direction> Min && Value+direction< Max) + if (Value + direction >= Min && Value + direction <= Max) { - if(SwitchClip != null) SoundManager.instance.playClip(SwitchClip); + if (SwitchClip != null) SoundManager.instance.playClip(SwitchClip); } Value += direction; @@ -67,16 +68,16 @@ namespace PrizeSystem public override void Tick() { bool left = In.GetButtonAnyPlayer(PlayerAction.left); - bool right= In.GetButtonAnyPlayer(PlayerAction.right); + bool right = In.GetButtonAnyPlayer(PlayerAction.right); - if(!(left || right)) + if (!(left || right)) { Delay = MaxDelay; LastSwipeTime = 0; } else { - Delay = Mathf.Clamp(Delay - Acceleration*Time.deltaTime, MinDelay, MaxDelay); + Delay = Mathf.Clamp(Delay - Acceleration * Time.deltaTime, MinDelay, MaxDelay); } } diff --git a/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/Prefabs/MarblesPrizeSettings 3.prefab b/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/Prefabs/MarblesPrizeSettings 3.prefab index c63dae7..23e2ebe 100644 --- a/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/Prefabs/MarblesPrizeSettings 3.prefab +++ b/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/Prefabs/MarblesPrizeSettings 3.prefab @@ -357,10 +357,9 @@ MonoBehaviour: Min: 1 Max: 10 MinDelay: 0.15 - MaxDelay: 0.5 - Acceleration: 0 + MaxDelay: 0.4 + Acceleration: 0.2 SwitchClip: {fileID: 8300000, guid: 1c48900c9ab0aa8418920a8193050870, type: 3} - Delay: 0 --- !u!1 &8121963000491084903 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/Prefabs/QrPrizeSettings.prefab b/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/Prefabs/QrPrizeSettings.prefab index 1f23394..fadfb4c 100644 --- a/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/Prefabs/QrPrizeSettings.prefab +++ b/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/Prefabs/QrPrizeSettings.prefab @@ -1479,6 +1479,8 @@ MonoBehaviour: rankLabel: {fileID: 3175867621395834710} textInput: {fileID: 1635635785162997950} AccentColor: {r: 1, g: 0.4398854, b: 0, a: 1} + clickClip: {fileID: 8300000, guid: 1c48900c9ab0aa8418920a8193050870, type: 3} + SwipeInterval: 0.3 --- !u!1 &3113275906872636537 GameObject: m_ObjectHideFlags: 0 @@ -1647,6 +1649,7 @@ RectTransform: - {fileID: 890072125137875243} - {fileID: 5899164440865912696} - {fileID: 5831607291207876570} + - {fileID: 5069836728228170916} m_Father: {fileID: 5510025155540528801} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} @@ -2211,7 +2214,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 100, y: -236} + m_AnchoredPosition: {x: 100, y: -245} m_SizeDelta: {x: 800, y: 93.48999} m_Pivot: {x: 0, y: 1} --- !u!222 &6667019072543580359 @@ -2305,6 +2308,11 @@ MonoBehaviour: - {fileID: 102279635399659491} frame: {fileID: 5548416305379766684} alphabet: " \u0410\u0411\u0412\u0413\u0414\u0415\u0401\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0451\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F0123456789_." + minInterval: 0.07 + maxInterval: 0.3 + acceleration: 3 + interval: 0.3 + ClickClip: {fileID: 8300000, guid: 1c48900c9ab0aa8418920a8193050870, type: 3} --- !u!1 &4487900830859546338 GameObject: m_ObjectHideFlags: 0 @@ -2683,8 +2691,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 106, y: 20} - m_SizeDelta: {x: 200, y: 50} + m_AnchoredPosition: {x: 191.90503, y: 19.155212} + m_SizeDelta: {x: 371.8101, y: 38.3104} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1166133467696736269 CanvasRenderer: @@ -2714,7 +2722,8 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: "\u0422\u0435\u043A\u0441\u0442" + m_text: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 + \u043F\u0440\u0438\u0437\u0430" m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 3f10bbcf486189d4f95b8de6dc2e2177, type: 2} m_sharedMaterial: {fileID: 4262305343556741190, guid: 3f10bbcf486189d4f95b8de6dc2e2177, type: 2} @@ -2749,7 +2758,7 @@ MonoBehaviour: m_fontSizeMax: 64 m_fontStyle: 0 m_HorizontalAlignment: 1 - m_VerticalAlignment: 256 + m_VerticalAlignment: 1024 m_textAlignment: 65535 m_characterSpacing: 0 m_wordSpacing: 0 @@ -3611,7 +3620,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: "\u0420\u0430\u043D\u0433" + m_text: "\u0426\u0435\u043D\u043D\u043E\u0441\u0442\u044C" m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 3f10bbcf486189d4f95b8de6dc2e2177, type: 2} m_sharedMaterial: {fileID: 4262305343556741190, guid: 3f10bbcf486189d4f95b8de6dc2e2177, type: 2} @@ -3755,6 +3764,147 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 +--- !u!1 &8561605351245038211 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5069836728228170916} + - component: {fileID: 6237542341363723453} + - component: {fileID: 3701064555661367737} + m_Layer: 5 + m_Name: Text (TMP) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5069836728228170916 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8561605351245038211} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 396805755242335028} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 190.6, y: 50} + m_SizeDelta: {x: 506.4, y: 100} + m_Pivot: {x: 0, y: 1} +--- !u!222 &6237542341363723453 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8561605351245038211} + m_CullTransparentMesh: 1 +--- !u!114 &3701064555661367737 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8561605351245038211} + 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: "\u0421\u0430\u043C\u044B\u0439 \u0446\u0435\u043D\u043D\u044B\u0439 \u043F\u0440\u0438\u0437 + \u0431\u0443\u0434\u0435\u0442 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0430\u0442\u044C\u0441\u044F + \u0432 \u043F\u0440\u0430\u0432\u0438\u043B\u0430\u0445 \u0441 \u0438\u043A\u043E\u043D\u043A\u043E\u0439 + \u0437\u043E\u043B\u043E\u0442\u043E\u0439 \u043C\u0435\u0434\u0430\u043B\u0438\n\n\u0415\u0441\u043B\u0438 + \u0435\u0441\u0442\u044C 2 qr-\u043A\u043E\u0434\u0430 \u0441 \u0437\u043E\u043B\u043E\u0442\u043E\u0439 + \u043C\u0435\u0434\u0430\u043B\u044C\u044E,\n\u0442\u043E \u0446\u0435\u043D\u043D\u0435\u0435 + \u0442\u043E\u0442, \u043A\u043E\u0442\u043E\u0440\u044B\u0439 \u0443 \u0431\u043E\u043B\u0435\u0435 + \u0441\u0438\u043B\u044C\u043D\u043E\u0433\u043E \u0431\u043E\u0442\u0430" + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 3f10bbcf486189d4f95b8de6dc2e2177, type: 2} + m_sharedMaterial: {fileID: 4262305343556741190, guid: 3f10bbcf486189d4f95b8de6dc2e2177, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + 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: 19.36 + m_fontSizeBase: 19.36 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 16 + m_fontSizeMax: 64 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: -50 + m_lineSpacingMax: 0 + m_paragraphSpacing: -12.85 + 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: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, 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!1 &8632252750584089712 GameObject: m_ObjectHideFlags: 0 @@ -3792,7 +3942,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 100, y: -339.9} + m_AnchoredPosition: {x: 100, y: -348.9} m_SizeDelta: {x: 800, y: 83.94061} m_Pivot: {x: 0, y: 1} --- !u!222 &8137459614657545606 diff --git a/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/Prefabs/QrTextInput.cs b/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/Prefabs/QrTextInput.cs index ffb21fd..92e7926 100644 --- a/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/Prefabs/QrTextInput.cs +++ b/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/Prefabs/QrTextInput.cs @@ -13,21 +13,62 @@ public class QrTextInput : MonoBehaviour private QrTextSlot CurrentSlot => slots[index]; private int index = 0; + private float LastSwipeLetter = 0; + + [SerializeField] float minInterval = 0.07f; + [SerializeField] float maxInterval = 0.3f; + [SerializeField] float acceleration = 3f; + [SerializeField] private float interval; + [SerializeField] AudioClip ClickClip; + + + private bool CanSwipe => Time.time - LastSwipeLetter > interval; private void OnEnable() { index = 0; + interval = maxInterval; } public void SwitchSlot(int direction) { + if(direction == 0) {return;} + CurrentSlot.SetActive(false); index = (index + direction + slots.Count) % slots.Count; CurrentSlot.SetActive(true); + ClickSound(); + } + public void DisableAllSlots() + { + foreach(QrTextSlot slot in slots) { slot.SetActive(false); } + } + public void EnableFirstSlot() + { + index = 0; + CurrentSlot.SetActive(true); + } + + + + + + private void ClickSound() + { + if (ClickClip != null) SoundManager.instance.playClip(ClickClip); } public void SwitchLetter(int direction) { + if (direction == 0) {return;} + if (!CanSwipe) { return; } + + LastSwipeLetter = Time.time; + interval-= acceleration * Time.deltaTime; + interval = Mathf.Clamp(interval, minInterval, maxInterval); + + ClickSound(); + int currentLetterIndex = alphabet.IndexOf(CurrentSlot.GetText()); if (currentLetterIndex != -1) { @@ -41,7 +82,17 @@ public class QrTextInput : MonoBehaviour } } + private void Update() + { + bool left = In.GetButton(ButtonPinMapping.left1); + bool right = In.GetButton(ButtonPinMapping.right1); + if (!(left || right)) + { + interval = maxInterval; + LastSwipeLetter = 0; + } + } public string GetText() { var sb = new StringBuilder(); diff --git a/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/Prefabs/TicketPrizeSettings.prefab b/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/Prefabs/TicketPrizeSettings.prefab index 35c9443..51dd567 100644 --- a/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/Prefabs/TicketPrizeSettings.prefab +++ b/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/Prefabs/TicketPrizeSettings.prefab @@ -323,10 +323,9 @@ MonoBehaviour: Min: 1 Max: 100 MinDelay: 0 - MaxDelay: 0.5 + MaxDelay: 0.3 Acceleration: 0.2 SwitchClip: {fileID: 8300000, guid: 1c48900c9ab0aa8418920a8193050870, type: 3} - Delay: 0 --- !u!1 &5030279612583269179 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/Prefabs/VitrinaPrizeSettings.prefab b/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/Prefabs/VitrinaPrizeSettings.prefab index b54a1ed..d9f01bd 100644 --- a/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/Prefabs/VitrinaPrizeSettings.prefab +++ b/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/Prefabs/VitrinaPrizeSettings.prefab @@ -250,6 +250,7 @@ MonoBehaviour: Content: {fileID: 905256846402403460} TogglePrefab: {fileID: 1876997734204608492, guid: fe164a79739075f429d761ca69f8849e, type: 3} Pointer: {fileID: 7754005565347381640} + NextToggleClip: {fileID: 8300000, guid: 1c48900c9ab0aa8418920a8193050870, type: 3} --- !u!1 &3967834049323493430 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/QrPrizeInput.cs b/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/QrPrizeInput.cs index 3a5391e..4fd4b6d 100644 --- a/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/QrPrizeInput.cs +++ b/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/QrPrizeInput.cs @@ -4,7 +4,6 @@ using UnityEngine.UI; namespace PrizeSystem { - //TODO ïðèêëàìïèòü ðàíã íà ñòàðòå public class QrPrizeInput : AbstractPrizeConfigurator { @@ -12,12 +11,14 @@ namespace PrizeSystem [SerializeField] private TextMeshProUGUI rankLabel; [SerializeField] private QrTextInput textInput; - [SerializeField] private Color AccentColor; + [SerializeField] private AudioClip clickClip; + [SerializeField] private float SwipeInterval = 0.3f; private int rank = 1; private SelectedOption currentOption = SelectedOption.Rank; - + private float LastSwipe = 0; + private bool CanSwipe => Time.time - LastSwipe > SwipeInterval; private void OnEnable() { @@ -25,7 +26,7 @@ namespace PrizeSystem textInput.Light(Color.black); rankImage.color = AccentColor; - Display(); + DisplayRank(); } @@ -35,7 +36,7 @@ namespace PrizeSystem { rank = qr.Rank; textInput.SetText(qr.PrizeText); - Display(); + DisplayRank(); } } @@ -46,30 +47,40 @@ namespace PrizeSystem if (currentOption == SelectedOption.Rank) currentOption = SelectedOption.Text; else if ((currentOption == SelectedOption.Text)) currentOption = SelectedOption.Rank; + TryPlayClick(); + if (currentOption == SelectedOption.Rank) { + textInput.DisableAllSlots(); textInput.Light(Color.black); rankImage.color = AccentColor; - } - else if (currentOption == SelectedOption.Text) - { - textInput.Light(AccentColor); - rankImage.color = Color.black; - } - } - public override void Swipe(int direction) - { - if (currentOption == SelectedOption.Rank) - { - rank = Mathf.Clamp(rank + direction, 1, GameManager.instance.botsAmount); - Display(); } + else if (currentOption == SelectedOption.Text) + { + textInput.Light(AccentColor); + textInput.EnableFirstSlot(); + rankImage.color = Color.black; + } + } + public override void Swipe(int direction) + { + + if (currentOption == SelectedOption.Rank) + { + if(direction == 0) + { + LastSwipe = 0; + return; + } + SwipeRank(direction); + } + else if (currentOption == SelectedOption.Text) { int leftDirection = 0; - if (In.GetButtonDown(ButtonPinMapping.left1)) leftDirection -= 1; - if (In.GetButtonDown(ButtonPinMapping.right1)) leftDirection += 1; + if (In.GetButton(ButtonPinMapping.left1)) leftDirection -= 1; + if (In.GetButton(ButtonPinMapping.right1)) leftDirection += 1; int rightDirection = 0; if (In.GetButtonDown(ButtonPinMapping.left2)) rightDirection -= 1; @@ -80,16 +91,34 @@ namespace PrizeSystem textInput.SwitchSlot(rightDirection); } } + public override Prize GetPrize() => PrizeUtils.CreatePrize(rank, textInput.GetText()); public override void Tick() { } - private void Display() + private void DisplayRank() { rankLabel.text = rank.ToString(); - - //Òàê æå íóæíî äîï èíôó ïî ìåäàëÿì } + private void SwipeRank(int direction) + { + if(!CanSwipe) return; + + int resultRank = rank + direction; + if (resultRank >= 1 && resultRank <= GameManager.instance.botsAmount) + { + rank = resultRank; + TryPlayClick(); + DisplayRank(); + LastSwipe = Time.time; + } + } + + private void TryPlayClick() + { + if (clickClip != null) + SoundManager.instance.playClip(clickClip); + } enum SelectedOption { Rank, Text } } diff --git a/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/VitrinaPrizeInput.cs b/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/VitrinaPrizeInput.cs index 1a4cd5c..a9b71e6 100644 --- a/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/VitrinaPrizeInput.cs +++ b/Assets/Scripts/PrizeSystem/Config menu/Prize configurators/VitrinaPrizeInput.cs @@ -11,6 +11,7 @@ namespace PrizeSystem [SerializeField] private GameObject TogglePrefab; [SerializeField] RectTransform Pointer; + [SerializeField] private AudioClip NextToggleClip; private List toggles; private int index = 0; @@ -19,8 +20,11 @@ namespace PrizeSystem public override void ChangeOption(int direction) { + //òóò äîáàâèòü çâóê index = (index + 1 + BoxesCount) % BoxesCount; SetPointerToCurrentToggle(); + if(NextToggleClip != null) + SoundManager.instance.playClip(NextToggleClip); } public override void Configure(Prize prize) diff --git a/Assets/Scripts/PrizeSystem/GetFromVitrinaPanel/VitrinaPanel.cs b/Assets/Scripts/PrizeSystem/GetFromVitrinaPanel/VitrinaPanel.cs index c510787..afdc4e5 100644 --- a/Assets/Scripts/PrizeSystem/GetFromVitrinaPanel/VitrinaPanel.cs +++ b/Assets/Scripts/PrizeSystem/GetFromVitrinaPanel/VitrinaPanel.cs @@ -1,4 +1,4 @@ -using System.Collections; +using System; using System.Collections.Generic; using UnityEngine; @@ -6,6 +6,7 @@ public class VitrinaPanel : MonoBehaviour { private bool initialized = false; //çàïðîñèòü êîðîáêè, ïðîâåðèòü êàêèå òðåáóåòñÿ, íàéòè ïåðåñå÷åíèå. Åñëè íåò, òî âîçâðàò. + public event Action OnComplete; [SerializeField] private Transform BoxesRoot; [SerializeField] private GameObject BoxViewPrefab; @@ -20,11 +21,7 @@ public class VitrinaPanel : MonoBehaviour private void OnEnable() { - initialized = false; - - int[] boxes = { 1, 3, 5 }; - - Initialize(boxes); + initialized = false; } private void OnDisable() { @@ -34,6 +31,7 @@ public class VitrinaPanel : MonoBehaviour public void Initialize(int[] requiredBoxed) { + if (initialized) return; //òóò ïðîâåðêà ÷òî åñòü òàêèå êîðîáêè pointerIndex = 0; GenerateBoxes(requiredBoxed); @@ -67,7 +65,7 @@ public class VitrinaPanel : MonoBehaviour private void ClearBoxes() { foreach (var box in generatedBoxes) - Destroy(box); + Destroy(box.gameObject); generatedBoxes.Clear(); } @@ -75,14 +73,14 @@ public class VitrinaPanel : MonoBehaviour { if (!initialized) return; var input = CollectInputs(); - - if(input.direction != 0) + + if (input.direction != 0) { int count = generatedBoxes == null ? 0 : generatedBoxes.Count; //îòîáðàçèòü èçìåíåíèÿ CurrentBox.SetEnabled(false); - CurrentBox.shake =false; + CurrentBox.shake = false; timer = 0; pointerIndex = (pointerIndex + input.direction + count) % count; @@ -104,8 +102,11 @@ public class VitrinaPanel : MonoBehaviour if (timer >= timeToAct) { - Debug.Log("Äåéñòâèå"); + _ = PrizeStandController.OpenBoxAsync(pointerIndex + 1); timer = 0; + + OnComplete?.Invoke(); + gameObject.SetActive(false); } } diff --git a/Assets/Scripts/PrizeSystem/PrizeSerializer.cs b/Assets/Scripts/PrizeSystem/PrizeSerializer.cs index 5e2a59e..50da128 100644 --- a/Assets/Scripts/PrizeSystem/PrizeSerializer.cs +++ b/Assets/Scripts/PrizeSystem/PrizeSerializer.cs @@ -14,34 +14,36 @@ namespace PrizeSystem static string FILE_PATH => Path.Combine(Application.persistentDataPath, CHARACTERS_PRIZES); static int CharactersAmount => GameManager.instance.botsAmount; - private static List cachedPrizes; + public static List LoadPrizes() { - if (cachedPrizes != null) - return cachedPrizes; + if (PrizeSystemManager.cachedPrizes != null) + return PrizeSystemManager.cachedPrizes; + List prizes; try { if (File.Exists(FILE_PATH)) { string fileString = File.ReadAllText(FILE_PATH); - cachedPrizes = DeserializePrizes(fileString); + prizes = DeserializePrizes(fileString); } else { Debug.Log($"Файл {FILE_PATH} не найден, Ñ�оздаю Ñ� призами по умолчанию"); - cachedPrizes = GetDefaultPrizes(); - SavePrizes(cachedPrizes); + prizes = GetDefaultPrizes(); + SavePrizes(prizes); } } catch (Exception e) { Debug.LogError($"Ошибка загрузки призов: {e.Message}"); - cachedPrizes = GetDefaultPrizes(); + prizes = GetDefaultPrizes(); } - return cachedPrizes; + PrizeSystemManager.SetPrizesCache(prizes); + return prizes; } /// @@ -53,6 +55,7 @@ namespace PrizeSystem string serialized = SerializePrizes(prizes); Debug.Log($"serialized: {serialized}"); File.WriteAllText(FILE_PATH, serialized); + PrizeSystemManager.SetPrizesCache(prizes); } @@ -76,7 +79,7 @@ namespace PrizeSystem public static List DeserializePrizes(string serialized) { List prizes = new(); - + string[] lines = serialized.Split('\n'); if (lines.Length != CharactersAmount) { @@ -99,11 +102,11 @@ namespace PrizeSystem { string stripped = line.Substring("Qr:".Length); string[] entries = stripped.Split(','); - + int rank = int.Parse(entries[0]); string text = entries[1]; - prizes.Add(PrizeUtils.CreatePrize(rank,text)); + prizes.Add(PrizeUtils.CreatePrize(rank, text)); } else {//Ñ�читаемый приз diff --git a/Assets/Scripts/PrizeSystem/PrizeSystemManager.cs b/Assets/Scripts/PrizeSystem/PrizeSystemManager.cs index c2ef818..e63ba40 100644 --- a/Assets/Scripts/PrizeSystem/PrizeSystemManager.cs +++ b/Assets/Scripts/PrizeSystem/PrizeSystemManager.cs @@ -1,4 +1,5 @@ -using System.Collections; +using System; +using System.Collections; using System.Collections.Generic; using System.Text; using UnityEngine; @@ -32,13 +33,16 @@ namespace PrizeSystem public static string SpecialPrizeCounter = "SpecialCounter"; + public static event Action> PrizesChanged; + private static PrizeSystemManager instance; private static bool prizing = false; + public static List cachedPrizes { get; private set; } //ПропиÑ�ать тут очереди. private static Queue qrPrizes; private static Queue vitrinaPrizes; - + public static bool HasQrPrizeToGive => qrPrizes.Count > 0; public static bool HasVitrinaPrizeToGive => vitrinaPrizes.Count > 0; @@ -59,6 +63,11 @@ namespace PrizeSystem public static VitrinaPrize DequeueVitrinaPrize() => HasVitrinaPrizeToGive ? vitrinaPrizes.Dequeue() : null; + public static void SetPrizesCache(List prizes) + { + cachedPrizes = prizes; + PrizesChanged?.Invoke(prizes); + } public static void GivePrize(Prize prize) { if (prize == null) @@ -67,9 +76,9 @@ namespace PrizeSystem } //ЕÑ�ли призы отключены в принципе, то не выдаем. bool prizingEnabled = SettingsManager.GetBool("Prizing", false); - if (!prizingEnabled) return; + if (!prizingEnabled) return; + - Debug.Log($"ПоÑ�тупил заказ приз: {prize.Body}"); @@ -87,7 +96,7 @@ namespace PrizeSystem { vitrinaPrizes.Enqueue(vitrinaPrize); } - else if(prize is QrPrize qrPrize) + else if (prize is QrPrize qrPrize) { qrPrizes.Enqueue(qrPrize); } @@ -99,10 +108,10 @@ namespace PrizeSystem private string StopHopperCommand => ComWrapper.BoardVersion switch { 1 => "302", 2 => "300", _ => "302" }; private IEnumerator PrizingProcess(int amount, CountablePrizeType Type) { - if (prizing) - { + if (prizing) + { Debug.LogError("Уже идет выдача приза. ПовторнаÑ� выдача отключена"); - yield break; + yield break; } prizing = true; @@ -117,7 +126,7 @@ namespace PrizeSystem float timeout = 10; - + Debug.Log($"Включаю мотор хоппера: {StartHopperCommand}"); ComWrapper.Send(StartHopperCommand);//включаем мотор @@ -138,7 +147,7 @@ namespace PrizeSystem } //Выключаем мотор - + Debug.Log($"Выключаю мотор: {StopHopperCommand}"); ComWrapper.Send(StopHopperCommand); Debug.Log("Закончил. УÑ�пех: " + success); @@ -234,7 +243,7 @@ namespace PrizeSystem if (!SoundNotification) return; if (PrizeNotificationSounds == null || PrizeNotificationSounds.Count == 0) return; - int random = Random.Range(0, PrizeNotificationSounds.Count); + int random = UnityEngine.Random.Range(0, PrizeNotificationSounds.Count); AudioClip notification = PrizeNotificationSounds[random]; SoundManager.instance.playClip(notification); } diff --git a/Assets/Scripts/PrizeSystem/QrPanel.cs b/Assets/Scripts/PrizeSystem/QrPanel.cs new file mode 100644 index 0000000..a0f03ea --- /dev/null +++ b/Assets/Scripts/PrizeSystem/QrPanel.cs @@ -0,0 +1,99 @@ +using PrizeSystem; +using System; +using TMPro; +using UnityEngine; +using UnityEngine.UI; + +public class QrPanel : MonoBehaviour +{ + private bool initialized = false; + public event Action OnComplete; + + [SerializeField] private Image QrImage; + [SerializeField] private TextMeshProUGUI Label; + + [SerializeField] private float timer = 0; + private float timeToAct = 3; + + private void OnEnable() + { + initialized = false; + } + private void OnDisable() + { + initialized = false; + Clear(); + } + + public void Initialize(Prize prize) + { + if (initialized) return; + + if (prize is QrPrize qrPrize) + { + string message = $"Çäðàâñòâóéòå! ß ïîáåäèë íà àïïàðàòå {PlayerPrefs.GetString("Serial")}. Æäó ïðèç!" + + $" Äàòà âûèãðûøà: {DateTime.Now:dd.MM.yyyy HH:mm}. " + + $"Ïðèç: {qrPrize.PrizeText}"; + + + message = workOnSuffix(message); + + + message = "https://t.me/+" + PlayerPrefs.GetString("Number")+"?text=" + message; + + var tex = QrMaker.MakeTexture(message, 1, drawQuietZones: true); + tex.filterMode = FilterMode.Point; + var sprite = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(0.5f, 0.5f)); + QrImage.sprite = sprite; + Label.text = $"Âàø âûèãðûø: {qrPrize.PrizeText}"; + } + else + { + OnComplete?.Invoke(); + } + initialized = true; + } + private void Clear() + { + + } + + private void Update() + { + if (!initialized) return; + var input = CollectInputs(); + + if (input) + { + timer = Mathf.Clamp(timer + Time.deltaTime, 0, timeToAct); + } + else + { + timer = 0; + } + + + if (timer >= timeToAct) + { + OnComplete?.Invoke(); + gameObject.SetActive(false); + } + } + + bool CollectInputs() + { + bool action = In.GetButtonAnyPlayer(PlayerAction.left); + return action; + } + + string workOnSuffix(string suffix) + { + suffix = suffix.Replace("%", "%25") + .Replace("?", "%3F") + .Replace(" ", "%20") + .Replace("!", "%21") + .Replace("\"", "%22"); + return suffix; + } + +} diff --git a/Assets/Scripts/PrizeSystem/QrPanel.cs.meta b/Assets/Scripts/PrizeSystem/QrPanel.cs.meta new file mode 100644 index 0000000..0f24487 --- /dev/null +++ b/Assets/Scripts/PrizeSystem/QrPanel.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 421d421d64446204498c3d34dc5965e2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/QrMaker.cs b/Assets/Scripts/QrMaker.cs index 85a5cc7..76d1bb9 100644 --- a/Assets/Scripts/QrMaker.cs +++ b/Assets/Scripts/QrMaker.cs @@ -20,15 +20,5 @@ public static class QrMaker tex.Apply(false, false); return tex; } -/* - // Сохранить как PNG-файл - public static string SavePng(string text, string filePath, int ppm = 8) - { - using var gen = new QRCodeGenerator(); - using var data = gen.CreateQrCode(text, QRCodeGenerator.ECCLevel.M); - var png = new PngByteQRCode(data); - byte[] bytes = png.GetGraphic(ppm, "#000000", "#FFFFFF", true); - File.WriteAllBytes(filePath, bytes); - return filePath; - }*/ + } diff --git a/Assets/Scripts/SpecialPrizeToggler.cs b/Assets/Scripts/SpecialPrizeToggler.cs index 3f926a9..1f04252 100644 --- a/Assets/Scripts/SpecialPrizeToggler.cs +++ b/Assets/Scripts/SpecialPrizeToggler.cs @@ -1,6 +1,7 @@ using PrizeSystem; using System.Collections; using System.Collections.Generic; +using TMPro; using UnityEngine; using UnityEngine.UI; @@ -12,29 +13,66 @@ public class SpecialPrizeToggler : MonoBehaviour [SerializeField] Color enabledColor; [SerializeField] Color disabledColor; - private void OnEnable() => StartCoroutine(Check()); + [SerializeField] private TextMeshProUGUI PrizeText; - private void OnDisable() => StopAllCoroutines(); + private void OnEnable() => PrizeSystemManager.PrizesChanged += Refresh; + + private void OnDisable() => PrizeSystemManager.PrizesChanged -= Refresh; - IEnumerator Check() + private void Refresh(List prizes) { - while (true) + var qrPrizes = CollectQrPrizes(prizes); + + if (NeedToDisplay(qrPrizes)) { - SetVisibilityBySettings(); - yield return new WaitForSeconds(5); + PrizeText.text = GetMostRankedPrize(qrPrizes).PrizeText; + SetColorToGraphics(enabledColor); + + } + else + { + SetColorToGraphics(disabledColor); } } - void SetVisibilityBySettings() + List CollectQrPrizes(List prizes) { - bool visibility = PrizeSerializer.LoadPrizes()[^1].PrizeType == PrizeType.Qr; - - Color color = visibility ? enabledColor : disabledColor; + List qrPrizes = new(); + foreach (Prize prize in prizes) + if (prize is QrPrize qr) + qrPrizes.Add(qr); + return qrPrizes; + } + private bool NeedToDisplay(List qrPrizes) + { + if(!SettingsManager.GetBool("Prizing", false)) return false; + if(qrPrizes.Count == 0) return false; + return true; + } + private void SetColorToGraphics(Color color) + { foreach(var g in graphics) - { g.color = color; - } } + + public QrPrize GetMostRankedPrize(List qrPrizes) + { + if (qrPrizes == null || qrPrizes.Count == 0) + return null; + + QrPrize maxPrize = qrPrizes[0]; + + for (int i = 1; i < qrPrizes.Count; i++) + { + if (qrPrizes[i].Rank >= maxPrize.Rank) + { + maxPrize = qrPrizes[i]; + } + } + + return maxPrize; + } + } diff --git a/Assets/Sounds/Щелчек-удар.mp3 b/Assets/Sounds/Click.mp3 similarity index 100% rename from Assets/Sounds/Щелчек-удар.mp3 rename to Assets/Sounds/Click.mp3 diff --git a/Assets/Sounds/Щелчек-удар.mp3.meta b/Assets/Sounds/Click.mp3.meta similarity index 100% rename from Assets/Sounds/Щелчек-удар.mp3.meta rename to Assets/Sounds/Click.mp3.meta