From 454fa98da528cd4a152474840419bc67b8e3218e Mon Sep 17 00:00:00 2001 From: _sega Date: Mon, 26 Jan 2026 13:00:02 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20=D1=81=D0=B8=D1=81=D1=82=D0=B5=D0=BC=D1=83=20=D0=B2?= =?UTF-8?q?=D1=81=D0=BF=D0=BB=D1=8B=D0=B2=D0=B0=D1=8E=D1=89=D0=B8=D1=85=20?= =?UTF-8?q?=D1=83=D0=B2=D0=B5=D0=B4=D0=BE=D0=BC=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Реализована система уведомлений. Внедрены уведомления на попытку зайти в игру когда не хватает денег на балансе и на момент, когда приз выдан --- Assets/Fonts/NEW/NexaRegular COOL.asset | 2 +- Assets/Scenes/GameScene3D.unity | 613 +++++++++++++++++- Assets/Scripts/GameManager.cs | 23 +- Assets/Scripts/Notifications.meta | 8 + Assets/Scripts/Notifications/Notification.cs | 12 + .../Notifications/Notification.cs.meta | 11 + .../Notifications/NotificationSystem.cs | 172 +++++ .../Notifications/NotificationSystem.cs.meta | 11 + Assets/Scripts/PrizeSystem/PrizeSystem.cs | 8 +- .../Scripts/ScriptAnimations/ScalePingPong.cs | 6 +- Assets/Scripts/SoundManager.cs | 4 +- 11 files changed, 861 insertions(+), 9 deletions(-) create mode 100644 Assets/Scripts/Notifications.meta create mode 100644 Assets/Scripts/Notifications/Notification.cs create mode 100644 Assets/Scripts/Notifications/Notification.cs.meta create mode 100644 Assets/Scripts/Notifications/NotificationSystem.cs create mode 100644 Assets/Scripts/Notifications/NotificationSystem.cs.meta diff --git a/Assets/Fonts/NEW/NexaRegular COOL.asset b/Assets/Fonts/NEW/NexaRegular COOL.asset index f656e1f..3927faa 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.31421307, b: 0, a: 1} + - _GlowColor: {r: 1, g: 0, b: 0.38410234, 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 8919888..91478d5 100644 --- a/Assets/Scenes/GameScene3D.unity +++ b/Assets/Scenes/GameScene3D.unity @@ -5986,6 +5986,7 @@ GameObject: - component: {fileID: 259182290} - component: {fileID: 259182291} - component: {fileID: 259182292} + - component: {fileID: 259182293} m_Layer: 0 m_Name: '[GAME MANAGER]' m_TagString: Untagged @@ -6083,6 +6084,7 @@ MonoBehaviour: movesAndTimeCounter: {fileID: 1039507332} setPasswordPanel: {fileID: 131572818} enterPasswordPanel: {fileID: 403995020} + soundManager: {fileID: 151433694} --- !u!4 &259182280 Transform: m_ObjectHideFlags: 0 @@ -6212,6 +6214,14 @@ MonoBehaviour: - {fileID: 8300000, guid: 1347f6385fc35fe4882304613a9fbfe9, type: 3} - {fileID: 8300000, guid: 2e6426be1392aea48936249e22b54e1f, type: 3} - {fileID: 8300000, guid: d38913d907d5e4244b25d6170a38686f, type: 3} + prizeNotification: + Title: "\u041F\u0420\u0418\u0417!" + Message: "\u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u043E\u043A\u043E\u0448\u043A\u043E + \u0432\u044B\u0434\u0430\u0447\u0438" + Image: {fileID: 899680085, guid: 8b52ebc6fd45dde49a9cd603177ac97a, type: 3} + ImagePosition: {x: -172.5, y: 9.9} + ImageSize: 445 + audioClip: {fileID: 8300000, guid: 7fb340d179cafc04cb2e4baa2ddde96f, type: 3} --- !u!114 &259182291 MonoBehaviour: m_ObjectHideFlags: 0 @@ -6242,6 +6252,25 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 1331a40789493ab488ebc7f5b640537e, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!114 &259182293 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 259182278} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2f8fd49a56e180740a0c55c3c91f5ebb, type: 3} + m_Name: + m_EditorClassIdentifier: + appearTime: 0.2 + standTime: 2 + disappearTime: 1 + NotificationContainer: {fileID: 1967870043} + Title: {fileID: 1645472013} + Message: {fileID: 2109370311} + Image: {fileID: 1683726654} --- !u!4 &266844764 stripped Transform: m_CorrespondingSourceObject: {fileID: 8226333462285045748, guid: db23caa1fa265364da1d9d9233646a06, type: 3} @@ -8473,6 +8502,108 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 409849878} m_CullTransparentMesh: 1 +--- !u!1 &411367483 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 411367487} + - component: {fileID: 411367486} + - component: {fileID: 411367485} + - component: {fileID: 411367484} + m_Layer: 5 + m_Name: '[Notifications CANVAS]' + m_TagString: Untagged + m_Icon: {fileID: 0} + 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 + 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: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 1 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!223 &411367486 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 411367483} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 1 + m_Camera: {fileID: 519420031} + m_PlaneDistance: 14 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_VertexColorAlwaysGammaSpace: 0 + m_AdditionalShaderChannelsFlag: 25 + m_UpdateRectTransformForStandalone: 0 + m_SortingLayerID: -2009484265 + m_SortingOrder: 3 + m_TargetDisplay: 0 +--- !u!224 &411367487 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 411367483} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1967870043} + m_Father: {fileID: 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: 0} + m_Pivot: {x: 0, y: 0} --- !u!1 &415567004 GameObject: m_ObjectHideFlags: 0 @@ -27649,6 +27780,13 @@ MonoBehaviour: execAlways: 1 amplitude: 0.2 speed: 0.5 + notification: + Title: + Message: + Image: {fileID: 0} + ImagePosition: {x: 0, y: 0} + ImageSize: 0 + audioClip: {fileID: 0} --- !u!1 &1044348555 GameObject: m_ObjectHideFlags: 0 @@ -33115,6 +33253,14 @@ MonoBehaviour: execAlways: 0 amplitude: 0.3 speed: 4 + notification: + Title: "\u041D\u0435\u0434\u043E\u0441\u0442\u0430\u0442\u043E\u0447\u043D\u043E + \u043C\u043E\u043D\u0435\u0442!" + Message: "\u041F\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435 \u0431\u0430\u043B\u0430\u043D\u0441" + Image: {fileID: 899680085, guid: 8b52ebc6fd45dde49a9cd603177ac97a, type: 3} + ImagePosition: {x: -172.5, y: 9.9} + ImageSize: 445 + audioClip: {fileID: 8300000, guid: eb50ade20b1f1fa44937e7d6ae2193a3, type: 3} --- !u!1 &1079625008 GameObject: m_ObjectHideFlags: 0 @@ -47248,6 +47394,84 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1526334220} m_CullTransparentMesh: 1 +--- !u!1 &1537329324 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1537329325} + - component: {fileID: 1537329327} + - component: {fileID: 1537329326} + m_Layer: 5 + m_Name: Panel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1537329325 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1537329324} + 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: 1683726653} + - {fileID: 1645472012} + - {fileID: 2109370310} + m_Father: {fileID: 1967870043} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -61.22998, y: -5} + m_SizeDelta: {x: -122.46, y: -90.59} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1537329326 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1537329324} + 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: 0.5, 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: 1744797893, guid: 93e5f9833bed0474cb1481410d00191c, 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 &1537329327 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1537329324} + m_CullTransparentMesh: 1 --- !u!1 &1542626843 GameObject: m_ObjectHideFlags: 0 @@ -47281,8 +47505,8 @@ MonoBehaviour: charactersContainer: {fileID: 365101956} charactersPool: {fileID: 963346424} characterPrefabs: - - {fileID: 2262463401082199893, guid: dbde6acf97979cd4caaca68f83b75d64, type: 3} - {fileID: 2262463401082199893, guid: 280922cd1d9e3ef44bdbfe757f8cfdef, type: 3} + - {fileID: 2262463401082199893, guid: dbde6acf97979cd4caaca68f83b75d64, type: 3} - {fileID: 2262463401082199893, guid: b1bd71cccf32b4c4a94b2ff65361e9fe, type: 3} - {fileID: 2262463401082199893, guid: 8813a05b560fe74499373105c065d482, type: 3} - {fileID: 2262463401082199893, guid: 4b7845a03cf955e4488f4e3286f11b60, type: 3} @@ -49604,6 +49828,140 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1645215480} m_CullTransparentMesh: 1 +--- !u!1 &1645472011 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1645472012} + - component: {fileID: 1645472014} + - component: {fileID: 1645472013} + m_Layer: 5 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1645472012 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1645472011} + 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: 1537329325} + 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: 80, y: 50} + m_SizeDelta: {x: 300, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1645472013 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1645472011} + 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: New 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: 28 + m_fontSizeBase: 28 + 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 &1645472014 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1645472011} + m_CullTransparentMesh: 1 --- !u!1 &1654348138 GameObject: m_ObjectHideFlags: 0 @@ -49792,6 +50150,81 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1681646674} m_CullTransparentMesh: 1 +--- !u!1 &1683726652 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1683726653} + - component: {fileID: 1683726655} + - component: {fileID: 1683726654} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1683726653 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1683726652} + 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: 1537329325} + 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: -156.41, y: 0} + m_SizeDelta: {x: 163.22, y: 150} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1683726654 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1683726652} + 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 &1683726655 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1683726652} + m_CullTransparentMesh: 1 --- !u!1 &1690211352 GameObject: m_ObjectHideFlags: 0 @@ -55153,6 +55586,13 @@ MonoBehaviour: execAlways: 0 amplitude: 0.3 speed: 4 + notification: + Title: + Message: + Image: {fileID: 0} + ImagePosition: {x: 0, y: 0} + ImageSize: 0 + audioClip: {fileID: 0} --- !u!114 &1944123995 MonoBehaviour: m_ObjectHideFlags: 0 @@ -55896,6 +56336,42 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1966252368} m_CullTransparentMesh: 1 +--- !u!1 &1967870042 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1967870043} + m_Layer: 5 + m_Name: Notifications Container + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1967870043 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1967870042} + 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: 1537329325} + m_Father: {fileID: 411367487} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 633.78, y: 298.55} + m_Pivot: {x: 1, y: 1} --- !u!1 &1977743967 GameObject: m_ObjectHideFlags: 0 @@ -59313,6 +59789,140 @@ AudioSource: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 +--- !u!1 &2109370309 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2109370310} + - component: {fileID: 2109370312} + - component: {fileID: 2109370311} + m_Layer: 5 + m_Name: Message + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2109370310 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2109370309} + 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: 1537329325} + 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: 80, y: -33.1} + m_SizeDelta: {x: 300, y: 106.2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &2109370311 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2109370309} + 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: New 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: 22 + m_fontSizeBase: 22 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 16 + m_fontSizeMax: 64 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + 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 &2109370312 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2109370309} + m_CullTransparentMesh: 1 --- !u!1 &2110447607 GameObject: m_ObjectHideFlags: 0 @@ -71671,6 +72281,7 @@ SceneRoots: - {fileID: 1551328425} - {fileID: 446139684} - {fileID: 1122363135} + - {fileID: 411367487} - {fileID: 1542626845} - {fileID: 1851050357} - {fileID: 876915628} diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 8cfabbe..dec39d5 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -427,6 +427,8 @@ public class GameManager : MonoBehaviour public GameObject setPasswordPanel; public EnterPasswordPanel enterPasswordPanel; + public SoundManager soundManager; + void Awake() { Cursor.lockState = CursorLockMode.Locked; @@ -447,11 +449,14 @@ public class GameManager : MonoBehaviour SettingsManager.Initialize(); GetComponent().Initialize(); - //botsAmount = ExternalFilesGetter.GetBotsCountFromHash(); + GetComponent().Initialize(); ComWrapper.onPulseRecieved.AddListener(ProcessDifficultyCounter); SettingsManager.OnSettingsChanged.AddListener(ProcessDifficultyCounter); + soundManager.Initialize(); + GetComponent().Initialize(); + ProcessDifficultyCounter(); GetComponent().Initialize(); @@ -504,7 +509,21 @@ public class GameManager : MonoBehaviour SetupCoinPanel(); } - + +#if UNITY_EDITOR + private void Update() + { + if (Input.GetKeyDown(KeyCode.G)) + { + PrizeSystem.GivePrize(new Prize(PrizeType.Hopper, 1)); + } + if (Input.GetKeyDown(KeyCode.O)) + { + PlayerPrefs.SetInt("PrizeGivenBuffer", 1); + } + } +#endif + public void SetupCoinPanel() { diff --git a/Assets/Scripts/Notifications.meta b/Assets/Scripts/Notifications.meta new file mode 100644 index 0000000..043f7ff --- /dev/null +++ b/Assets/Scripts/Notifications.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2ea9d110a11b1634b8c9ba93a7d34b65 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Notifications/Notification.cs b/Assets/Scripts/Notifications/Notification.cs new file mode 100644 index 0000000..ee79309 --- /dev/null +++ b/Assets/Scripts/Notifications/Notification.cs @@ -0,0 +1,12 @@ +using UnityEngine; + +[System.Serializable] +public class Notification +{ + public string Title; + public string Message; + public Sprite Image; + public Vector2 ImagePosition; + public float ImageSize; + public AudioClip audioClip; +} diff --git a/Assets/Scripts/Notifications/Notification.cs.meta b/Assets/Scripts/Notifications/Notification.cs.meta new file mode 100644 index 0000000..d62885c --- /dev/null +++ b/Assets/Scripts/Notifications/Notification.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f2767e38f36d81248afaf89131437b7a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Notifications/NotificationSystem.cs b/Assets/Scripts/Notifications/NotificationSystem.cs new file mode 100644 index 0000000..7a3f069 --- /dev/null +++ b/Assets/Scripts/Notifications/NotificationSystem.cs @@ -0,0 +1,172 @@ +using System.Collections; +using System.Text; +using TMPro; +using UnityEngine; +using UnityEngine.Playables; +using UnityEngine.UI; + +//Нужно инициализировать +//Зависит от саунд менеджера. В порядке инициализации должен быть ниже. +public class NotificationSystem : MonoBehaviour +{ + public static NotificationSystem instance; + + [Header("Анимация вывода уведомления")] + [SerializeField] private float appearTime = 1; + [SerializeField] private float standTime = 3; + [SerializeField] private float disappearTime = 1; + + [SerializeField] private RectTransform NotificationContainer; + [SerializeField] private TextMeshProUGUI Title; + [SerializeField] private TextMeshProUGUI Message; + [SerializeField] private Image Image; + + + private StringBuilder errors; + private bool notificationProcessing; + public void Initialize() + { + instance = this; + errors = new StringBuilder(); + notificationProcessing = false; + + CheckLinks(); + } + + public void Notificate(Notification notification) + { + if (notificationProcessing) return; + if (!CheckNotification(notification)) return; + + + FillNotificationCard(notification); + StartCoroutine(ShowNotificationProcess(notification)); + + } + + private bool CheckLinks() + { + bool hasNull = false; + errors.Clear(); + + if(NotificationContainer == null) + { + hasNull = true; + errors.AppendLine("Не указан контейнер."); + } + if (Title == null) + { + hasNull = true; + errors.AppendLine("Не указано поле заголовка."); + } + if (Message == null) + { + hasNull = true; + errors.AppendLine("Не указано поле сообщения."); + } + if (Image == null) + { + hasNull = true; + errors.AppendLine("Не указано поле картинки."); + } + + if (hasNull) + { + Debug.LogWarning($"Пустые ссылки в системе уведовлений:\n{errors}"); + return false; + } + return true; + } + + private bool CheckNotification(Notification notification) + { + if (notification == null) + { + Debug.LogWarning($"Система уведомлений: Полученное уведомление null."); + return false; + } + + errors.Clear(); + bool hasErrors = false; + + if (string.IsNullOrEmpty(notification.Title)) + { + hasErrors = true; + errors.AppendLine($"В уведомлении не указан заголовок"); + } + if (string.IsNullOrEmpty(notification.Message)) + { + hasErrors = true; + errors.AppendLine($"В уведомлении не указано сообщение"); + } + if (notification.Image == null) + { + hasErrors = true; + errors.AppendLine($"В уведомлении Image = null"); + } + if (notification.audioClip == null) + { + hasErrors = true; + errors.AppendLine($"В уведомлении AudioClip = null"); + } + + + if (hasErrors) + { + Debug.LogWarning($"Ошибки в уведомлении:\n{errors}"); + return false; + } + return true; + } + + private void FillNotificationCard(Notification notification) + { + Title.text = notification.Title; + Message.text = notification.Message; + Image.sprite = notification.Image; + Image.rectTransform.sizeDelta = Vector2.one * notification.ImageSize; + Image.rectTransform.anchoredPosition = notification.ImagePosition; + + } + + + IEnumerator ShowNotificationProcess(Notification notification) + { + notificationProcessing = true; + float t; + float containerHeight = NotificationContainer.sizeDelta.y; + //#ВЫДВИНУТЬ ВВЕРХ + t = 0; + while (t < 1) + { + t += Time.deltaTime / appearTime; + t = Mathf.Clamp01(t); + + NotificationContainer.anchoredPosition = Vector2.Lerp(Vector2.zero, Vector2.up*containerHeight, t); + + yield return null; + } + + //подождать + SoundManager.instance.playClip(notification.audioClip); + yield return new WaitForSeconds(standTime); + + //#ЗАДВИНУТЬ ВНИЗ + t = 0; + while (t < 1) + { + t += Time.deltaTime / disappearTime; + t = Mathf.Clamp01(t); + + NotificationContainer.anchoredPosition = Vector2.Lerp(Vector2.up * containerHeight, Vector2.zero, t); + + yield return null; + } + + notificationProcessing = false; + } + + + + +} diff --git a/Assets/Scripts/Notifications/NotificationSystem.cs.meta b/Assets/Scripts/Notifications/NotificationSystem.cs.meta new file mode 100644 index 0000000..556d099 --- /dev/null +++ b/Assets/Scripts/Notifications/NotificationSystem.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2f8fd49a56e180740a0c55c3c91f5ebb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/PrizeSystem/PrizeSystem.cs b/Assets/Scripts/PrizeSystem/PrizeSystem.cs index 19c7663..4d23cb5 100644 --- a/Assets/Scripts/PrizeSystem/PrizeSystem.cs +++ b/Assets/Scripts/PrizeSystem/PrizeSystem.cs @@ -15,6 +15,8 @@ public class PrizeSystem : MonoBehaviour [SerializeField] bool SoundNotification = true; [SerializeField] List PrizeNotificationSounds; + [SerializeField] Notification prizeNotification; + public static string key_starts = "STARTS"; public static string key_startsNul = "STARTSNUL"; public static string key_prizesgiven = "PRIZESGIVEN"; @@ -124,7 +126,11 @@ public class PrizeSystem : MonoBehaviour SoundManager.instance.playClip(prizeErrorSound); } } - if (atLeastOnePrize) SoundNotificationIfNeeds(); + if (atLeastOnePrize) + { + NotificationSystem.instance.Notificate(prizeNotification); + SoundNotificationIfNeeds(); + } } diff --git a/Assets/Scripts/ScriptAnimations/ScalePingPong.cs b/Assets/Scripts/ScriptAnimations/ScalePingPong.cs index 61c4722..585926a 100644 --- a/Assets/Scripts/ScriptAnimations/ScalePingPong.cs +++ b/Assets/Scripts/ScriptAnimations/ScalePingPong.cs @@ -1,11 +1,12 @@ -using System.Collections; -using System.Collections.Generic; +using System.Collections; using UnityEngine; public class ScalePingPong : MonoBehaviour { public bool execAlways; public float amplitude = 0.2f, speed = 8; + + [SerializeField] Notification notification; void Start() { GameManager.instance.OnNoMoney.AddListener(exec); @@ -21,6 +22,7 @@ public class ScalePingPong : MonoBehaviour public void exec() { //transform.localScale = Vector3.one * (1- Mathf.PingPong(Time.time*speed, amplitude)); + NotificationSystem.instance.Notificate(notification); StartCoroutine(animate()); } diff --git a/Assets/Scripts/SoundManager.cs b/Assets/Scripts/SoundManager.cs index 8036337..06de228 100644 --- a/Assets/Scripts/SoundManager.cs +++ b/Assets/Scripts/SoundManager.cs @@ -1,7 +1,7 @@ using System.Collections; -using Unity.VisualScripting; using UnityEngine; +//зависит от ComWrapper, SettingsManager public class SoundManager : MonoBehaviour { public static SoundManager instance; @@ -39,7 +39,7 @@ public class SoundManager : MonoBehaviour private int poolIndex = 0; - private void Awake() + public void Initialize() { if (instance == null) {