refactor: LevelFinish — выдача приза и показ QR разделены

- Добавлен LevelFinish.cs: новый компонент финиша уровня
  - выдача маленького приза через PrizeSystemManager (учитывает enableHopper)
  - настройки: enablePrizeOnFinish, prizeEnabledSettingKey, prizeDelay, debugMode
  - защита от двойной выдачи (_prizeGiven)
- PlayerController: закомментирован старый переход на следующий уровень по тегу 'Finish'
  (теперь за это отвечает LevelFinish)
- QRCodeUIController: помечен [Obsolete], QR-коды показываются только при победе
  через WinBannerController.ShowWin() -> PrizeSystemManager.GetQRCodes()
- Finish.prefab: добавлен компонент LevelFinish (enablePrizeOnFinish=true, prizeDelay=0)
- Сцена 1-1: переопределён enablePrizeOnFinish=false для финиша промежуточного уровня
- Сцена 1-3: minor update
- MainMenu: правки якорей UI-элементов и активация скрытого объекта
This commit is contained in:
Данил Ярош 2026-02-19 15:15:16 +03:00
parent 6a4c23c154
commit 301e4be47d
26 changed files with 268 additions and 403 deletions

1
.gitignore vendored
View File

@ -39,6 +39,7 @@
/[Aa]ssets/Plugins/Editor/JetBrains*
# Jetbrains Rider personal-layer settings
*.DotSettings.user
.idea/
# Visual Studio cache directory
.vs/

View File

@ -1,13 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/contentModel.xml
/modules.xml
/.idea.Mario-like platformer.iml
/projectSettingsUpdater.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@ -1,31 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="BetterCommentsSettings">
<option name="initialized" value="true" />
<option name="tags">
<list>
<CustomTag>
<option name="color" value="#FF2D00" />
<option name="type" value="!" />
</CustomTag>
<CustomTag>
<option name="color" value="#3498DB" />
<option name="type" value="?" />
</CustomTag>
<CustomTag>
<option name="color" value="#474747" />
<option name="hasStrikethrough" value="true" />
<option name="type" value="//" />
</CustomTag>
<CustomTag>
<option name="color" value="#FF8C00" />
<option name="type" value="todo" />
</CustomTag>
<CustomTag>
<option name="color" value="#98C379" />
<option name="type" value="*" />
</CustomTag>
</list>
</option>
</component>
</project>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AgentMigrationStateService">
<option name="migrationStatus" value="COMPLETED" />
</component>
</project>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AskMigrationStateService">
<option name="migrationStatus" value="COMPLETED" />
</component>
</project>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Ask2AgentMigrationStateService">
<option name="migrationStatus" value="COMPLETED" />
</component>
</project>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EditMigrationStateService">
<option name="migrationStatus" value="COMPLETED" />
</component>
</project>

View File

@ -1,9 +0,0 @@
<component name="ProjectDictionaryState">
<dictionary name="project">
<words>
<w>danro</w>
<w>event'ов</w>
<w>renderer'ы</w>
</words>
</dictionary>
</component>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>

View File

@ -1,6 +0,0 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="TypeScriptLibrary" enabled="true" level="ERROR" enabled_by_default="true" />
</profile>
</component>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@ -1,13 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/modules.xml
/contentModel.xml
/projectSettingsUpdater.xml
/.idea.mario-like-platformer.iml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@ -10,6 +10,7 @@ GameObject:
m_Component:
- component: {fileID: 2891592954758516483}
- component: {fileID: 7130742420782404580}
- component: {fileID: 4213635907731438243}
m_Layer: 0
m_Name: Finish
m_TagString: Finish
@ -79,6 +80,22 @@ BoxCollider2D:
m_AutoTiling: 0
m_Size: {x: 3, y: 3.6736777}
m_EdgeRadius: 0
--- !u!114 &4213635907731438243
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3013926927394175097}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 83fb48e020004ca49f4eaa1a518e86f0, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::RR.Game2D.Behaviour.LevelFinish
enablePrizeOnFinish: 1
prizeEnabledSettingKey: prizes.giveSmallPrize
prizeDelay: 0
debugMode: 1
--- !u!1 &8980021347057983684
GameObject:
m_ObjectHideFlags: 0

View File

@ -82347,6 +82347,10 @@ PrefabInstance:
propertyPath: m_Name
value: Finish
objectReference: {fileID: 0}
- target: {fileID: 4213635907731438243, guid: 70235a41586931d41996f4a80dd71752, type: 3}
propertyPath: enablePrizeOnFinish
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
@ -84254,7 +84258,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4799275495668483708, guid: 86af44edd1f9ca248bd2f2a669401f8a, type: 3}
propertyPath: m_Size.y
value: 19
value: 16.534481
objectReference: {fileID: 0}
- target: {fileID: 4799275495668483708, guid: 86af44edd1f9ca248bd2f2a669401f8a, type: 3}
propertyPath: m_Offset.x
@ -84262,7 +84266,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4799275495668483708, guid: 86af44edd1f9ca248bd2f2a669401f8a, type: 3}
propertyPath: m_Offset.y
value: -3
value: -1.7672348
objectReference: {fileID: 0}
- target: {fileID: 4799275495668483708, guid: 86af44edd1f9ca248bd2f2a669401f8a, type: 3}
propertyPath: m_CompositeOperation
@ -213334,97 +213338,6 @@ Transform:
m_CorrespondingSourceObject: {fileID: 3897414768386052035, guid: fd2391a459d3e9d4bba8faa914f8e433, type: 3}
m_PrefabInstance: {fileID: 1606834185}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1611009255
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 1868557335}
m_Modifications:
- target: {fileID: 461135850988695964, guid: 86af44edd1f9ca248bd2f2a669401f8a, type: 3}
propertyPath: m_Name
value: CameraControlTrigger_5
objectReference: {fileID: 0}
- target: {fileID: 4756442394975909600, guid: 86af44edd1f9ca248bd2f2a669401f8a, type: 3}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4799275495668483708, guid: 86af44edd1f9ca248bd2f2a669401f8a, type: 3}
propertyPath: m_Size.x
value: 14
objectReference: {fileID: 0}
- target: {fileID: 4799275495668483708, guid: 86af44edd1f9ca248bd2f2a669401f8a, type: 3}
propertyPath: m_Size.y
value: 19
objectReference: {fileID: 0}
- target: {fileID: 4799275495668483708, guid: 86af44edd1f9ca248bd2f2a669401f8a, type: 3}
propertyPath: m_Offset.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4799275495668483708, guid: 86af44edd1f9ca248bd2f2a669401f8a, type: 3}
propertyPath: m_Offset.y
value: -3
objectReference: {fileID: 0}
- target: {fileID: 4799275495668483708, guid: 86af44edd1f9ca248bd2f2a669401f8a, type: 3}
propertyPath: m_CompositeOperation
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8404168423689221959, guid: 86af44edd1f9ca248bd2f2a669401f8a, type: 3}
propertyPath: m_LocalPosition.x
value: 298.0727
objectReference: {fileID: 0}
- target: {fileID: 8404168423689221959, guid: 86af44edd1f9ca248bd2f2a669401f8a, type: 3}
propertyPath: m_LocalPosition.y
value: -1.7980003
objectReference: {fileID: 0}
- target: {fileID: 8404168423689221959, guid: 86af44edd1f9ca248bd2f2a669401f8a, type: 3}
propertyPath: m_LocalPosition.z
value: 0.12992167
objectReference: {fileID: 0}
- target: {fileID: 8404168423689221959, guid: 86af44edd1f9ca248bd2f2a669401f8a, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8404168423689221959, guid: 86af44edd1f9ca248bd2f2a669401f8a, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8404168423689221959, guid: 86af44edd1f9ca248bd2f2a669401f8a, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8404168423689221959, guid: 86af44edd1f9ca248bd2f2a669401f8a, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8404168423689221959, guid: 86af44edd1f9ca248bd2f2a669401f8a, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8404168423689221959, guid: 86af44edd1f9ca248bd2f2a669401f8a, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8404168423689221959, guid: 86af44edd1f9ca248bd2f2a669401f8a, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 86af44edd1f9ca248bd2f2a669401f8a, type: 3}
--- !u!4 &1611009256 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 8404168423689221959, guid: 86af44edd1f9ca248bd2f2a669401f8a, type: 3}
m_PrefabInstance: {fileID: 1611009255}
m_PrefabAsset: {fileID: 0}
--- !u!61 &1611009257 stripped
BoxCollider2D:
m_CorrespondingSourceObject: {fileID: 4799275495668483708, guid: 86af44edd1f9ca248bd2f2a669401f8a, type: 3}
m_PrefabInstance: {fileID: 1611009255}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1612286907
PrefabInstance:
m_ObjectHideFlags: 0
@ -387919,7 +387832,6 @@ Transform:
- {fileID: 1442184983}
- {fileID: 563391575}
- {fileID: 1290960363}
- {fileID: 1611009256}
m_Father: {fileID: 690351442}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1868557336
@ -388024,23 +387936,13 @@ CompositeCollider2D:
- m_Collider: {fileID: 1290960365}
m_ColliderPaths:
- - X: 3055726848
Y: 47019996
Y: 47020052
- X: 2915726848
Y: 47019996
Y: 47020052
- X: 2915726848
Y: -142980000
Y: -118324760
- X: 3055726848
Y: -142980000
- m_Collider: {fileID: 1611009257}
m_ColliderPaths:
- - X: 3055726848
Y: 47019996
- X: 2915726848
Y: 47019996
- X: 2915726848
Y: -142980000
- X: 3055726848
Y: -142980000
Y: -118324760
m_CompositePaths:
m_Paths:
- - {x: 226.57265, y: 48.702}
@ -388055,10 +387957,10 @@ CompositeCollider2D:
- {x: 196.57265, y: 39.702}
- {x: 189.57268, y: 39.701973}
- {x: 189.5727, y: 10.702}
- - {x: 305.57266, y: -14.298}
- {x: 305.57266, y: 4.7019997}
- {x: 291.5727, y: 4.7019706}
- {x: 291.57272, y: -14.298}
- - {x: 305.57266, y: -11.832476}
- {x: 305.57266, y: 4.7020054}
- {x: 291.5727, y: 4.701976}
- {x: 291.57272, y: -11.832476}
m_VertexDistance: 0.0005
m_OffsetDistance: 0.00005
m_UseDelaunayMesh: 0

View File

@ -177462,6 +177462,10 @@ PrefabInstance:
propertyPath: m_Name
value: Finish
objectReference: {fileID: 0}
- target: {fileID: 4213635907731438243, guid: 70235a41586931d41996f4a80dd71752, type: 3}
propertyPath: enablePrizeOnFinish
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []

View File

@ -153,9 +153,9 @@ RectTransform:
- {fileID: 1810397173}
m_Father: {fileID: 437785089}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 1100.5037, y: -83.62717}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 250, y: 125}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &25821067
@ -950,7 +950,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &139708007
RectTransform:
m_ObjectHideFlags: 0
@ -1754,9 +1754,9 @@ RectTransform:
m_Father: {fileID: 2054206196}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: -17}
m_SizeDelta: {x: 20, y: 0}
m_Pivot: {x: 1, y: 1}
--- !u!114 &273493570
MonoBehaviour:
@ -1802,7 +1802,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 434895585}
m_Direction: 2
m_Value: 0
m_Size: 1
m_Size: 0.9999981
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
@ -2108,9 +2108,9 @@ RectTransform:
m_Father: {fileID: 2054206196}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -17, y: 20}
m_SizeDelta: {x: 0, y: 20}
m_Pivot: {x: 0, y: 0}
--- !u!114 &328533400
MonoBehaviour:
@ -2403,10 +2403,10 @@ RectTransform:
m_Children: []
m_Father: {fileID: 545548130}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 307.16107, y: -384.26282}
m_SizeDelta: {x: 600, y: 100}
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.5, y: 0.5}
--- !u!114 &430243133
MonoBehaviour:
@ -2584,7 +2584,7 @@ RectTransform:
m_Father: {fileID: 112549352}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
@ -3606,9 +3606,9 @@ RectTransform:
- {fileID: 1817130577}
m_Father: {fileID: 426527141}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 1100.5037, y: -83.62717}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 250, y: 125}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &536357187
@ -4641,10 +4641,10 @@ RectTransform:
m_Children: []
m_Father: {fileID: 545548130}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 307.16107, y: -534.2628}
m_SizeDelta: {x: 600, y: 100}
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.5, y: 0.5}
--- !u!114 &674695656
MonoBehaviour:
@ -5223,10 +5223,10 @@ RectTransform:
- {fileID: 1631191833}
m_Father: {fileID: 519510896}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 307.16107, y: -209.26282}
m_SizeDelta: {x: 400, y: 150}
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.5, y: 0.5}
--- !u!1 &765378069
GameObject:
@ -5563,10 +5563,10 @@ RectTransform:
m_Children: []
m_Father: {fileID: 545548130}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 307.16107, y: -234.26282}
m_SizeDelta: {x: 600, y: 100}
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.5, y: 0.5}
--- !u!114 &783722930
MonoBehaviour:
@ -5704,9 +5704,9 @@ RectTransform:
m_Father: {fileID: 265801313}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -17, y: 20}
m_SizeDelta: {x: 0, y: 20}
m_Pivot: {x: 0, y: 0}
--- !u!114 &787002084
MonoBehaviour:
@ -5977,10 +5977,10 @@ RectTransform:
- {fileID: 457224350}
m_Father: {fileID: 519510896}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 307.16107, y: -409.26282}
m_SizeDelta: {x: 400, y: 150}
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.5, y: 0.5}
--- !u!1 &817313575
GameObject:
@ -6151,10 +6151,10 @@ RectTransform:
m_Children: []
m_Father: {fileID: 545548130}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 307.16107, y: -84.26282}
m_SizeDelta: {x: 600, y: 100}
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.5, y: 0.5}
--- !u!114 &820785317
MonoBehaviour:
@ -7800,7 +7800,7 @@ RectTransform:
m_Father: {fileID: 1819180688}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
@ -8073,9 +8073,9 @@ RectTransform:
m_Children: []
m_Father: {fileID: 1326557472}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 625.5037, y: -83.62717}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 400, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1137765170
@ -8382,9 +8382,9 @@ RectTransform:
- {fileID: 1390973856}
m_Father: {fileID: 426527141}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 150.50372, y: -83.62717}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 250, y: 125}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1191232038
@ -8502,7 +8502,7 @@ RectTransform:
m_Father: {fileID: 837630039}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
@ -8761,9 +8761,9 @@ RectTransform:
- {fileID: 446762385}
m_Father: {fileID: 1326557472}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 1100.5037, y: -83.62717}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 250, y: 125}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1283350114
@ -9360,9 +9360,9 @@ RectTransform:
- {fileID: 1120906356}
m_Father: {fileID: 678178678}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 1100.5037, y: -83.62717}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 250, y: 125}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1357198569
@ -9481,9 +9481,9 @@ RectTransform:
- {fileID: 1850011196}
m_Father: {fileID: 678178678}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 150.50372, y: -83.62717}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 250, y: 125}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1364683702
@ -9988,9 +9988,9 @@ RectTransform:
- {fileID: 2094814483}
m_Father: {fileID: 437785089}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 150.50372, y: -83.62717}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 250, y: 125}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1420020396
@ -10107,9 +10107,9 @@ RectTransform:
m_Children: []
m_Father: {fileID: 678178678}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 625.5037, y: -83.62717}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 400, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1423316046
@ -10539,9 +10539,9 @@ RectTransform:
m_Father: {fileID: 265801313}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -17, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 1}
--- !u!114 &1461740380
MonoBehaviour:
@ -11157,7 +11157,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 100, y: 0}
m_SizeDelta: {x: -100, y: -630.06824}
m_SizeDelta: {x: -100, y: 0}
m_Pivot: {x: 0, y: 1}
--- !u!114 &1537614491
MonoBehaviour:
@ -11254,9 +11254,9 @@ RectTransform:
m_Father: {fileID: 2054206196}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -17, y: -17}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 1}
--- !u!114 &1549457647
MonoBehaviour:
@ -13011,9 +13011,9 @@ RectTransform:
m_Children: []
m_Father: {fileID: 426527141}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 625.5037, y: -83.62717}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 400, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1730670365
@ -13553,7 +13553,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0.0003166179}
m_AnchoredPosition: {x: 0, y: 0.00094176567}
m_SizeDelta: {x: 0, y: 300}
m_Pivot: {x: 0, y: 1}
--- !u!114 &1792218764
@ -14738,9 +14738,9 @@ RectTransform:
- {fileID: 1669150824}
m_Father: {fileID: 1326557472}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 150.50372, y: -83.62717}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 250, y: 125}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1906471959
@ -15613,9 +15613,9 @@ RectTransform:
m_Children: []
m_Father: {fileID: 437785089}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 625.5037, y: -83.62717}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 400, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1990373952
@ -16093,7 +16093,7 @@ RectTransform:
m_Father: {fileID: 1071857129}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
@ -16340,7 +16340,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: 309.4284, y: -54.967533}
m_AnchoredPosition: {x: 309.4284, y: -54.96753}
m_SizeDelta: {x: 800, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &2055719609

View File

@ -183,10 +183,10 @@ namespace RR.Game2D.Behaviour
private void OnTriggerEnter2D(Collider2D collision)
{
if (collision.CompareTag("Finish"))
{
GameManager.Instance.NextLevel();
}
// if (collision.CompareTag("Finish"))
// {
// GameManager.Instance.NextLevel();
// }
if (collision.CompareTag("Enemy"))
{

View File

@ -0,0 +1,124 @@
using UnityEngine;
using RR.Common.Controls;
using RR.Common.Settings;
using RR.Game2D.Core.Managers;
namespace RR.Game2D.Behaviour
{
/// <summary>
/// Компонент финиша уровня с возможностью выдачи маленького приза.
/// Устанавливается на объект с триггером и тегом "Finish".
/// </summary>
[RequireComponent(typeof(Collider2D))]
public class LevelFinish : MonoBehaviour
{
[Header("Настройки приза")]
[Tooltip("Включить выдачу приза при завершении уровня")]
[SerializeField] private bool enablePrizeOnFinish = true;
[Tooltip("Ключ настройки для проверки включения выдачи призов (если пусто - не проверяется)")]
[SerializeField] private string prizeEnabledSettingKey = "prize.smallPrizeEnabled";
[Tooltip("Задержка перед выдачей приза (в секундах)")]
[SerializeField] private float prizeDelay = 0.5f;
[Header("Отладка")]
[SerializeField] private bool debugMode;
private bool _prizeGiven;
private void OnTriggerEnter2D(Collider2D collision)
{
// Проверяем, что это игрок
if (!collision.CompareTag("Player")) return;
// Пытаемся выдать приз
TryGivePrize();
// Переход на следующий уровень
GameManager.Instance.NextLevel();
}
/// <summary>
/// Пытается выдать приз игроку, если выполнены все условия.
/// </summary>
private void TryGivePrize()
{
// Проверка, что приз еще не был выдан
if (_prizeGiven)
{
if (debugMode)
Debug.Log("[LevelFinish] Приз уже был выдан на этом финише.");
return;
}
// Проверка, включена ли выдача призов в этом компоненте
if (!enablePrizeOnFinish)
{
if (debugMode)
Debug.Log("[LevelFinish] Выдача призов отключена в компоненте.");
return;
}
// Проверка настроек (если указан ключ)
if (!string.IsNullOrEmpty(prizeEnabledSettingKey))
{
bool settingEnabled = SettingsManager.Instance.GetBool(prizeEnabledSettingKey);
if (!settingEnabled)
{
if (debugMode)
Debug.Log($"[LevelFinish] Выдача призов отключена в настройках ({prizeEnabledSettingKey}).");
return;
}
}
// Все проверки пройдены - выдаем приз
_prizeGiven = true;
if (prizeDelay > 0)
{
Invoke(nameof(GivePrize), prizeDelay);
}
else
{
GivePrize();
}
}
/// <summary>
/// Выдает приз через PrizeSystemManager (учитывает флаг enableHopper).
/// </summary>
private void GivePrize()
{
if (debugMode)
Debug.Log("[LevelFinish] Выдаю приз игроку!");
if (RR.Common.Managers.PrizeSystemManager.Instance != null)
RR.Common.Managers.PrizeSystemManager.Instance.GivePrize();
else
PrizeSystem.GivePrize(); // fallback
}
/// <summary>
/// Сбрасывает состояние выдачи приза (для повторного использования).
/// </summary>
public void ResetPrize()
{
_prizeGiven = false;
}
#if UNITY_EDITOR
private void OnDrawGizmos()
{
// Визуализация зоны финиша в редакторе
Collider2D col = GetComponent<Collider2D>();
if (col != null)
{
Gizmos.color = enablePrizeOnFinish ? Color.green : Color.yellow;
Gizmos.DrawWireCube(col.bounds.center, col.bounds.size);
}
}
#endif
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 83fb48e020004ca49f4eaa1a518e86f0
timeCreated: 1771331790

View File

@ -14,7 +14,7 @@ namespace RR.Common.Controls
private static PrizeSystem Instance { get; set; }
private static Coroutine prizeCoroutine;
private static bool _prizing = false;
private static bool _prizing;
private static bool _lastPrizeSuccess = true;
public static readonly string key_starts = "STARTS";
@ -90,6 +90,8 @@ namespace RR.Common.Controls
if (prizeCoroutine != null) Instance.StopCoroutine(prizeCoroutine);
prizeCoroutine = Instance.StartCoroutine(Instance.Prize());
}
//===========================end: PUBLIC API===========================//
#region Приватные методы
@ -98,6 +100,7 @@ namespace RR.Common.Controls
_prizing = true;
// DebugWindow.Message("Начинаю выдачу");
const float timeout = 10; //сек
ComWrapper.Send("301");//включаем мотор
float startTime = Time.time;
@ -127,6 +130,7 @@ namespace RR.Common.Controls
if (!success) AudioManager.Instance.PlaySfx(prizeErrorSound);
}
private static void IncreasePrizeCounters()
{
PlayerPrefs.SetInt(key_prizesgiven, PlayerPrefs.GetInt(key_prizesgiven) + 1);

View File

@ -5,6 +5,13 @@ using UnityEngine.UI;
namespace RR.Common.UI
{
/// <summary>
/// УСТАРЕВШИЙ контроллер QR-кодов.
/// Логика отображения QR-кодов полностью перенесена в WinBannerController:
/// QR-коды генерируются в PrizeSystemManager и показываются ТОЛЬКО при победе (GameWonEvent).
/// Удалите этот компонент со сцены и используйте WinBannerController.
/// </summary>
[System.Obsolete("Используйте WinBannerController — QR-коды показываются только при победе через PrizeSystemManager.")]
public class QRCodeUIController : MonoBehaviour
{
[SerializeField] private Transform content;
@ -14,6 +21,9 @@ namespace RR.Common.UI
private void Start()
{
Debug.LogWarning("[QRCodeUIController] Этот компонент устарел. " +
"Удалите его со сцены — QR-коды управляются через WinBannerController.");
_prizeSystemManager = PrizeSystemManager.Instance;
GameManager.Instance.GameWonEvent += AddQRCodes;
@ -21,7 +31,8 @@ namespace RR.Common.UI
private void OnDestroy()
{
GameManager.Instance.GameWonEvent -= AddQRCodes;
if (GameManager.Instance != null)
GameManager.Instance.GameWonEvent -= AddQRCodes;
}
private void AddQRCodes(float _)

View File

@ -1,11 +1,8 @@
{
"dependencies": {
"com.github-glitchenzo.nugetforunity": "https://github.com/GlitchEnzo/NuGetForUnity.git?path=/src/NuGetForUnity",
"com.unity.2d.enhancers": "1.0.0",
"com.unity.ai.assistant": "1.6.0-pre.2",
"com.unity.ai.generators": "1.5.0-pre.2",
"com.unity.ai.inference": "2.4.1",
"com.unity.cinemachine": "3.1.4",
"com.unity.cinemachine": "3.1.5",
"com.unity.collab-proxy": "2.10.2",
"com.unity.feature.2d": "2.0.2",
"com.unity.ide.rider": "3.0.39",

View File

@ -35,7 +35,7 @@
},
"com.unity.2d.common": {
"version": "12.0.1",
"depth": 1,
"depth": 2,
"source": "registry",
"dependencies": {
"com.unity.burst": "1.8.4",
@ -48,18 +48,6 @@
},
"url": "https://packages.unity.com"
},
"com.unity.2d.enhancers": {
"version": "1.0.0",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.2d.common": "11.0.1",
"com.unity.ai.generators": "1.0.0-pre.12",
"com.unity.settings-manager": "2.0.1",
"com.unity.modules.uielements": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.2d.pixel-perfect": {
"version": "5.1.1",
"depth": 1,
@ -127,32 +115,6 @@
},
"url": "https://packages.unity.com"
},
"com.unity.ai.assistant": {
"version": "1.6.0-pre.2",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ai.generators": "1.6.0-pre.2",
"com.unity.serialization": "3.1.1",
"com.unity.modules.uielements": "1.0.0",
"com.unity.nuget.newtonsoft-json": "3.2.1",
"com.unity.modules.unitywebrequest": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.ai.generators": {
"version": "1.6.0-pre.2",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.2d.sprite": "1.0.0",
"com.unity.ai.toolkit": "1.6.0-pre.2",
"com.unity.mathematics": "1.3.2",
"com.unity.cloud.gltfast": "6.14.1",
"com.unity.nuget.newtonsoft-json": "3.2.1"
},
"url": "https://packages.unity.com"
},
"com.unity.ai.inference": {
"version": "2.4.1",
"depth": 0,
@ -166,15 +128,6 @@
},
"url": "https://packages.unity.com"
},
"com.unity.ai.toolkit": {
"version": "1.6.0-pre.2",
"depth": 2,
"source": "registry",
"dependencies": {
"com.unity.nuget.newtonsoft-json": "3.2.1"
},
"url": "https://packages.unity.com"
},
"com.unity.burst": {
"version": "1.8.26",
"depth": 1,
@ -186,7 +139,7 @@
"url": "https://packages.unity.com"
},
"com.unity.cinemachine": {
"version": "3.1.4",
"version": "3.1.5",
"depth": 0,
"source": "registry",
"dependencies": {
@ -195,19 +148,6 @@
},
"url": "https://packages.unity.com"
},
"com.unity.cloud.gltfast": {
"version": "6.14.1",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.burst": "1.8.24",
"com.unity.collections": "1.2.4",
"com.unity.mathematics": "1.2.6",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.collab-proxy": {
"version": "2.10.2",
"depth": 0,
@ -291,7 +231,7 @@
},
"com.unity.mathematics": {
"version": "1.3.3",
"depth": 1,
"depth": 2,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
@ -357,19 +297,9 @@
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.serialization": {
"version": "3.1.3",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.burst": "1.7.2",
"com.unity.collections": "2.4.2"
},
"url": "https://packages.unity.com"
},
"com.unity.settings-manager": {
"version": "2.1.1",
"depth": 1,
"depth": 2,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"