Bug fix + change tournament mode

This commit is contained in:
r.nikolin 2023-10-11 11:58:06 +03:00
parent 1b91b53c65
commit c13663d438
14 changed files with 324 additions and 208 deletions

View File

@ -14,9 +14,13 @@ namespace BNG {
public float ScreenFadeTime = 0.5f; public float ScreenFadeTime = 0.5f;
public List<string> AllMapsLevelNames = new List<string>(); public List<string> AllMapsLevelNames = new List<string>();
public string ResultSceneName = "ResultScene";
public static SceneLoader Instance; public static SceneLoader Instance;
private List<string> _randomMapsList = new List<string>();
private void Awake() private void Awake()
{ {
if (Instance == null) if (Instance == null)
@ -29,20 +33,49 @@ namespace BNG {
} }
} }
private string _sceneName; private string _sceneName;
private void Start()
{
InitStartValues();
}
[ContextMenu("Debug test")]
private void InitStartValues()
{
_randomMapsList.Clear();
_randomMapsList = new List<string>();
_randomMapsList.AddRange(AllMapsLevelNames.OrderBy(x => Random.Range(0, 100)).Take(3));
_randomMapsList.Add(ResultSceneName);
GlobalSettings.Instance.AllMaps = false;
}
public void ChangeLevel() public void ChangeLevel()
{ {
var firstPersonAfterJack = AllMapsLevelNames.SkipWhile(p => p != SceneManager.GetActiveScene().name).ElementAt(1); var firstPersonAfterJack = _randomMapsList.SkipWhile(p => p != SceneManager.GetActiveScene().name).ElementAt(1);
LoadScene(firstPersonAfterJack); LoadScene(firstPersonAfterJack);
} }
public void LoadTournament()
{
LoadScene(_randomMapsList.First());
}
public void LoadScene(string sceneName) public void LoadScene(string sceneName)
{ {
_sceneName = sceneName; _sceneName = sceneName;
StartCoroutine(LoadAsuncScene()); StartCoroutine(LoadAsuncScene());
} }
public void LoadStartScene()
{
InitStartValues();
LoadScene("StartScene");
}
private IEnumerator LoadAsuncScene() private IEnumerator LoadAsuncScene()
{ {
var scene = SceneManager.LoadSceneAsync(_sceneName, LoadSceneMode.Single); var scene = SceneManager.LoadSceneAsync(_sceneName, LoadSceneMode.Single);

View File

@ -26523,136 +26523,21 @@ PrefabInstance:
m_Modification: m_Modification:
m_TransformParent: {fileID: 936928572095971804} m_TransformParent: {fileID: 936928572095971804}
m_Modifications: m_Modifications:
- target: {fileID: 331558439186688178, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 331558439186688178, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 331558439186688178, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 632867159521037678, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3}
propertyPath: m_fontAsset
value:
objectReference: {fileID: 0}
- target: {fileID: 1348574377760534320, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1354741720488819542, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3}
propertyPath: m_fontAsset
value:
objectReference: {fileID: 0}
- target: {fileID: 1367119015998025816, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1367119015998025816, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1367119015998025816, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1566524535200000545, guid: 9069c86c178f3fa4eaf02c85a5a52483, - target: {fileID: 1566524535200000545, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3} type: 3}
propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_Target propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value: value:
objectReference: {fileID: 936928570860235921} objectReference: {fileID: 936928570860235921}
- target: {fileID: 1566524535200000545, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3}
propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: ChangeMaxSpeed
objectReference: {fileID: 0}
- target: {fileID: 1632625903564831805, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1632625903564831805, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2901144456035452955, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3}
propertyPath: m_fontAsset
value:
objectReference: {fileID: 0}
- target: {fileID: 3065018843246919554, guid: 9069c86c178f3fa4eaf02c85a5a52483, - target: {fileID: 3065018843246919554, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3} type: 3}
propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_Target propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value: value:
objectReference: {fileID: 7192482668302541528} objectReference: {fileID: 7192482668302541528}
- target: {fileID: 3065018843246919554, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3}
propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: ChangeRollSpeed
objectReference: {fileID: 0}
- target: {fileID: 3453472428484394081, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3453472428484394081, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5378598391926423282, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5378598391926423282, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5378598391926423282, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5417670521127009845, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3}
propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 7192482668302541528}
- target: {fileID: 5417670521127009845, guid: 9069c86c178f3fa4eaf02c85a5a52483, - target: {fileID: 5417670521127009845, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3} type: 3}
propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value: ChangeRollAngle
objectReference: {fileID: 0}
- target: {fileID: 6663814018499583658, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6663814018499583658, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7220724757581150497, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3}
propertyPath: m_fontAsset
value: value:
objectReference: {fileID: 0} objectReference: {fileID: 7192482668302541528}
- target: {fileID: 7577225838663604392, guid: 9069c86c178f3fa4eaf02c85a5a52483, - target: {fileID: 7577225838663604392, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3} type: 3}
propertyPath: m_SizeDelta.y propertyPath: m_SizeDelta.y
@ -26728,43 +26613,20 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 8230210971555660133, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3}
propertyPath: m_fontAsset
value:
objectReference: {fileID: 0}
- target: {fileID: 9161739377784090473, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 9069c86c178f3fa4eaf02c85a5a52483, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 9069c86c178f3fa4eaf02c85a5a52483, type: 3}
--- !u!1 &4034742416722845544 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 559249220493193855, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3}
m_PrefabInstance: {fileID: 3475814546757545239}
m_PrefabAsset: {fileID: 0}
--- !u!114 &5359066805285415221
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4034742416722845544}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 340a7e6b686c4c94cb41f152b28a7ddb, type: 3}
m_Name:
m_EditorClassIdentifier:
ID: 1
--- !u!4 &4758905883472368624 stripped --- !u!4 &4758905883472368624 stripped
Transform: Transform:
m_CorrespondingSourceObject: {fileID: 8230210971042152167, guid: 9069c86c178f3fa4eaf02c85a5a52483, m_CorrespondingSourceObject: {fileID: 8230210971042152167, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3} type: 3}
m_PrefabInstance: {fileID: 3475814546757545239} m_PrefabInstance: {fileID: 3475814546757545239}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!1 &6420765462307702573 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 7577225840038832698, guid: 9069c86c178f3fa4eaf02c85a5a52483,
type: 3}
m_PrefabInstance: {fileID: 3475814546757545239}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &3628687219884289774 --- !u!1001 &3628687219884289774
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -29342,16 +29204,36 @@ PrefabInstance:
propertyPath: TextShow propertyPath: TextShow
value: value:
objectReference: {fileID: 8309287144247319774} objectReference: {fileID: 8309287144247319774}
- target: {fileID: 7764968720947879535, guid: f4b26a7999d583848bd57077f2a92c42,
type: 3}
propertyPath: OnGameInit.m_PersistentCalls.m_Calls.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7764968720947879535, guid: f4b26a7999d583848bd57077f2a92c42, - target: {fileID: 7764968720947879535, guid: f4b26a7999d583848bd57077f2a92c42,
type: 3} type: 3}
propertyPath: OnGameStarted.m_PersistentCalls.m_Calls.Array.size propertyPath: OnGameStarted.m_PersistentCalls.m_Calls.Array.size
value: 2 value: 2
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7764968720947879535, guid: f4b26a7999d583848bd57077f2a92c42,
type: 3}
propertyPath: OnGameInit.m_PersistentCalls.m_Calls.Array.data[0].m_Mode
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7764968720947879535, guid: f4b26a7999d583848bd57077f2a92c42,
type: 3}
propertyPath: OnGameInit.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 6420765462307702573}
- target: {fileID: 7764968720947879535, guid: f4b26a7999d583848bd57077f2a92c42, - target: {fileID: 7764968720947879535, guid: f4b26a7999d583848bd57077f2a92c42,
type: 3} type: 3}
propertyPath: OnGameStarted.m_PersistentCalls.m_Calls.Array.data[1].m_Mode propertyPath: OnGameStarted.m_PersistentCalls.m_Calls.Array.data[1].m_Mode
value: 6 value: 6
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7764968720947879535, guid: f4b26a7999d583848bd57077f2a92c42,
type: 3}
propertyPath: OnGameInit.m_PersistentCalls.m_Calls.Array.data[0].m_CallState
value: 2
objectReference: {fileID: 0}
- target: {fileID: 7764968720947879535, guid: f4b26a7999d583848bd57077f2a92c42, - target: {fileID: 7764968720947879535, guid: f4b26a7999d583848bd57077f2a92c42,
type: 3} type: 3}
propertyPath: OnGameStarted.m_PersistentCalls.m_Calls.Array.data[0].m_Target propertyPath: OnGameStarted.m_PersistentCalls.m_Calls.Array.data[0].m_Target

View File

@ -282,8 +282,8 @@ RectTransform:
m_Father: {fileID: 7682806385198460840} m_Father: {fileID: 7682806385198460840}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.26666668, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0.26666668, y: 1} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: 0} m_SizeDelta: {x: 20, y: 0}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
@ -337,6 +337,7 @@ GameObject:
- component: {fileID: 2089166003001169475} - component: {fileID: 2089166003001169475}
- component: {fileID: 6208157545481689163} - component: {fileID: 6208157545481689163}
- component: {fileID: 6134174670488007861} - component: {fileID: 6134174670488007861}
- component: {fileID: 5359066805285415221}
m_Layer: 0 m_Layer: 0
m_Name: AdminPanel m_Name: AdminPanel
m_TagString: Untagged m_TagString: Untagged
@ -428,6 +429,19 @@ MonoBehaviour:
m_BlockingMask: m_BlockingMask:
serializedVersion: 2 serializedVersion: 2
m_Bits: 4294967295 m_Bits: 4294967295
--- !u!114 &5359066805285415221
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 559249220493193855}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 340a7e6b686c4c94cb41f152b28a7ddb, type: 3}
m_Name:
m_EditorClassIdentifier:
ID: 1
--- !u!1 &863467756270093535 --- !u!1 &863467756270093535
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -610,7 +624,7 @@ RectTransform:
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0.26666668, y: 1} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 10, y: 0} m_SizeDelta: {x: 10, y: 0}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
@ -804,8 +818,8 @@ RectTransform:
m_Father: {fileID: 485911263691430993} m_Father: {fileID: 485911263691430993}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.055555556, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0.055555556, y: 1} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: 0} m_SizeDelta: {x: 20, y: 0}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
@ -880,8 +894,8 @@ RectTransform:
m_Father: {fileID: 7665611880730118594} m_Father: {fileID: 7665611880730118594}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.4857143, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0.4857143, y: 1} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: 0} m_SizeDelta: {x: 20, y: 0}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
@ -957,7 +971,7 @@ RectTransform:
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0.4857143, y: 1} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 10, y: 0} m_SizeDelta: {x: 10, y: 0}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
@ -1169,7 +1183,7 @@ RectTransform:
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0.055555556, y: 1} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 10, y: 0} m_SizeDelta: {x: 10, y: 0}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
@ -1807,6 +1821,172 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -20, y: 0} m_SizeDelta: {x: -20, y: 0}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!1001 &7141295739062107379
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 7577225839406871958}
m_Modifications:
- target: {fileID: 7994773461938888799, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
propertyPath: m_SizeDelta.x
value: -1365.6963
objectReference: {fileID: 0}
- target: {fileID: 7994773461938888799, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
propertyPath: m_AnchoredPosition.x
value: -682.848
objectReference: {fileID: 0}
- target: {fileID: 7994773461938888799, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7994773462540899081, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
propertyPath: m_SizeDelta.x
value: -1063.6727
objectReference: {fileID: 0}
- target: {fileID: 7994773462540899081, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
propertyPath: m_AnchoredPosition.x
value: -19.894531
objectReference: {fileID: 0}
- target: {fileID: 7994773463262829946, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
propertyPath: m_Name
value: LeaderboardEntry
objectReference: {fileID: 0}
- target: {fileID: 7994773463262829947, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 7994773463262829947, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
propertyPath: m_Pivot.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7994773463262829947, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7994773463262829947, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
propertyPath: m_AnchorMax.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7994773463262829947, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7994773463262829947, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7994773463262829947, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7994773463262829947, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
propertyPath: m_SizeDelta.x
value: -72.54
objectReference: {fileID: 0}
- target: {fileID: 7994773463262829947, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
propertyPath: m_SizeDelta.y
value: 101
objectReference: {fileID: 0}
- target: {fileID: 7994773463262829947, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7994773463262829947, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7994773463262829947, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7994773463262829947, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7994773463262829947, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7994773463262829947, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7994773463262829947, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7994773463262829947, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7994773463262829947, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -114
objectReference: {fileID: 0}
- target: {fileID: 7994773463262829947, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7994773463262829947, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7994773463262829947, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7994773463554530819, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
propertyPath: m_SizeDelta.x
value: -1329.5146
objectReference: {fileID: 0}
- target: {fileID: 7994773463554530819, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 664.7573
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: df884eee90d52834fafe614d8ea96f6e, type: 3}
--- !u!114 &1002577274514350469 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 7994773463262829942, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
m_PrefabInstance: {fileID: 7141295739062107379}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4719251d53b536849a7ec434a7ec7b4e, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &9161739376773148828 --- !u!1001 &9161739376773148828
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1814,6 +1994,10 @@ PrefabInstance:
m_Modification: m_Modification:
m_TransformParent: {fileID: 8230210971042152167} m_TransformParent: {fileID: 8230210971042152167}
m_Modifications: m_Modifications:
- target: {fileID: 1153622005, guid: 59bb54bf798778349a37c58fbf18880c, type: 3}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1586040769430497332, guid: 59bb54bf798778349a37c58fbf18880c, - target: {fileID: 1586040769430497332, guid: 59bb54bf798778349a37c58fbf18880c,
type: 3} type: 3}
propertyPath: m_SizeDelta.y propertyPath: m_SizeDelta.y
@ -1822,7 +2006,7 @@ PrefabInstance:
- target: {fileID: 1586040769430497332, guid: 59bb54bf798778349a37c58fbf18880c, - target: {fileID: 1586040769430497332, guid: 59bb54bf798778349a37c58fbf18880c,
type: 3} type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: 0 value: -0.000030517578
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1586040769617182248, guid: 59bb54bf798778349a37c58fbf18880c, - target: {fileID: 1586040769617182248, guid: 59bb54bf798778349a37c58fbf18880c,
type: 3} type: 3}
@ -2009,16 +2193,23 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2091942706723991223, guid: 59bb54bf798778349a37c58fbf18880c,
type: 3}
propertyPath: _currentPlayerLeaderboardEntry
value:
objectReference: {fileID: 1002577274514350469}
- target: {fileID: 7895390879892479916, guid: 59bb54bf798778349a37c58fbf18880c, - target: {fileID: 7895390879892479916, guid: 59bb54bf798778349a37c58fbf18880c,
type: 3} type: 3}
propertyPath: m_Enabled propertyPath: m_Enabled
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents:
- {fileID: 1153622006, guid: 59bb54bf798778349a37c58fbf18880c, type: 3}
- {fileID: 1153622005, guid: 59bb54bf798778349a37c58fbf18880c, type: 3}
m_SourcePrefab: {fileID: 100100000, guid: 59bb54bf798778349a37c58fbf18880c, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 59bb54bf798778349a37c58fbf18880c, type: 3}
--- !u!224 &7577225838663604392 stripped --- !u!224 &7577225839406871958 stripped
RectTransform: RectTransform:
m_CorrespondingSourceObject: {fileID: 1586040769430497332, guid: 59bb54bf798778349a37c58fbf18880c, m_CorrespondingSourceObject: {fileID: 1586040770039923978, guid: 59bb54bf798778349a37c58fbf18880c,
type: 3} type: 3}
m_PrefabInstance: {fileID: 9161739376773148828} m_PrefabInstance: {fileID: 9161739376773148828}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
@ -2028,26 +2219,3 @@ RectTransform:
type: 3} type: 3}
m_PrefabInstance: {fileID: 9161739376773148828} m_PrefabInstance: {fileID: 9161739376773148828}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!1 &7577225840038832698 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1586040770268846758, guid: 59bb54bf798778349a37c58fbf18880c,
type: 3}
m_PrefabInstance: {fileID: 9161739376773148828}
m_PrefabAsset: {fileID: 0}
--- !u!114 &3436706815620792752
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7577225840038832698}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0ed63b8d95151544089de4eeed8c9b1a, type: 3}
m_Name:
m_EditorClassIdentifier:
_content: {fileID: 7577225838663604392}
_leaderboardEntryPrefab: {fileID: 7994773463262829942, guid: df884eee90d52834fafe614d8ea96f6e,
type: 3}
_abovePlayersCount: 6
_totalPlayersCount: 10

View File

@ -187,12 +187,14 @@ MonoBehaviour:
ScreenFadeTime: 0.5 ScreenFadeTime: 0.5
AllMapsLevelNames: AllMapsLevelNames:
- Monument_1 - Monument_1
- ResultScene
- Monument_2 - Monument_2
- Monument_3 - Monument_3
- Monument_4 - Monument_4
- Monument_5 - Monument_5
- Monument_6 - Monument_6
- Monument_7
- Monument_8
ResultSceneName: ResultScene
--- !u!1 &7385619826042139056 --- !u!1 &7385619826042139056
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -7,6 +7,5 @@ public class ResultSceneManager : MonoBehaviour
private void Start() private void Start()
{ {
LeaderboardController.Instance.SaveData(); LeaderboardController.Instance.SaveData();
GlobalSettings.Instance.AllMaps = false;
} }
} }

File diff suppressed because one or more lines are too long

View File

@ -11,6 +11,9 @@ public class DailyLeaderboard : MonoBehaviour
protected RectTransform _content; protected RectTransform _content;
[SerializeField] [SerializeField]
protected LeaderboardEntry _leaderboardEntryPrefab; protected LeaderboardEntry _leaderboardEntryPrefab;
[SerializeField]
private LeaderboardEntry _currentPlayerLeaderboardEntry;
protected List<LeaderboardEntry> _entries = new List<LeaderboardEntry>(); protected List<LeaderboardEntry> _entries = new List<LeaderboardEntry>();
private List<Player> _players = new List<Player>(); private List<Player> _players = new List<Player>();
@ -22,6 +25,15 @@ public class DailyLeaderboard : MonoBehaviour
private void Awake() private void Awake()
{ {
_leaderboardController = FindObjectOfType<LeaderboardController>(); _leaderboardController = FindObjectOfType<LeaderboardController>();
if (_currentPlayerLeaderboardEntry != null)
{
if (GlobalSettings.Instance.AllMaps)
_currentPlayerLeaderboardEntry.gameObject.SetActive(true);
else
_currentPlayerLeaderboardEntry.gameObject.SetActive(false);
}
} }
private void OnEnable() private void OnEnable()
@ -46,12 +58,23 @@ public class DailyLeaderboard : MonoBehaviour
_entries.Clear(); _entries.Clear();
_entries = new List<LeaderboardEntry>(); _entries = new List<LeaderboardEntry>();
int currentPlayerIndex = int.MaxValue;
for (int i = 0; i < _players.Count; i++) for (int i = 0; i < _players.Count; i++)
{ {
var newEntry = Instantiate(_leaderboardEntryPrefab, _content); var newEntry = Instantiate(_leaderboardEntryPrefab, _content);
_entries.Add(newEntry); _entries.Add(newEntry);
newEntry.Init(_players[i], i, _players[i] == PlayerSetup.Instance.CurrentPlayer); newEntry.Init(_players[i], i, _players[i] == PlayerSetup.Instance.CurrentPlayer);
if (_players[i] == PlayerSetup.Instance.CurrentPlayer)
currentPlayerIndex = i;
} }
if (_currentPlayerLeaderboardEntry != null)
{
_currentPlayerLeaderboardEntry.Init(PlayerSetup.Instance.CurrentPlayer, currentPlayerIndex, true);
}
OnUpdated?.Invoke(); OnUpdated?.Invoke();
} }
} }

View File

@ -53,7 +53,7 @@ public class DeviceDisconnectController : MonoBehaviour
UIInfoDisplay.Instance.ShowInfo(DisplayMessageType.DeviceLost); UIInfoDisplay.Instance.ShowInfo(DisplayMessageType.DeviceLost);
Debug.Log("Íàäåíüòå øëåì"); Debug.Log("Íàäåíüòå øëåì");
yield return new WaitForSeconds(15); yield return new WaitForSeconds(15);
SceneLoader.Instance.LoadScene("StartScene"); SceneLoader.Instance.LoadStartScene();
OnTotalDisconnect?.Invoke(); OnTotalDisconnect?.Invoke();
} }
} }

View File

@ -39,9 +39,9 @@ public class EndGameModule : MonoBehaviour
if (GlobalSettings.Instance.AllMaps) if (GlobalSettings.Instance.AllMaps)
_textTimer.ShowTimer(3, string.Empty, 0, null, () => { BNG.SceneLoader.Instance.ChangeLevel(); }); _textTimer.ShowTimer(3, string.Empty, 0, null, () => { BNG.SceneLoader.Instance.ChangeLevel(); });
else else
_textTimer.ShowTimer(3, string.Empty, 0, null, () => { BNG.SceneLoader.Instance.LoadScene("StartScene"); }); _textTimer.ShowTimer(3, string.Empty, 0, null, () => { BNG.SceneLoader.Instance.LoadStartScene(); });
} }
else else
_textTimer.ShowTimer(3, string.Empty, 0, null, () => { BNG.SceneLoader.Instance.LoadScene("StartScene"); }); _textTimer.ShowTimer(3, string.Empty, 0, null, () => { BNG.SceneLoader.Instance.LoadStartScene(); });
} }
} }

View File

@ -17,12 +17,12 @@ public class GameManager : MonoBehaviour
{ {
public static GameManager Instance { get; private set; } public static GameManager Instance { get; private set; }
private EnergyController _energyController;
private vTimerCounter _timerCounter; private vTimerCounter _timerCounter;
private EndGameModule _endGameModule; private EndGameModule _endGameModule;
private bool _successEnd; private bool _successEnd;
public UnityEvent OnGameInit;
public UnityEvent OnGameStarted; public UnityEvent OnGameStarted;
public UnityEvent OnGameEnded; public UnityEvent OnGameEnded;
@ -58,6 +58,8 @@ public class GameManager : MonoBehaviour
{ {
_endGameModule = FindObjectOfType<EndGameModule>(); _endGameModule = FindObjectOfType<EndGameModule>();
_timerCounter = FindObjectOfType<vTimerCounter>(); _timerCounter = FindObjectOfType<vTimerCounter>();
LeaderboardController.Instance.RefreshEntries();
OnGameInit?.Invoke();
} }
public void ChangeState(GameState newState) public void ChangeState(GameState newState)
@ -66,9 +68,6 @@ public class GameManager : MonoBehaviour
return; return;
CurrentGameState = newState; CurrentGameState = newState;
Debug.Log(newState);
switch (CurrentGameState) switch (CurrentGameState)
{ {
case GameState.Started: case GameState.Started:

View File

@ -93,6 +93,12 @@ public class LeaderboardController : MonoBehaviour
yield return null; yield return null;
} }
public void RefreshEntries()
{
RefreshDailyEntries();
RefreshGlobalEntries();
}
private void RefreshDailyEntries() private void RefreshDailyEntries()
{ {
_dailyPlayerInfo.Players = _dailyPlayerInfo.Players.OrderByDescending(x => x.Score).ToList(); _dailyPlayerInfo.Players = _dailyPlayerInfo.Players.OrderByDescending(x => x.Score).ToList();

View File

@ -16,6 +16,8 @@ public class LeaderboardEntry : MonoBehaviour
public Color SelectColor; public Color SelectColor;
public int MaxIndex = 29;
[SerializeField] [SerializeField]
private List<GameObject> _medals = new List<GameObject>(); private List<GameObject> _medals = new List<GameObject>();
@ -26,8 +28,11 @@ public class LeaderboardEntry : MonoBehaviour
_medals[index].SetActive(true); _medals[index].SetActive(true);
} }
if (index <= MaxIndex)
_numText.SetText($"{index + 1}"); _numText.SetText($"{index + 1}");
_nameText.SetText(player.Name); else
_numText.SetText($"-");
_scoreText.SetText($"{player.Score}"); _scoreText.SetText($"{player.Score}");
if (selected) if (selected)
@ -35,5 +40,9 @@ public class LeaderboardEntry : MonoBehaviour
_background.color = SelectColor; _background.color = SelectColor;
_nameText.SetText("ÂÛ"); _nameText.SetText("ÂÛ");
} }
else
{
_nameText.SetText(player.Name);
}
} }
} }

View File

@ -36,8 +36,8 @@ public class StartGameSlot : MonoBehaviour
void LoadSelectedLevel() void LoadSelectedLevel()
{ {
GlobalSettings.Instance.AllMaps = isAllMapsMode; GlobalSettings.Instance.AllMaps = isAllMapsMode;
SceneLoader.Instance.LoadScene(level);
PlayerSetup.Instance.CreateNewPlayer(); PlayerSetup.Instance.CreateNewPlayer();
SceneLoader.Instance.LoadTournament();
} }
grab.GetComponent<SnapZoneHelper>().SnapObject(); grab.GetComponent<SnapZoneHelper>().SnapObject();

View File

@ -56,7 +56,7 @@ public class UITextShow : MonoBehaviour
_text.SetText(afterTimerText); _text.SetText(afterTimerText);
yield return new WaitForSeconds(afterDelay); yield return new WaitForSeconds(afterDelay);
_text.SetText(string.Empty); //_text.SetText(string.Empty);
OnTimeEnd?.Invoke(); OnTimeEnd?.Invoke();
onEnd?.Invoke(); onEnd?.Invoke();
} }