Skip to content

Commit

Permalink
Any Misc Changes Missing
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanMCarter committed Mar 21, 2022
1 parent e3ca3d7 commit 23e8dd6
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 24 deletions.
45 changes: 27 additions & 18 deletions Demo/Scenes/Leaderboard Manager Demo Scene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -1722,9 +1722,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 54b5ce28633c4a76a3d80aadb4da4608, type: 3}
m_Name:
m_EditorClassIdentifier:
boardID: {fileID: 1788389196}
playerName: {fileID: 1812286118}
playerScore: {fileID: 614018320}
boardID: {fileID: 1511537943}
playerName: {fileID: 505065358}
playerScore: {fileID: 251582821}
--- !u!4 &825885281
Transform:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1842,7 +1842,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
boardID: Example
displayOption: 6
displayOption: 5
boardParent: {fileID: 1833917230}
rowPrefab: {fileID: 2228518243412644763, guid: f39d1e8b6224cde4d906c3065b2d4be6,
type: 3}
Expand Down Expand Up @@ -2070,7 +2070,6 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 963635091}
- component: {fileID: 963635092}
m_Layer: 0
m_Name: ===================
m_TagString: Untagged
Expand All @@ -2092,18 +2091,6 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &963635092
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 963635090}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bb8b644dd14f42998cafb9846d657911, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &971219820
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -2474,6 +2461,17 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 904782688}
m_MethodName: UpdateDisplay
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 &1135611353
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -2703,6 +2701,17 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 904782688}
m_MethodName: UpdateDisplay
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 &1240368748
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -3035,7 +3044,7 @@ GameObject:
- component: {fileID: 1511537943}
- component: {fileID: 1511537946}
m_Layer: 5
m_Name: InputField (Name)
m_Name: InputField (BoardID)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
Expand Down
14 changes: 9 additions & 5 deletions Demo/Scripts/ExampleManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,35 @@ namespace CarterGames.Assets.LeaderboardManager.Demo
{
public class ExampleManager : MonoBehaviour
{
[SerializeField] private Text boardID;
[SerializeField] private Text playerName;
[SerializeField] private Text playerScore;
[SerializeField] private InputField boardID;
[SerializeField] private InputField playerName;
[SerializeField] private InputField playerScore;


public void AddToBoard()
{
if (playerName.text.Length <= 0 || playerScore.text.Length <= 0)
{
Debug.Log($"<color=D6BA64><b>Leaderboard Manager</b> | Either the name or score fields were blank, please ensure the fields are filled before using this option.</color>");
Debug.Log($"<color=D6BA64><b>Leaderboard Manager Example</b> | Either the name or score fields were blank, please ensure the fields are filled before using this option.</color>");
return;
}

LeaderboardManager.AddEntryToBoard(boardID.text, playerName.text, double.Parse(playerScore.text));
playerName.text = string.Empty;
playerScore.text = string.Empty;
}

public void RemoveFromBoard()
{
if (playerName.text.Length <= 0 || playerScore.text.Length <= 0)
{
Debug.Log($"<color=D6BA64><b>Leaderboard Manager</b> | Either the name or score fields were blank, please ensure the fields are filled before using this option.</color>");
Debug.Log($"<color=D6BA64><b>Leaderboard Manager Example</b> | Either the name or score fields were blank, please ensure the fields are filled before using this option.</color>");
return;
}

LeaderboardManager.DeleteEntryFromBoard(boardID.text, playerName.text, double.Parse(playerScore.text));
playerName.text = string.Empty;
playerScore.text = string.Empty;
}

public void ClearBoard()
Expand Down
2 changes: 1 addition & 1 deletion Editor/Display/LeaderboardDisplayEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ protected void HeaderDisplay(string headerTitle, int width)

EditorGUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
EditorGUILayout.LabelField("Version: 2.0.0", GUILayout.Width(87.5f));
EditorGUILayout.LabelField("Version: 2.0.1", GUILayout.Width(87.5f));
GUILayout.FlexibleSpace();
EditorGUILayout.EndHorizontal();

Expand Down
Binary file modified Leaderboard Manager Offline Documentation.pdf
Binary file not shown.
10 changes: 10 additions & 0 deletions Scripts/Data/LeaderboardEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,15 @@ public LeaderboardEntry(string name, double score)
this.name = name;
this.score = score;
}


/// <summary>
/// Converts the score to a time value in seconds.
/// </summary>
/// <returns>The timespan in seconds</returns>
public TimeSpan ConvertScoreToTime()
{
return TimeSpan.FromSeconds(score);
}
}
}
Binary file modified TMP/Leaderboard Manager TextMeshPro Expansion.unitypackage
Binary file not shown.

0 comments on commit 23e8dd6

Please sign in to comment.