UsoUIElements 0.1.0
Data Centric implimentation of Unity's UI Elements (UI Toolkit)
Loading...
Searching...
No Matches
GWG.UsoUIElements.Utilities.JsonHelper Class Reference

Classes

class  Wrapper< T >

Static Public Member Functions

static string ToJson< T > (List< T > list, bool prettyPrint=false)

Detailed Description

  • Defines a static utility class for serializing lists to JSON in Unity.

Provides a generic method that:

Wraps the list in a private serializable Wrapper class (with a single Items field).

  • Uses JsonUtility.ToJson to serialize the wrapper,
  • enabling list serialization (which Unity's JsonUtility does not support directly).
  • Supports pretty-printing via an optional parameter.
  • Simplifies converting lists to JSON strings for storage or transmission in Unity projects.

Member Function Documentation

◆ ToJson< T >()

string GWG.UsoUIElements.Utilities.JsonHelper.ToJson< T > ( List< T > list,
bool prettyPrint = false )
static