last update
This commit is contained in:
+150
-38
@@ -2151,8 +2151,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 1, y: 1}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: -8, y: -16}
|
||||
m_SizeDelta: {x: 78.783295, y: 16.027199}
|
||||
m_AnchoredPosition: {x: -8, y: -15}
|
||||
m_SizeDelta: {x: 78, y: 18}
|
||||
m_Pivot: {x: 1, y: 1}
|
||||
--- !u!114 &200516492
|
||||
MonoBehaviour:
|
||||
@@ -2844,6 +2844,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: a7e76898ddff58d4da6f9c186708bdaf, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
game: 1
|
||||
_descriptionField: {fileID: 1527422344}
|
||||
_acceptChangesButton: {fileID: 1288436093}
|
||||
--- !u!114 &287618196
|
||||
@@ -4496,6 +4497,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: a7e76898ddff58d4da6f9c186708bdaf, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
game: 2
|
||||
_descriptionField: {fileID: 13985620}
|
||||
_acceptChangesButton: {fileID: 1579072906}
|
||||
--- !u!114 &496661088
|
||||
@@ -4682,6 +4684,7 @@ GameObject:
|
||||
- component: {fileID: 538388975}
|
||||
- component: {fileID: 538388977}
|
||||
- component: {fileID: 538388976}
|
||||
- component: {fileID: 538388978}
|
||||
m_Layer: 5
|
||||
m_Name: BackButton
|
||||
m_TagString: Untagged
|
||||
@@ -4747,6 +4750,62 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 538388974}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &538388978
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 538388974}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 0
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_SelectedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 538388976}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 687951928}
|
||||
m_TargetAssemblyTypeName: UIMenu, Assembly-CSharp
|
||||
m_MethodName: ShowPreviousMenu
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
--- !u!1 &553608375
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -5227,6 +5286,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: a7e76898ddff58d4da6f9c186708bdaf, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
game: 0
|
||||
_descriptionField: {fileID: 984558546}
|
||||
_acceptChangesButton: {fileID: 200516492}
|
||||
--- !u!1 &642213539
|
||||
@@ -5721,7 +5781,7 @@ GameObject:
|
||||
- component: {fileID: 687951931}
|
||||
- component: {fileID: 687951928}
|
||||
- component: {fileID: 687951930}
|
||||
- component: {fileID: 687951929}
|
||||
- component: {fileID: 687951933}
|
||||
m_Layer: 5
|
||||
m_Name: DescPanel
|
||||
m_TagString: Untagged
|
||||
@@ -5764,21 +5824,7 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_nextMenu: {fileID: 0}
|
||||
_previousMenu: {fileID: 0}
|
||||
--- !u!114 &687951929
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 687951926}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f46f68853a780f45bc26c659075d83e, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_city: {fileID: 449361371}
|
||||
_key: {fileID: 0}
|
||||
_previousMenu: {fileID: 768891369}
|
||||
--- !u!225 &687951930
|
||||
CanvasGroup:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -5829,6 +5875,18 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 687951926}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &687951933
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 687951926}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 1acb4224a2cc1884295feba5466f5da0, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &689754908
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -5866,8 +5924,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 1, y: 1}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: -8, y: -16}
|
||||
m_SizeDelta: {x: 78.783295, y: 16.027199}
|
||||
m_AnchoredPosition: {x: -8, y: -15}
|
||||
m_SizeDelta: {x: 78, y: 18}
|
||||
m_Pivot: {x: 1, y: 1}
|
||||
--- !u!114 &689754910
|
||||
MonoBehaviour:
|
||||
@@ -6674,6 +6732,8 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
_city: {fileID: 1344348388}
|
||||
_key: {fileID: 825517493}
|
||||
_tagsDescMenu: {fileID: 687951928}
|
||||
_winnersTableMenu: {fileID: 0}
|
||||
--- !u!1 &769514370
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -6728,6 +6788,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: a7e76898ddff58d4da6f9c186708bdaf, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
game: 5
|
||||
_descriptionField: {fileID: 1478480270}
|
||||
_acceptChangesButton: {fileID: 1258897610}
|
||||
--- !u!114 &769514373
|
||||
@@ -6822,6 +6883,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: a7e76898ddff58d4da6f9c186708bdaf, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
game: 7
|
||||
_descriptionField: {fileID: 577734377}
|
||||
_acceptChangesButton: {fileID: 1674558999}
|
||||
--- !u!114 &783592178
|
||||
@@ -7595,6 +7657,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: a7e76898ddff58d4da6f9c186708bdaf, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
game: 4
|
||||
_descriptionField: {fileID: 1733602343}
|
||||
_acceptChangesButton: {fileID: 1614344225}
|
||||
--- !u!114 &850926011
|
||||
@@ -9928,8 +9991,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 1, y: 1}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: -8, y: -16}
|
||||
m_SizeDelta: {x: 78.783295, y: 16.027199}
|
||||
m_AnchoredPosition: {x: -8, y: -15}
|
||||
m_SizeDelta: {x: 78, y: 18}
|
||||
m_Pivot: {x: 1, y: 1}
|
||||
--- !u!114 &1123283915
|
||||
MonoBehaviour:
|
||||
@@ -10058,7 +10121,37 @@ PrefabInstance:
|
||||
- target: {fileID: 2754903329500275487, guid: 42a7e4c9f75066f46a25dd7951ad2684,
|
||||
type: 3}
|
||||
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.size
|
||||
value: 0
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2754903329500275487, guid: 42a7e4c9f75066f46a25dd7951ad2684,
|
||||
type: 3}
|
||||
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[1].m_Mode
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2754903329500275487, guid: 42a7e4c9f75066f46a25dd7951ad2684,
|
||||
type: 3}
|
||||
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
|
||||
value:
|
||||
objectReference: {fileID: 768891373}
|
||||
- target: {fileID: 2754903329500275487, guid: 42a7e4c9f75066f46a25dd7951ad2684,
|
||||
type: 3}
|
||||
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[1].m_CallState
|
||||
value: 2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2754903329500275487, guid: 42a7e4c9f75066f46a25dd7951ad2684,
|
||||
type: 3}
|
||||
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
|
||||
value: ShowTagsDescription
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2754903329500275487, guid: 42a7e4c9f75066f46a25dd7951ad2684,
|
||||
type: 3}
|
||||
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName
|
||||
value: AdminPanel, Assembly-CSharp
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2754903329500275487, guid: 42a7e4c9f75066f46a25dd7951ad2684,
|
||||
type: 3}
|
||||
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
|
||||
value: UnityEngine.Object, UnityEngine
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4699163184515956614, guid: 42a7e4c9f75066f46a25dd7951ad2684,
|
||||
type: 3}
|
||||
@@ -10807,6 +10900,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: a7e76898ddff58d4da6f9c186708bdaf, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
game: 3
|
||||
_descriptionField: {fileID: 751054067}
|
||||
_acceptChangesButton: {fileID: 1760171753}
|
||||
--- !u!114 &1210254361
|
||||
@@ -11104,8 +11198,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 1, y: 1}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: -8, y: -16}
|
||||
m_SizeDelta: {x: 78.783295, y: 16.027199}
|
||||
m_AnchoredPosition: {x: -8, y: -15}
|
||||
m_SizeDelta: {x: 78, y: 18}
|
||||
m_Pivot: {x: 1, y: 1}
|
||||
--- !u!114 &1258897610
|
||||
MonoBehaviour:
|
||||
@@ -11226,8 +11320,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 1, y: 1}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: -8, y: -16}
|
||||
m_SizeDelta: {x: 78.783295, y: 16.027199}
|
||||
m_AnchoredPosition: {x: -8, y: -15}
|
||||
m_SizeDelta: {x: 78, y: 18}
|
||||
m_Pivot: {x: 1, y: 1}
|
||||
--- !u!114 &1288436093
|
||||
MonoBehaviour:
|
||||
@@ -12101,6 +12195,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: a7e76898ddff58d4da6f9c186708bdaf, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
game: 9
|
||||
_descriptionField: {fileID: 117181243}
|
||||
_acceptChangesButton: {fileID: 1123283915}
|
||||
--- !u!114 &1360504577
|
||||
@@ -12660,6 +12755,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: a7e76898ddff58d4da6f9c186708bdaf, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
game: 6
|
||||
_descriptionField: {fileID: 1784353494}
|
||||
_acceptChangesButton: {fileID: 1864138042}
|
||||
--- !u!114 &1419581526
|
||||
@@ -13985,6 +14081,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: a7e76898ddff58d4da6f9c186708bdaf, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
game: 8
|
||||
_descriptionField: {fileID: 1325934311}
|
||||
_acceptChangesButton: {fileID: 689754910}
|
||||
--- !u!114 &1557283777
|
||||
@@ -14062,8 +14159,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 1, y: 1}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: -8, y: -16}
|
||||
m_SizeDelta: {x: 78.783295, y: 16.027199}
|
||||
m_AnchoredPosition: {x: -8, y: -15}
|
||||
m_SizeDelta: {x: 78, y: 18}
|
||||
m_Pivot: {x: 1, y: 1}
|
||||
--- !u!114 &1579072906
|
||||
MonoBehaviour:
|
||||
@@ -14267,8 +14364,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 1, y: 1}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: -8, y: -16}
|
||||
m_SizeDelta: {x: 78.783295, y: 16.027199}
|
||||
m_AnchoredPosition: {x: -8, y: -15}
|
||||
m_SizeDelta: {x: 78, y: 18}
|
||||
m_Pivot: {x: 1, y: 1}
|
||||
--- !u!114 &1614344225
|
||||
MonoBehaviour:
|
||||
@@ -14796,8 +14893,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 1, y: 1}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: -8, y: -16}
|
||||
m_SizeDelta: {x: 78.783295, y: 16.027199}
|
||||
m_AnchoredPosition: {x: -8, y: -15}
|
||||
m_SizeDelta: {x: 78, y: 18}
|
||||
m_Pivot: {x: 1, y: 1}
|
||||
--- !u!114 &1674558999
|
||||
MonoBehaviour:
|
||||
@@ -15799,8 +15896,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 1, y: 1}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: -8, y: -16}
|
||||
m_SizeDelta: {x: 78.783295, y: 16.027199}
|
||||
m_AnchoredPosition: {x: -8, y: -15}
|
||||
m_SizeDelta: {x: 78, y: 18}
|
||||
m_Pivot: {x: 1, y: 1}
|
||||
--- !u!114 &1760171753
|
||||
MonoBehaviour:
|
||||
@@ -17204,8 +17301,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 1, y: 1}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: -8, y: -16}
|
||||
m_SizeDelta: {x: 78.783295, y: 16.027199}
|
||||
m_AnchoredPosition: {x: -8, y: -15}
|
||||
m_SizeDelta: {x: 78, y: 18}
|
||||
m_Pivot: {x: 1, y: 1}
|
||||
--- !u!114 &1864138042
|
||||
MonoBehaviour:
|
||||
@@ -19861,7 +19958,22 @@ PrefabInstance:
|
||||
type: 3}
|
||||
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
|
||||
value:
|
||||
objectReference: {fileID: 768891369}
|
||||
objectReference: {fileID: 768891373}
|
||||
- target: {fileID: 2754903329500275487, guid: 42a7e4c9f75066f46a25dd7951ad2684,
|
||||
type: 3}
|
||||
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
|
||||
value: ShowTagsDescription
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2754903329500275487, guid: 42a7e4c9f75066f46a25dd7951ad2684,
|
||||
type: 3}
|
||||
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName
|
||||
value: AdminPanel, Assembly-CSharp
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2754903329500275487, guid: 42a7e4c9f75066f46a25dd7951ad2684,
|
||||
type: 3}
|
||||
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
|
||||
value: UnityEngine.Object, UnityEngine
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4699163184515956614, guid: 42a7e4c9f75066f46a25dd7951ad2684,
|
||||
type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using YandexQuest.Models;
|
||||
using Zenject;
|
||||
|
||||
@@ -10,15 +11,33 @@ public class AdminPanel : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private TMP_Text _city;
|
||||
[SerializeField] private TMP_InputField _key;
|
||||
[Space]
|
||||
[SerializeField] private UIMenu _tagsDescMenu;
|
||||
[SerializeField] private UIMenu _winnersTableMenu;
|
||||
|
||||
[Inject] private readonly NetworkService _networkService;
|
||||
[Inject] private readonly ClientDataService _clientDataService;
|
||||
|
||||
private UIMenu _menu;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_menu = GetComponent<UIMenu>();
|
||||
}
|
||||
|
||||
public void ShowTagsDescription()
|
||||
{
|
||||
_menu.SetNextMenu(_tagsDescMenu);
|
||||
_menu.ShowNextMenu();
|
||||
}
|
||||
|
||||
public async void Initialize(Cities city)
|
||||
{
|
||||
_city.text = _clientDataService.citiesTranslation[city];
|
||||
var result = await _networkService.GetAsync<int>($"auth/secretcode/{(int)city}");
|
||||
_key.text = result.responseData.ToString();
|
||||
|
||||
_clientDataService.city = (int)city;
|
||||
}
|
||||
|
||||
public void CopyToClipboard() => GUIUtility.systemCopyBuffer = _key.text;
|
||||
|
||||
@@ -26,7 +26,7 @@ public class Authorization : MonoBehaviour
|
||||
_menu = GetComponent<UIMenu>();
|
||||
_adminPanel = _adminMenu.GetComponent<AdminPanel>();
|
||||
|
||||
if(_clientDataService.data != null)
|
||||
if (_clientDataService.data != null)
|
||||
{
|
||||
Debug.LogWarning($"данные клианта {_clientDataService.data.id} загружены: город - {(Cities)_clientDataService.data.city}, найдено тэгов - {_clientDataService.data.games.Count}");
|
||||
// UniTask.Void(async ()=>
|
||||
@@ -52,7 +52,7 @@ public class Authorization : MonoBehaviour
|
||||
|
||||
_codeInputField.onValueChanged.AddListener(stringValue =>
|
||||
{
|
||||
if(stringValue.Length != 6)
|
||||
if (stringValue.Length != 6)
|
||||
{
|
||||
_codeAcceptButton.interactable = false;
|
||||
}
|
||||
@@ -72,9 +72,8 @@ public class Authorization : MonoBehaviour
|
||||
{
|
||||
CityUniqueCode cityUniqueCode = null;
|
||||
var resultAdmin = await _networkService.GetAsync<CityUniqueCode>($"auth/admin/{inputFieldText}");
|
||||
cityUniqueCode = resultAdmin.responseData;
|
||||
|
||||
if(resultAdmin.responseCode == 0)
|
||||
if (resultAdmin.responseCode == 0)
|
||||
{
|
||||
var message = "Нет соединения с сервером";
|
||||
Debug.LogError(message);
|
||||
@@ -85,18 +84,18 @@ public class Authorization : MonoBehaviour
|
||||
Debug.LogWarning("такого админа нет в базе. ищем город...");
|
||||
var result = await _networkService.GetAsync<Client>($"auth/{inputFieldText}");
|
||||
|
||||
if(result.responseCode == 404)
|
||||
if (result.responseCode == 404)
|
||||
{
|
||||
Debug.LogError(result.responseText);
|
||||
_inputField.ShowErrorAsync(result.responseText).Forget();
|
||||
}
|
||||
else if(result.responseCode == 0)
|
||||
else if (result.responseCode == 0)
|
||||
{
|
||||
var message = "Нет соединения с сервером";
|
||||
Debug.LogError(message);
|
||||
_inputField.ShowErrorAsync(message).Forget();
|
||||
}
|
||||
else if(result.responseCode == 200)
|
||||
else if (result.responseCode == 200)
|
||||
{
|
||||
_clientDataService.data = result.responseData;
|
||||
Debug.Log(result.responseData.city.ToString());
|
||||
@@ -104,9 +103,12 @@ public class Authorization : MonoBehaviour
|
||||
_menu.ShowNextMenu();
|
||||
}
|
||||
}
|
||||
else if(resultAdmin.responseCode == 200)
|
||||
else if (resultAdmin.responseCode == 200)
|
||||
{
|
||||
cityUniqueCode = resultAdmin.responseData;
|
||||
|
||||
_adminPanel.Initialize(resultAdmin.responseData.cityEnum);
|
||||
_clientDataService.city = (int)resultAdmin.responseData.cityEnum;
|
||||
|
||||
_menu.SetNextMenu(_adminMenu);
|
||||
_menu.ShowNextMenu();
|
||||
|
||||
@@ -73,8 +73,8 @@ namespace YandexQuest.Models
|
||||
public class Tag
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string name { get; set; }
|
||||
public string descrition { get; set; }
|
||||
public Games game { get; set; }
|
||||
public string description { get; set; }
|
||||
public Cities city { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,5 +8,7 @@ public class AppInstaller : MonoInstaller
|
||||
Container.Bind<NetworkService>().AsSingle().NonLazy();
|
||||
Container.Bind<ClientDataService>().AsSingle();
|
||||
Container.Bind<SceneLoadingService>().AsSingle();
|
||||
|
||||
Container.Bind<TagDescriptionsPanel>().FromComponentInHierarchy().AsSingle();
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,13 @@ public class ClientDataService
|
||||
}
|
||||
}
|
||||
|
||||
public int position
|
||||
public int city
|
||||
{
|
||||
get => PlayerPrefs.GetInt("city", -1);
|
||||
set => PlayerPrefs.SetInt("city", value);
|
||||
}
|
||||
|
||||
public int topPosition
|
||||
{
|
||||
get => PlayerPrefs.GetInt("position", 0);
|
||||
set => PlayerPrefs.SetInt("position", value);
|
||||
|
||||
@@ -37,7 +37,7 @@ public class NetworkService
|
||||
catch { }
|
||||
|
||||
responseStruct.responseCode = getRequest.responseCode;
|
||||
if(getRequest.responseCode != 200)
|
||||
if (getRequest.responseCode != 200)
|
||||
{
|
||||
responseStruct.responseText = getRequest.downloadHandler.text;
|
||||
return responseStruct;
|
||||
@@ -50,7 +50,7 @@ public class NetworkService
|
||||
|
||||
return responseStruct;
|
||||
}
|
||||
catch(Exception ex)
|
||||
catch (Exception ex)
|
||||
{
|
||||
responseStruct.responseCode = -1;
|
||||
responseStruct.responseText = ex.Message;
|
||||
@@ -86,7 +86,7 @@ public class NetworkService
|
||||
catch { }
|
||||
|
||||
responseStruct.responseCode = getRequest.responseCode;
|
||||
if(getRequest.responseCode != 200)
|
||||
if (getRequest.responseCode != 200)
|
||||
{
|
||||
responseStruct.responseText = getRequest.downloadHandler.text;
|
||||
return responseStruct;
|
||||
@@ -98,7 +98,7 @@ public class NetworkService
|
||||
responseStruct.responseData = result;
|
||||
return responseStruct;
|
||||
}
|
||||
catch(Exception ex)
|
||||
catch (Exception ex)
|
||||
{
|
||||
responseStruct.responseCode = -1;
|
||||
responseStruct.responseText = ex.Message;
|
||||
@@ -122,8 +122,8 @@ public class NetworkService
|
||||
}
|
||||
|
||||
using var getRequest = UnityWebRequest.Get(_apiUrl + stringBuilder.ToString());
|
||||
if(headers != null)
|
||||
foreach(var header in headers)
|
||||
if (headers != null)
|
||||
foreach (var header in headers)
|
||||
getRequest.SetRequestHeader(header.Key, header.Value);
|
||||
|
||||
getRequest.SetRequestHeader("Content-type", "application/json");
|
||||
@@ -136,7 +136,7 @@ public class NetworkService
|
||||
catch { }
|
||||
|
||||
responseStruct.responseCode = getRequest.responseCode;
|
||||
if(getRequest.responseCode != 200)
|
||||
if (getRequest.responseCode != 200)
|
||||
{
|
||||
responseStruct.responseText = getRequest.downloadHandler.text;
|
||||
return responseStruct;
|
||||
@@ -149,7 +149,7 @@ public class NetworkService
|
||||
|
||||
return responseStruct;
|
||||
}
|
||||
catch(Exception ex)
|
||||
catch (Exception ex)
|
||||
{
|
||||
responseStruct.responseCode = -1;
|
||||
responseStruct.responseText = ex.Message;
|
||||
@@ -158,21 +158,22 @@ public class NetworkService
|
||||
}
|
||||
}
|
||||
|
||||
public async UniTask PostAsync<TValue> (string requestString, TValue data, Dictionary<string, string> headers = null)
|
||||
{
|
||||
public async UniTask PostAsync<TValue>(string requestString, TValue data, Dictionary<string, string> headers = null)
|
||||
{
|
||||
string sendingData = JsonConvert.SerializeObject(data);
|
||||
using var postRequest = UnityWebRequest.Post(_apiUrl + requestString, sendingData);
|
||||
byte[] dataBytes = new UTF8Encoding().GetBytes(sendingData);
|
||||
postRequest.uploadHandler = new UploadHandlerRaw(dataBytes);
|
||||
postRequest.downloadHandler = new DownloadHandlerBuffer();
|
||||
|
||||
if(headers != null)
|
||||
using var postRequest = new UnityWebRequest(_apiUrl + requestString, "POST");
|
||||
byte[] dataBytes = new UTF8Encoding().GetBytes(sendingData);
|
||||
postRequest.uploadHandler = (UploadHandler)new UploadHandlerRaw(dataBytes);
|
||||
postRequest.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer();
|
||||
|
||||
postRequest.SetRequestHeader("Content-Type", "application/json");
|
||||
if (headers != null)
|
||||
{
|
||||
foreach(var header in headers)
|
||||
foreach (var header in headers)
|
||||
postRequest.SetRequestHeader(header.Key, header.Value);
|
||||
}
|
||||
|
||||
postRequest.SetRequestHeader("Content-Type", "application/json");
|
||||
UnityWebRequest operation = new UnityWebRequest();
|
||||
|
||||
try
|
||||
@@ -182,17 +183,18 @@ public class NetworkService
|
||||
catch { }
|
||||
}
|
||||
|
||||
public async UniTask<Response<TResponseValue>> PostAsync<TSendingValue, TResponseValue> (string requestString, TSendingValue data)
|
||||
public async UniTask<Response<TResponseValue>> PostAsync<TSendingValue, TResponseValue>(string requestString, TSendingValue data)
|
||||
{
|
||||
Response<TResponseValue> responseStruct = new Response<TResponseValue>();
|
||||
|
||||
string sendingData = JsonConvert.SerializeObject(data);
|
||||
using var postRequest = UnityWebRequest.Post(_apiUrl + requestString, sendingData);
|
||||
byte[] dataBytes = new UTF8Encoding().GetBytes(sendingData);
|
||||
postRequest.uploadHandler = new UploadHandlerRaw(dataBytes);
|
||||
postRequest.downloadHandler = new DownloadHandlerBuffer();
|
||||
postRequest.SetRequestHeader("Content-Type", "application/json");
|
||||
|
||||
using var postRequest = new UnityWebRequest(_apiUrl + requestString, "POST");
|
||||
byte[] dataBytes = new UTF8Encoding().GetBytes(sendingData);
|
||||
postRequest.uploadHandler = (UploadHandler)new UploadHandlerRaw(dataBytes);
|
||||
postRequest.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer();
|
||||
|
||||
postRequest.SetRequestHeader("Content-Type", "application/json");
|
||||
UnityWebRequest operation = new UnityWebRequest();
|
||||
|
||||
try
|
||||
@@ -202,7 +204,7 @@ public class NetworkService
|
||||
catch { }
|
||||
|
||||
responseStruct.responseCode = postRequest.responseCode;
|
||||
if(postRequest.responseCode != 200)
|
||||
if (postRequest.responseCode != 200)
|
||||
{
|
||||
responseStruct.responseText = postRequest.downloadHandler.text;
|
||||
return responseStruct;
|
||||
@@ -215,7 +217,7 @@ public class NetworkService
|
||||
|
||||
return responseStruct;
|
||||
}
|
||||
catch(Exception ex)
|
||||
catch (Exception ex)
|
||||
{
|
||||
responseStruct.responseCode = -1;
|
||||
responseStruct.responseText = ex.Message;
|
||||
|
||||
@@ -1,12 +1,51 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Cysharp.Threading.Tasks;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using YandexQuest.Models;
|
||||
using Zenject;
|
||||
|
||||
public class DescriptionCard : MonoBehaviour
|
||||
{
|
||||
[Inject] private readonly NetworkService _networkService;
|
||||
[Inject] private readonly ClientDataService _clientDataService;
|
||||
private TagDescriptionsPanel _tagDescPanel;
|
||||
|
||||
[SerializeField] public Games game;
|
||||
[SerializeField] private TMP_InputField _descriptionField;
|
||||
[SerializeField] private Button _acceptChangesButton;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_tagDescPanel = FindObjectOfType<TagDescriptionsPanel>();
|
||||
_tagDescPanel.cards.Add(this);
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_descriptionField.text = "Для данной QR-метки ещё нет описания...";
|
||||
|
||||
_acceptChangesButton.onClick
|
||||
.AddListener(() => SetTagDescription().Forget());
|
||||
}
|
||||
|
||||
public void Init(Tag tag)
|
||||
{
|
||||
_descriptionField.text = tag.description;
|
||||
}
|
||||
|
||||
private async UniTaskVoid SetTagDescription()
|
||||
{
|
||||
Tag tag = new Tag()
|
||||
{
|
||||
id = string.Empty,
|
||||
game = game,
|
||||
description = _descriptionField.text,
|
||||
city = (Cities)_clientDataService.city
|
||||
};
|
||||
|
||||
await _networkService.PostAsync<Tag>("game/tags/add", tag);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Zenject;
|
||||
using YandexQuest.Models;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using System.Linq;
|
||||
|
||||
public class TagDescriptionsPanel : MonoBehaviour
|
||||
{
|
||||
public List<DescriptionCard> cards { get; set; } = new List<DescriptionCard>();
|
||||
|
||||
[Inject] private readonly NetworkService _networkService;
|
||||
[Inject] private readonly ClientDataService _clientDataService;
|
||||
|
||||
private List<Tag> _tags;
|
||||
|
||||
private async UniTaskVoid OnEnable()
|
||||
{
|
||||
var result = await _networkService
|
||||
.GetAsync<List<Tag>>($"game/tags/{(int)_clientDataService.city}");
|
||||
|
||||
if (result.responseData != null)
|
||||
{
|
||||
_tags = result.responseData;
|
||||
|
||||
foreach (var card in cards)
|
||||
{
|
||||
var data = _tags.Find(x => x.game == card.game);
|
||||
if (data != null) card.Init(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1acb4224a2cc1884295feba5466f5da0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+1839
-34
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user