com.amanotes.rhythmjson
v1.0.0
Published
Shared JSON parsing for rhythm game song data with JSON.NET support
Readme
RhythmJson
Shared JSON parsing library for rhythm game song data.
Features
- JSON.NET based parsing
- Unified RhythmJson/SongNote models
- Backward compatible variant/variants support
- GameMeta with cap settings
- HexToColor utility
- Partial class architecture for clean organization
Usage
using static Amanotes.Core.RhythmJson;
// Parse song data (auto sorts and converts variants)
var rhythmJson = Parse(jsonString);
// Access data
Debug.Log($"Song: {rhythmJson.songMeta.songName}");
Debug.Log($"BPM: {rhythmJson.songMeta.bpm}");
Debug.Log($"Notes: {rhythmJson.notes.Count}");
// Access notes
SongNote note = rhythmJson.notes[0];
Debug.Log($"Note time: {note.time}, lane: {note.lane}");
// Manually sort if needed
SortAndIndex(rhythmJson.notes);
// Serialize
string json = Serialize(rhythmJson, prettyPrint: true);Dependencies
- com.unity.nuget.newtonsoft-json: 3.0.0
Architecture
- RhythmJson - Main serializable class (replaces SongData)
- RhythmJson.Parser - Parse, Serialize, SortAndIndex, ConvertVariants methods
- SongMeta - Song metadata
- GameMeta - Game metadata with CapType enum
- SongNote - Note class with controls and metas
- NoteControl - Control point
- NoteMeta - Note metadata (key-value pairs)
