mirror of
https://github.com/boudji-ludwig-pett/cnam-geometry-dash.git
synced 2025-06-10 22:20:40 +02:00
feat: level progression (#46)
This commit is contained in:
@ -16,9 +16,12 @@ public class LevelElement
|
||||
[System.Serializable]
|
||||
public class Level
|
||||
{
|
||||
public static readonly int LAST_X = 15;
|
||||
public string JsonName { get; set; }
|
||||
public int TotalJumps { get; set; }
|
||||
public int TotalAttempts { get; set; }
|
||||
public int ProgressionPercent { get; set; }
|
||||
public int ProgressionPercentMax { get; set; }
|
||||
|
||||
public string name;
|
||||
public string musicName;
|
||||
@ -26,6 +29,20 @@ public class Level
|
||||
|
||||
public List<LevelElement> elements;
|
||||
|
||||
public float LastX
|
||||
{
|
||||
get
|
||||
{
|
||||
LevelElement lastElement = elements[^1];
|
||||
float lastX = LAST_X;
|
||||
if (lastElement != null)
|
||||
{
|
||||
lastX += lastElement.x;
|
||||
}
|
||||
return lastX;
|
||||
}
|
||||
}
|
||||
|
||||
public static Level CreateFromJSON(string jsonString)
|
||||
{
|
||||
return JsonUtility.FromJson<Level>(jsonString);
|
||||
|
Reference in New Issue
Block a user