mirror of
https://github.com/boudji-ludwig-pett/cnam-geometry-dash.git
synced 2025-06-27 11:58:51 +02:00
feat: dynamically create elements levels (#39)
This commit is contained in:
@@ -1,4 +1,21 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
[System.Serializable]
|
||||
public class LevelElement
|
||||
{
|
||||
public enum Type
|
||||
{
|
||||
Obstacle = 0,
|
||||
Spike = 1
|
||||
}
|
||||
|
||||
public Type type;
|
||||
public float x;
|
||||
public float y;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class Level
|
||||
@@ -11,6 +28,8 @@ public class Level
|
||||
public string musicName;
|
||||
public int order;
|
||||
|
||||
public List<LevelElement> elements;
|
||||
|
||||
public static Level CreateFromJSON(string jsonString)
|
||||
{
|
||||
return JsonUtility.FromJson<Level>(jsonString);
|
||||
|
Reference in New Issue
Block a user