Fixed difficulty stuff
This commit is contained in:
@@ -7,7 +7,8 @@ using UnityEngine.UI;
|
||||
|
||||
namespace InterfaceOff.WorldScene
|
||||
{
|
||||
[System.Serializable] public struct PlayerScore
|
||||
[System.Serializable]
|
||||
public struct PlayerScore
|
||||
{
|
||||
public string PlayerName;
|
||||
public float Score;
|
||||
@@ -27,7 +28,7 @@ namespace InterfaceOff.WorldScene
|
||||
[field: SerializeField] private WindowSpawner Spawner { get; set; }
|
||||
[field: SerializeField] private GameObject LeaderboardObject { get; set; }
|
||||
[field: SerializeField] private GameObject LeaderboardEntryPrefab { get; set; }
|
||||
|
||||
|
||||
[field: SerializeField] private InputField PlayerTextNameInput { get; set; }
|
||||
[field: SerializeField] private Button IDRKWhatToCallThis { get; set; }
|
||||
|
||||
@@ -37,9 +38,8 @@ namespace InterfaceOff.WorldScene
|
||||
private string CurrentPlayerName { get; set; } = string.Empty;
|
||||
private bool StoredCurrentScore = false;
|
||||
private float Score;
|
||||
|
||||
#if UNITY_STANDALONE_WIN
|
||||
|
||||
#if UNITY_STANDALONE_WIN
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
|
||||
private static void OnStart()
|
||||
{
|
||||
@@ -66,7 +66,6 @@ namespace InterfaceOff.WorldScene
|
||||
string json = JsonUtility.ToJson(dmp, prettyPrint: false);
|
||||
File.WriteAllText(Path.Combine(Application.persistentDataPath, "scores.json"), contents: json);
|
||||
}
|
||||
|
||||
#endif // UNITY_STANDALONE_WIN
|
||||
|
||||
public static float CurrentScore()
|
||||
@@ -113,7 +112,7 @@ namespace InterfaceOff.WorldScene
|
||||
if (Spawner.AutoSpawn)
|
||||
{
|
||||
StoredCurrentScore = false;
|
||||
|
||||
|
||||
Score = Time.timeSinceLevelLoad * DifficultyManager.DifficultyEffect;
|
||||
ScoreText.text = $"Score: {Score:F1}";
|
||||
}
|
||||
@@ -144,4 +143,4 @@ namespace InterfaceOff.WorldScene
|
||||
|
||||
public void SetPlayerName(string input) => CurrentPlayerName = input;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user