feat: dynamically create elements levels (#39)

This commit is contained in:
2025-03-03 10:36:38 +01:00
committed by GitHub
parent ce92ba53cc
commit e2bbf26929
13 changed files with 608 additions and 476 deletions

View File

@@ -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);