diff --git a/Unity-Files/Assets/Examples/Defender/Defender.unity b/Unity-Files/Assets/Examples/Defender/Defender.unity index 4820830..a6bf50b 100644 --- a/Unity-Files/Assets/Examples/Defender/Defender.unity +++ b/Unity-Files/Assets/Examples/Defender/Defender.unity @@ -308,10 +308,10 @@ RectTransform: m_Father: {fileID: 1059183747} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 500, y: -125} - m_SizeDelta: {x: 1000, y: 50} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 50} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &204554430 CanvasRenderer: @@ -435,10 +435,10 @@ RectTransform: m_Father: {fileID: 1059183747} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 500, y: -430} - m_SizeDelta: {x: 1000, y: 80} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 80} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &222835919 MonoBehaviour: @@ -462,19 +462,18 @@ MonoBehaviour: m_Calls: [] m_FontData: m_Font: {fileID: 12800000, guid: 2fb810d2f9fc27b4eb7693fd3f9f158c, type: 3} - m_FontSize: 100 + m_FontSize: 29 m_FontStyle: 0 - m_BestFit: 1 + m_BestFit: 0 m_MinSize: 0 m_MaxSize: 249 - m_Alignment: 4 - m_AlignByGeometry: 1 + m_Alignment: 3 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 m_LineSpacing: 1 - m_Text: 4th AAA 111 - 222 + m_Text: 4th --- !u!222 &222835920 CanvasRenderer: m_ObjectHideFlags: 0 @@ -697,10 +696,10 @@ RectTransform: m_Father: {fileID: 1059183747} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 500, y: -50} - m_SizeDelta: {x: 1000, 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: 100} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &289906080 MonoBehaviour: @@ -776,10 +775,10 @@ RectTransform: m_Father: {fileID: 1059183747} m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 500, y: -510} - m_SizeDelta: {x: 1000, y: 80} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 80} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &303121901 MonoBehaviour: @@ -803,19 +802,18 @@ MonoBehaviour: m_Calls: [] m_FontData: m_Font: {fileID: 12800000, guid: 2fb810d2f9fc27b4eb7693fd3f9f158c, type: 3} - m_FontSize: 100 + m_FontSize: 29 m_FontStyle: 0 - m_BestFit: 1 + m_BestFit: 0 m_MinSize: 0 m_MaxSize: 249 - m_Alignment: 4 - m_AlignByGeometry: 1 + m_Alignment: 3 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 m_LineSpacing: 1 - m_Text: 5th AAA 111 - 222 + m_Text: 5th --- !u!222 &303121902 CanvasRenderer: m_ObjectHideFlags: 0 @@ -855,9 +853,9 @@ RectTransform: m_Father: {fileID: 873720541} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 500, y: -215} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 1000, y: 50} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &328545999 @@ -1390,10 +1388,10 @@ RectTransform: m_Father: {fileID: 1059183747} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 500, y: -350} - m_SizeDelta: {x: 1000, y: 80} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 80} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &615826098 MonoBehaviour: @@ -1417,19 +1415,18 @@ MonoBehaviour: m_Calls: [] m_FontData: m_Font: {fileID: 12800000, guid: 2fb810d2f9fc27b4eb7693fd3f9f158c, type: 3} - m_FontSize: 100 + m_FontSize: 29 m_FontStyle: 0 - m_BestFit: 1 + m_BestFit: 0 m_MinSize: 0 m_MaxSize: 249 - m_Alignment: 4 - m_AlignByGeometry: 1 + m_Alignment: 3 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 m_LineSpacing: 1 - m_Text: 3rd AAA 111 - 222 + m_Text: 3rd --- !u!222 &615826099 CanvasRenderer: m_ObjectHideFlags: 0 @@ -1653,9 +1650,9 @@ RectTransform: m_Father: {fileID: 873720541} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 500, y: -145} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 1000, y: 90} m_Pivot: {x: 0.5, y: 0.5} --- !u!95 &720830518 @@ -1753,9 +1750,9 @@ RectTransform: m_Father: {fileID: 873720541} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 500, y: -290} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 1000, y: 100} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &839555745 @@ -2605,9 +2602,9 @@ RectTransform: m_Father: {fileID: 873720541} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 500, y: -50} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 1000, y: 100} m_Pivot: {x: 0.5, y: 0.5} --- !u!95 &1083330063 @@ -2703,10 +2700,10 @@ RectTransform: m_Father: {fileID: 1059183747} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 500, y: -190} - m_SizeDelta: {x: 1000, y: 80} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 80} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1433312461 MonoBehaviour: @@ -2730,19 +2727,18 @@ MonoBehaviour: m_Calls: [] m_FontData: m_Font: {fileID: 12800000, guid: 2fb810d2f9fc27b4eb7693fd3f9f158c, type: 3} - m_FontSize: 100 + m_FontSize: 29 m_FontStyle: 0 - m_BestFit: 1 + m_BestFit: 0 m_MinSize: 0 m_MaxSize: 249 - m_Alignment: 4 - m_AlignByGeometry: 1 + m_Alignment: 3 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 m_LineSpacing: 1 - m_Text: 1st AAA 111 - 222 + m_Text: '1st ' --- !u!222 &1433312462 CanvasRenderer: m_ObjectHideFlags: 0 @@ -3012,9 +3008,9 @@ RectTransform: m_Father: {fileID: 873720541} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 500, y: -365} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 1000, y: 50} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1714273385 @@ -3893,7 +3889,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!210 &1891273396 SortingGroup: m_ObjectHideFlags: 0 @@ -4410,10 +4406,10 @@ RectTransform: m_Father: {fileID: 1059183747} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 500, y: -270} - m_SizeDelta: {x: 1000, y: 80} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 80} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &2084735052 MonoBehaviour: @@ -4437,19 +4433,18 @@ MonoBehaviour: m_Calls: [] m_FontData: m_Font: {fileID: 12800000, guid: 2fb810d2f9fc27b4eb7693fd3f9f158c, type: 3} - m_FontSize: 100 + m_FontSize: 29 m_FontStyle: 0 - m_BestFit: 1 + m_BestFit: 0 m_MinSize: 0 m_MaxSize: 249 - m_Alignment: 4 - m_AlignByGeometry: 1 + m_Alignment: 3 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 m_LineSpacing: 1 - m_Text: 2nd AAA 111 - 222 + m_Text: 2nd --- !u!222 &2084735053 CanvasRenderer: m_ObjectHideFlags: 0 @@ -4493,9 +4488,9 @@ RectTransform: m_Father: {fileID: 873720541} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 500, y: -433.41} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 300, y: 86.82} m_Pivot: {x: 0.5, y: 0.5} --- !u!95 &2086538274 diff --git a/Unity-Files/Assets/Scripts/Menu/LeaderboardHandle.cs b/Unity-Files/Assets/Scripts/Menu/LeaderboardHandle.cs index 73513d2..e6de9bd 100644 --- a/Unity-Files/Assets/Scripts/Menu/LeaderboardHandle.cs +++ b/Unity-Files/Assets/Scripts/Menu/LeaderboardHandle.cs @@ -34,7 +34,7 @@ public class LeaderboardHandle : MonoBehaviour for (int i = 0; i < Scores.Count; i++) { Text scoreLabel = GameObject.Find($"ScoreText ({i + 1})").GetComponent(); - string editedText = scoreLabel.text.Replace("AAA", $"{Scores[i].username}").Replace("111", $"{Scores[i].score}").Replace("222", $"{Scores[i].timeLasted}"); + string editedText = System.String.Format("{0,3} {1,22} {2,22} {3,22}", scoreLabel.text, Scores[i].username, Scores[i].score, Scores[i].timeLasted); scoreLabel.text = editedText; } } @@ -67,7 +67,7 @@ public class LeaderboardHandle : MonoBehaviour using (MySqlConnection connection = new MySqlConnection(connectionString)) { connection.Open(); - string sql = "SELECT * FROM Scores ORDER BY Score DESC LIMIT 5"; + string sql = "SELECT Username, Score, TimeLasted FROM Scores ORDER BY Score DESC LIMIT 5"; using (MySqlCommand command = new MySqlCommand(sql, connection)) { using (MySqlDataReader reader = command.ExecuteReader())