From bae7572ac6cb5f71da0eec7f138bb740bc5a1535 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 16 May 2024 17:41:01 +0100 Subject: [PATCH] :construction: 2.2.1 Release bits - Fixed issues with the demo scene reported by a user in the discord server. - Fixed comparing time values for display throwing an error and not actually sorting the value correctly. - Fixed version validation not having the latest newer version response bits in. --- .../Version Validation/VersionChecker.cs | 18 +- .../Systems/Version Validation/VersionData.cs | 29 +- .../Version Validation/VersionEditorGUI.cs | 29 +- .../Code/Editor/Utility/AssetVersionData.cs | 4 +- .../Runtime/Data/Time/LeaderboardEntryTime.cs | 2 - .../Time/Serialization/SerializableTime.cs | 13 +- .../Leaderboard Manager Demo Scene.unity | 933 +++++++++++------- .../~Samples/Demo/Scripts/ExampleManager.cs | 80 +- 8 files changed, 726 insertions(+), 382 deletions(-) diff --git a/Carter Games/Leaderboard Manager/Code/Editor/Systems/Version Validation/VersionChecker.cs b/Carter Games/Leaderboard Manager/Code/Editor/Systems/Version Validation/VersionChecker.cs index 8bba144..0657a63 100644 --- a/Carter Games/Leaderboard Manager/Code/Editor/Systems/Version Validation/VersionChecker.cs +++ b/Carter Games/Leaderboard Manager/Code/Editor/Systems/Version Validation/VersionChecker.cs @@ -1,20 +1,20 @@ /* * Copyright (c) 2024 Carter Games - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * - * + * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN @@ -46,7 +46,13 @@ public static class VersionChecker /// Gets if the latest version is this version. /// public static bool IsLatestVersion => Versions.Data.Match(VersionInfo.ProjectVersionNumber); - + + + /// + /// Gets if the version here is higher that the latest version. + /// + public static bool IsNewerVersion => Versions.Data.IsHigherVersion(VersionInfo.ProjectVersionNumber); + /// /// Gets the version data downloaded. diff --git a/Carter Games/Leaderboard Manager/Code/Editor/Systems/Version Validation/VersionData.cs b/Carter Games/Leaderboard Manager/Code/Editor/Systems/Version Validation/VersionData.cs index 39f1b04..c3aeb6c 100644 --- a/Carter Games/Leaderboard Manager/Code/Editor/Systems/Version Validation/VersionData.cs +++ b/Carter Games/Leaderboard Manager/Code/Editor/Systems/Version Validation/VersionData.cs @@ -1,20 +1,20 @@ /* * Copyright (c) 2024 Carter Games - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * - * + * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN @@ -95,5 +95,24 @@ public bool Match(string toCompare) return aVN.Major.Equals(bVN.Major) && aVN.Minor.Equals(bVN.Minor) && aVN.Patch.Equals(bVN.Patch); } + + + /// + /// Gets if the entry is a higher version than the converted version. + /// + /// The version string to compare. + /// If the entry is greater on any (major/minor/patch) value. + public bool IsHigherVersion(string toCompare) + { + var aVN = VersionNumber; + var bVN = new VersionNumber(toCompare); + + if (Match(toCompare)) + { + return false; + } + + return (aVN.Major < bVN.Major) || (aVN.Minor < bVN.Minor) || (aVN.Patch < bVN.Patch); + } } } \ No newline at end of file diff --git a/Carter Games/Leaderboard Manager/Code/Editor/Systems/Version Validation/VersionEditorGUI.cs b/Carter Games/Leaderboard Manager/Code/Editor/Systems/Version Validation/VersionEditorGUI.cs index 8c9f3d8..033e728 100644 --- a/Carter Games/Leaderboard Manager/Code/Editor/Systems/Version Validation/VersionEditorGUI.cs +++ b/Carter Games/Leaderboard Manager/Code/Editor/Systems/Version Validation/VersionEditorGUI.cs @@ -1,20 +1,20 @@ /* * Copyright (c) 2024 Carter Games - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * - * + * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN @@ -43,10 +43,11 @@ public static void DrawCheckForUpdatesButton() if (!GUILayout.Button("Check For Updates", GUILayout.MaxWidth(135))) return; VersionChecker.GetLatestVersions(); + VersionChecker.ResponseReceived.AddAnonymous("versionCheckManual", () => ShowResponseDialogue()); } - - + + /// /// Shows the response to a version check call as a dialogue box. /// @@ -55,9 +56,16 @@ public static void ShowResponseDialogue(bool showIfUptoDate = true) { VersionChecker.ResponseReceived.RemoveAnonymous("versionCheckManual"); - if (!VersionChecker.IsLatestVersion) + if (VersionChecker.IsNewerVersion) + { + if (!showIfUptoDate) return; + EditorUtility.DisplayDialog("Update Checker", + $"You are using a newer version than the currently released one.\n\nYours: {VersionInfo.ProjectVersionNumber}\nLatest: {VersionChecker.LatestVersionNumberString}", + "Continue"); + } + else if (!VersionChecker.IsLatestVersion) { - if (EditorUtility.DisplayDialog($"{VersionInfo.Key} | Update Checker", + if (EditorUtility.DisplayDialog("Update Checker", $"You are using an older version of this package.\n\nCurrent: {VersionInfo.ProjectVersionNumber}\nLatest: {VersionChecker.LatestVersionNumberString}", "Latest Release", "Continue")) { @@ -67,8 +75,7 @@ public static void ShowResponseDialogue(bool showIfUptoDate = true) else { if (!showIfUptoDate) return; - - EditorUtility.DisplayDialog($"{VersionInfo.Key} | Update Checker", + EditorUtility.DisplayDialog("Update Checker", "You are using the latest version!", "Continue"); } diff --git a/Carter Games/Leaderboard Manager/Code/Editor/Utility/AssetVersionData.cs b/Carter Games/Leaderboard Manager/Code/Editor/Utility/AssetVersionData.cs index a6d5b54..bbe66e0 100644 --- a/Carter Games/Leaderboard Manager/Code/Editor/Utility/AssetVersionData.cs +++ b/Carter Games/Leaderboard Manager/Code/Editor/Utility/AssetVersionData.cs @@ -31,7 +31,7 @@ public static class AssetVersionData /// /// The version number of the asset. /// - public static string VersionNumber => "2.2.0"; + public static string VersionNumber => "2.2.1"; /// @@ -40,6 +40,6 @@ public static class AssetVersionData /// /// Asset owner is in the UK, so its D/M/Y format. /// - public static string ReleaseDate => "31/03/2024"; + public static string ReleaseDate => "16/05/2024"; } } \ No newline at end of file diff --git a/Carter Games/Leaderboard Manager/Code/Runtime/Data/Time/LeaderboardEntryTime.cs b/Carter Games/Leaderboard Manager/Code/Runtime/Data/Time/LeaderboardEntryTime.cs index 4b788f5..3848668 100644 --- a/Carter Games/Leaderboard Manager/Code/Runtime/Data/Time/LeaderboardEntryTime.cs +++ b/Carter Games/Leaderboard Manager/Code/Runtime/Data/Time/LeaderboardEntryTime.cs @@ -126,8 +126,6 @@ public LeaderboardEntryTime(string name, SerializableTime time) /// The formatted string. public string ValueFormatted(DisplayTimeFormat format) { - Debug.Log(EntryValueAsTime.TotalSeconds); - switch (format) { case DisplayTimeFormat.SecondsOnly: diff --git a/Carter Games/Leaderboard Manager/Code/Runtime/Data/Time/Serialization/SerializableTime.cs b/Carter Games/Leaderboard Manager/Code/Runtime/Data/Time/Serialization/SerializableTime.cs index a5d13db..fc15250 100644 --- a/Carter Games/Leaderboard Manager/Code/Runtime/Data/Time/Serialization/SerializableTime.cs +++ b/Carter Games/Leaderboard Manager/Code/Runtime/Data/Time/Serialization/SerializableTime.cs @@ -31,7 +31,7 @@ namespace CarterGames.Assets.LeaderboardManager.Serialization /// Stored a time value in a readable format. /// [Serializable] - public struct SerializableTime + public struct SerializableTime : IComparable { /* ───────────────────────────────────────────────────────────────────────────────────────────────────────────── | Fields @@ -277,7 +277,7 @@ public override string ToString() return date.ToString(CultureInfo.InvariantCulture); } - + public string ToString(string format) { var date = new DateTime(); @@ -300,5 +300,14 @@ public string ToString(string format, IFormatProvider provider) date = date.AddTicks(Ticks); return date.ToString(format, provider); } + + + public int CompareTo(object obj) + { + if (obj == null) return 1; + + if (Ticks > ((SerializableTime) obj).Ticks) return 1; + return Ticks < ((SerializableTime) obj).Ticks ? -1 : 0; + } } } \ No newline at end of file diff --git a/Carter Games/Leaderboard Manager/~Samples/Demo/Scenes/Leaderboard Manager Demo Scene.unity b/Carter Games/Leaderboard Manager/~Samples/Demo/Scenes/Leaderboard Manager Demo Scene.unity index 937350d..e699c8f 100644 --- a/Carter Games/Leaderboard Manager/~Samples/Demo/Scenes/Leaderboard Manager Demo Scene.unity +++ b/Carter Games/Leaderboard Manager/~Samples/Demo/Scenes/Leaderboard Manager Demo Scene.unity @@ -152,7 +152,7 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 2111730438} + - {fileID: 61203376} - {fileID: 1075927386} - {fileID: 1740993440} - {fileID: 1378021147} @@ -202,6 +202,44 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 27545902} m_CullTransparentMesh: 0 +--- !u!1 &61203375 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 61203376} + m_Layer: 5 + m_Name: Board Toggles + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &61203376 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 61203375} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1227265314} + - {fileID: 2133781966} + - {fileID: 1781066231} + m_Father: {fileID: 27545903} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0.000015259, y: 306.06} + m_SizeDelta: {x: 436.6, y: 122.77} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &70285640 GameObject: m_ObjectHideFlags: 0 @@ -298,6 +336,85 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &119766647 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 119766648} + - component: {fileID: 119766650} + - component: {fileID: 119766649} + m_Layer: 5 + m_Name: Time Toggle Label + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &119766648 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 119766647} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.5, y: 0.5, z: 1} + m_Children: [] + m_Father: {fileID: 1781066231} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -0.000030517578, y: -0.0000076293945} + m_SizeDelta: {x: 193.73, y: 58.694} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &119766649 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 119766647} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 65 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 5 + m_MaxSize: 65 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Time +--- !u!222 &119766650 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 119766647} + m_CullTransparentMesh: 1 --- !u!1 &177038617 GameObject: m_ObjectHideFlags: 0 @@ -752,7 +869,7 @@ MonoBehaviour: m_OnClick: m_PersistentCalls: m_Calls: - - m_Target: {fileID: 904782688} + - m_Target: {fileID: 0} m_TargetAssemblyTypeName: CarterGames.Assets.LeaderboardManager.LeaderboardDisplay, CarterGames.Assets.LeaderboardManager.Runtime m_MethodName: ClearDisplay @@ -975,6 +1092,85 @@ MonoBehaviour: m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5} m_EffectDistance: {x: 0, y: -2.5} m_UseGraphicAlpha: 1 +--- !u!1 &313765304 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 313765305} + - component: {fileID: 313765307} + - component: {fileID: 313765306} + m_Layer: 5 + m_Name: Score Toggle Label + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &313765305 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 313765304} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.5, y: 0.5, z: 1} + m_Children: [] + m_Father: {fileID: 2133781966} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -0.000030517578, y: -0.0000076293945} + m_SizeDelta: {x: 193.73, y: 58.694} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &313765306 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 313765304} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 65 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 5 + m_MaxSize: 65 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Score +--- !u!222 &313765307 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 313765304} + m_CullTransparentMesh: 1 --- !u!1 &452803946 GameObject: m_ObjectHideFlags: 0 @@ -1789,10 +1985,15 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 54b5ce28633c4a76a3d80aadb4da4608, type: 3} m_Name: m_EditorClassIdentifier: - boardId: {fileID: 1511537943} type: 0 playerName: {fileID: 505065358} playerScore: {fileID: 251582821} + scoreDisplayController: {fileID: 904782688} + timeDisplayController: {fileID: 1631960190} + scoreTypeToggle: {fileID: 2133781968} + timeTypeToggle: {fileID: 1781066233} + enabledCol: {r: 0.93333334, g: 0.7647059, b: 0.24313726, a: 1} + disabledCol: {r: 0.6886792, g: 0.6886792, b: 0.6886792, a: 1} --- !u!4 &825885281 Transform: m_ObjectHideFlags: 0 @@ -1893,7 +2094,7 @@ GameObject: - component: {fileID: 904782689} - component: {fileID: 904782688} m_Layer: 0 - m_Name: Display Controller + m_Name: Display Controller (Score) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -1912,14 +2113,14 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: boardId: Example - displayOption: 1 + displayOption: 3 boardParent: {fileID: 1833917230} rowPrefab: {fileID: 7602520312045681682, guid: f39d1e8b6224cde4d906c3065b2d4be6, type: 3} entriesToShow: 10 showOptions: 0 customisations: startAt: 1 - showPosition: 0 + showPosition: 1 positionPrefix: '#' timeFormat: 0 --- !u!4 &904782689 @@ -1929,12 +2130,12 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 904782687} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 478.09885, y: 278.1841, z: -4.62691} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 7 + m_Father: {fileID: 1131091155} + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &915312256 GameObject: @@ -2051,85 +2252,6 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: -20, y: -20} m_Pivot: {x: 0.5, y: 0.5} ---- !u!1 &953032422 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 953032423} - - component: {fileID: 953032425} - - component: {fileID: 953032424} - m_Layer: 5 - m_Name: Title - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &953032423 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 953032422} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.3, y: 0.3, z: 1} - m_Children: [] - m_Father: {fileID: 2111730438} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -128.57, y: -0.000061035156} - m_SizeDelta: {x: 601.39, y: 211.9} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &953032424 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 953032422} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0, g: 0, b: 0, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 80 - m_FontStyle: 1 - m_BestFit: 0 - m_MinSize: 1 - m_MaxSize: 150 - m_Alignment: 5 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: 'Board ID:' ---- !u!222 &953032425 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 953032422} - m_CullTransparentMesh: 0 --- !u!1 &963635090 GameObject: m_ObjectHideFlags: 0 @@ -2352,9 +2474,41 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 1} m_AnchorMax: {x: 0.5, y: 1} - m_AnchoredPosition: {x: 0.000052296, y: -98} + m_AnchoredPosition: {x: -1.5643e-10, y: -159.95003} m_SizeDelta: {x: 436.6, y: 74.350006} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &1131091154 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1131091155} + m_Layer: 0 + m_Name: Example Displays + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1131091155 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1131091154} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 904782689} + - {fileID: 1631960191} + m_Father: {fileID: 0} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1133388610 GameObject: m_ObjectHideFlags: 0 @@ -2670,7 +2824,7 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1158947650} m_CullTransparentMesh: 0 ---- !u!1 &1240368744 +--- !u!1 &1227265313 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -2678,28 +2832,107 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1240368745} - - component: {fileID: 1240368749} - - component: {fileID: 1240368748} - - component: {fileID: 1240368747} - - component: {fileID: 1240368746} + - component: {fileID: 1227265314} + - component: {fileID: 1227265316} + - component: {fileID: 1227265315} m_Layer: 5 - m_Name: Remove-Btn + m_Name: Board Type Title m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &1240368745 +--- !u!224 &1227265314 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1240368744} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_GameObject: {fileID: 1227265313} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalScale: {x: 0.5, y: 0.5, z: 1} + m_Children: [] + m_Father: {fileID: 61203376} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 1} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: -0, y: -26.2} + m_SizeDelta: {x: 538.3251, y: 104.1183} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1227265315 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1227265313} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 65 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 6 + m_MaxSize: 65 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Board Type +--- !u!222 &1227265316 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1227265313} + m_CullTransparentMesh: 1 +--- !u!1 &1240368744 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1240368745} + - component: {fileID: 1240368749} + - component: {fileID: 1240368748} + - component: {fileID: 1240368747} + - component: {fileID: 1240368746} + m_Layer: 5 + m_Name: Remove-Btn + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1240368745 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1240368744} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 2144161418} - {fileID: 705219109} @@ -2987,7 +3220,7 @@ MonoBehaviour: m_OnClick: m_PersistentCalls: m_Calls: - - m_Target: {fileID: 904782688} + - m_Target: {fileID: 0} m_TargetAssemblyTypeName: CarterGames.Assets.LeaderboardManager.LeaderboardDisplay, CarterGames.Assets.LeaderboardManager.Runtime m_MethodName: ClearDisplay @@ -3117,7 +3350,7 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1476397807} m_CullTransparentMesh: 0 ---- !u!1 &1511537941 +--- !u!1 &1631960189 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -3125,157 +3358,52 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1511537942} - - component: {fileID: 1511537945} - - component: {fileID: 1511537944} - - component: {fileID: 1511537943} - - component: {fileID: 1511537946} - m_Layer: 5 - m_Name: InputField (BoardID) + - component: {fileID: 1631960191} + - component: {fileID: 1631960190} + m_Layer: 0 + m_Name: Display Controller (Time) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &1511537942 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1511537941} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 2105029641} - - {fileID: 1788389195} - m_Father: {fileID: 2111730438} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 91.4, y: -0.00004673} - m_SizeDelta: {x: 239.15, y: 43.16} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1511537943 +--- !u!114 &1631960190 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1511537941} + m_GameObject: {fileID: 1631960189} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d199490a83bb2b844b9695cbf13b01ef, type: 3} + m_Script: {fileID: 11500000, guid: 085083a017724d1284dca9719f2c04d2, 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: 1 - 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: Highlighted - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 1511537944} - m_TextComponent: {fileID: 1788389196} - m_Placeholder: {fileID: 2105029642} - m_ContentType: 0 - m_InputType: 0 - m_AsteriskChar: 42 - m_KeyboardType: 0 - m_LineType: 0 - m_HideMobileInput: 0 - m_CharacterValidation: 0 - m_CharacterLimit: 0 - m_OnEndEdit: - m_PersistentCalls: - m_Calls: [] - m_OnValueChanged: - m_PersistentCalls: - m_Calls: [] - m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} - m_CustomCaretColor: 0 - m_SelectionColor: {r: 0.65882355, g: 0.80784315, b: 1, a: 0.7529412} - m_Text: Example - m_CaretBlinkRate: 0.85 - m_CaretWidth: 1 - m_ReadOnly: 0 - m_ShouldActivateOnSelect: 1 ---- !u!114 &1511537944 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1511537941} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.9339623, g: 0.76537, b: 0.24230155, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!222 &1511537945 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1511537941} - m_CullTransparentMesh: 0 ---- !u!114 &1511537946 -MonoBehaviour: + boardId: Example_Time + displayOption: 3 + boardParent: {fileID: 1833917230} + rowPrefab: {fileID: 7602520312045681682, guid: f39d1e8b6224cde4d906c3065b2d4be6, type: 3} + entriesToShow: 10 + showOptions: 0 + customisations: + startAt: 1 + showPosition: 1 + positionPrefix: '#' + timeFormat: 5 +--- !u!4 &1631960191 +Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1511537941} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: cfabb0440166ab443bba8876756fdfa9, type: 3} - m_Name: - m_EditorClassIdentifier: - m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5} - m_EffectDistance: {x: 0, y: -2.5} - m_UseGraphicAlpha: 1 + m_GameObject: {fileID: 1631960189} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 478.09885, y: 278.1841, z: -4.62691} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1131091155} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1740993439 GameObject: m_ObjectHideFlags: 0 @@ -3310,7 +3438,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 1} m_AnchorMax: {x: 0.5, y: 1} - m_AnchoredPosition: {x: 0.000059925, y: -162} + m_AnchoredPosition: {x: -0.0000011102, y: -234.3} m_SizeDelta: {x: 436.6, y: 74.350006} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &1764275768 @@ -3495,7 +3623,7 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1766351146} m_CullTransparentMesh: 0 ---- !u!1 &1788389194 +--- !u!1 &1781066230 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -3503,77 +3631,148 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1788389195} - - component: {fileID: 1788389197} - - component: {fileID: 1788389196} + - component: {fileID: 1781066231} + - component: {fileID: 1781066235} + - component: {fileID: 1781066234} + - component: {fileID: 1781066233} + - component: {fileID: 1781066232} m_Layer: 5 - m_Name: Board-In + m_Name: Time Toggle m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &1788389195 +--- !u!224 &1781066231 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1788389194} + m_GameObject: {fileID: 1781066230} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.2, y: 0.2, z: 1} - m_Children: [] - m_Father: {fileID: 1511537942} - m_RootOrder: 1 + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 119766648} + m_Father: {fileID: 61203376} + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 3.69, y: 0.00044059753} - m_SizeDelta: {x: 919.67, y: 229.61} + m_AnchorMin: {x: 0.5, y: 0} + m_AnchorMax: {x: 0.5, y: 0} + m_AnchoredPosition: {x: 105.5, y: 42.9932} + m_SizeDelta: {x: 193.7283, y: 58.6942} m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1788389196 +--- !u!114 &1781066232 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1788389194} + m_GameObject: {fileID: 1781066230} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Script: {fileID: 11500000, guid: cfabb0440166ab443bba8876756fdfa9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5} + m_EffectDistance: {x: 0, y: -4.5} + m_UseGraphicAlpha: 1 +--- !u!114 &1781066233 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1781066230} + 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: 1 + 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: 1781066234} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 825885280} + m_TargetAssemblyTypeName: CarterGames.Assets.LeaderboardManager.Demo.ExampleManager, + CarterGames.LeaderboardManager.Demo + m_MethodName: SwitchType + 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!114 &1781066234 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1781066230} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_Color: {r: 0.93333334, g: 0.7647059, b: 0.23921569, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 100 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 1 - m_MaxSize: 150 - m_Alignment: 3 - m_AlignByGeometry: 0 - m_RichText: 0 - m_HorizontalOverflow: 1 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: Example ---- !u!222 &1788389197 + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1781066235 CanvasRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1788389194} - m_CullTransparentMesh: 0 + m_GameObject: {fileID: 1781066230} + m_CullTransparentMesh: 1 --- !u!1 &1812286115 GameObject: m_ObjectHideFlags: 0 @@ -4147,9 +4346,9 @@ MonoBehaviour: m_OnClick: m_PersistentCalls: m_Calls: - - m_Target: {fileID: 904782688} - m_TargetAssemblyTypeName: CarterGames.Assets.LeaderboardManager.LeaderboardDisplay, - CarterGames.Assets.LeaderboardManager.Runtime + - m_Target: {fileID: 825885280} + m_TargetAssemblyTypeName: CarterGames.Assets.LeaderboardManager.Demo.ExampleManager, + CarterGames.LeaderboardManager.Demo m_MethodName: UpdateDisplay m_Mode: 1 m_Arguments: @@ -4489,7 +4688,7 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2094130392} m_CullTransparentMesh: 0 ---- !u!1 &2105029640 +--- !u!1 &2133781965 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -4497,114 +4696,148 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 2105029641} - - component: {fileID: 2105029643} - - component: {fileID: 2105029642} + - component: {fileID: 2133781966} + - component: {fileID: 2133781970} + - component: {fileID: 2133781969} + - component: {fileID: 2133781968} + - component: {fileID: 2133781967} m_Layer: 5 - m_Name: Placeholder + m_Name: Score Toggle m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &2105029641 +--- !u!224 &2133781966 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2105029640} + m_GameObject: {fileID: 2133781965} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.2, y: 0.2, z: 1} - m_Children: [] - m_Father: {fileID: 1511537942} - m_RootOrder: 0 + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 313765305} + m_Father: {fileID: 61203376} + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 3.83, y: -0.000009536743} - m_SizeDelta: {x: 918.27, y: 229.6} + m_AnchorMin: {x: 0.5, y: 0} + m_AnchorMax: {x: 0.5, y: 0} + m_AnchoredPosition: {x: -105.5, y: 42.9932} + m_SizeDelta: {x: 193.7283, y: 58.6942} m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &2105029642 +--- !u!114 &2133781967 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2105029640} - m_Enabled: 0 + m_GameObject: {fileID: 2133781965} + m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Script: {fileID: 11500000, guid: cfabb0440166ab443bba8876756fdfa9, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 0.5} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 100 - m_FontStyle: 2 - m_BestFit: 0 - m_MinSize: 1 - m_MaxSize: 150 - m_Alignment: 3 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: Enter name... ---- !u!222 &2105029643 -CanvasRenderer: + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5} + m_EffectDistance: {x: 0, y: -4.5} + m_UseGraphicAlpha: 1 +--- !u!114 &2133781968 +MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2105029640} - m_CullTransparentMesh: 0 ---- !u!1 &2111730437 -GameObject: + m_GameObject: {fileID: 2133781965} + 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: 1 + 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: 2133781969} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 825885280} + m_TargetAssemblyTypeName: CarterGames.Assets.LeaderboardManager.Demo.ExampleManager, + CarterGames.LeaderboardManager.Demo + m_MethodName: SwitchType + 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!114 &2133781969 +MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2111730438} - m_Layer: 5 - m_Name: (InputField) Board ID - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &2111730438 -RectTransform: + m_GameObject: {fileID: 2133781965} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.93333334, g: 0.7647059, b: 0.23921569, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &2133781970 +CanvasRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2111730437} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 953032423} - - {fileID: 1511537942} - m_Father: {fileID: 27545903} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 1} - m_AnchorMax: {x: 0.5, y: 1} - m_AnchoredPosition: {x: -0.000029963, y: -36.72} - m_SizeDelta: {x: 436.6, y: 74.350006} - m_Pivot: {x: 0.5, y: 0.5} + m_GameObject: {fileID: 2133781965} + m_CullTransparentMesh: 1 --- !u!1 &2144161417 GameObject: m_ObjectHideFlags: 0 diff --git a/Carter Games/Leaderboard Manager/~Samples/Demo/Scripts/ExampleManager.cs b/Carter Games/Leaderboard Manager/~Samples/Demo/Scripts/ExampleManager.cs index 3ba11ee..e543970 100644 --- a/Carter Games/Leaderboard Manager/~Samples/Demo/Scripts/ExampleManager.cs +++ b/Carter Games/Leaderboard Manager/~Samples/Demo/Scripts/ExampleManager.cs @@ -36,11 +36,41 @@ public sealed class ExampleManager : MonoBehaviour /* ───────────────────────────────────────────────────────────────────────────────────────────────────────────── | Fields ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */ + + private const string ExampleBoardId = "Example"; + private const string ExampleBoardTimeId = "Example_Time"; - [SerializeField] private InputField boardId; [SerializeField] private LeaderboardType type; + [Space] [SerializeField] private InputField playerName; [SerializeField] private InputField playerScore; + [Space] + [SerializeField] private LeaderboardDisplay scoreDisplayController; + [SerializeField] private LeaderboardDisplay timeDisplayController; + [Space] + [SerializeField] private Button scoreTypeToggle; + [SerializeField] private Button timeTypeToggle; + [Space] + [SerializeField] private Color enabledCol; + [SerializeField] private Color disabledCol; + + /* ───────────────────────────────────────────────────────────────────────────────────────────────────────────── + | Properties + ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */ + + private string BoardId => type == LeaderboardType.Score ? ExampleBoardId : ExampleBoardTimeId; + + /* ───────────────────────────────────────────────────────────────────────────────────────────────────────────── + | Unity Methods + ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */ + + private void OnEnable() + { + scoreTypeToggle.targetGraphic.color = type == LeaderboardType.Score ? enabledCol : disabledCol; + timeTypeToggle.targetGraphic.color = type == LeaderboardType.Time ? enabledCol : disabledCol; + + UpdateDisplay(); + } /* ───────────────────────────────────────────────────────────────────────────────────────────────────────────── | Methods @@ -56,10 +86,16 @@ public void AddToBoard() LbmLogger.Normal("[DEMO]: Either the name or score fields were blank, please ensure the fields are filled before using this option."); return; } + + var entry = type == LeaderboardType.Score + ? (LeaderboardEntry) new LeaderboardEntryScore(playerName.text, double.Parse(playerScore.text)) + : (LeaderboardEntry) new LeaderboardEntryTime(playerName.text, SerializableTime.FromSeconds(double.Parse(playerScore.text))); - LeaderboardManager.AddEntryToBoard(boardId.text, type, new LeaderboardEntryTime(playerName.text, SerializableTime.FromSeconds(double.Parse(playerScore.text)))); + LeaderboardManager.AddEntryToBoard(BoardId, type, entry); playerName.text = string.Empty; playerScore.text = string.Empty; + + UpdateDisplay(); } @@ -74,9 +110,11 @@ public void RemoveFromBoard() return; } - LeaderboardManager.DeleteEntryFromBoard(boardId.text, playerName.text, double.Parse(playerScore.text)); + LeaderboardManager.DeleteEntryFromBoard(BoardId, playerName.text, double.Parse(playerScore.text)); playerName.text = string.Empty; playerScore.text = string.Empty; + + UpdateDisplay(); } @@ -85,7 +123,41 @@ public void RemoveFromBoard() /// public void ClearBoard() { - LeaderboardManager.ClearLeaderboard(boardId.text); + LeaderboardManager.ClearLeaderboard(BoardId); + UpdateDisplay(); + } + + + /// + /// Called by example scene buttons to update the current display when called. + /// + public void UpdateDisplay() + { + switch (type) + { + case LeaderboardType.Score: + timeDisplayController.ClearDisplay(); + scoreDisplayController.UpdateDisplay(); + break; + case LeaderboardType.Time: + scoreDisplayController.ClearDisplay(); + timeDisplayController.UpdateDisplay(); + break; + } + } + + + /// + /// Switches the active type when called. + /// + public void SwitchType() + { + type = type == LeaderboardType.Score ? LeaderboardType.Time : LeaderboardType.Score; + + scoreTypeToggle.targetGraphic.color = type == LeaderboardType.Score ? enabledCol : disabledCol; + timeTypeToggle.targetGraphic.color = type == LeaderboardType.Time ? enabledCol : disabledCol; + + UpdateDisplay(); } } } \ No newline at end of file