I have the following class, which is serializable and only has strings as fields:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
[System.Serializable]
public class Cabeza
{
string id, urlOBJ, urlTextura, pathOBJbajado, pathTexturaBajada;
public string Id { get; set; }
public string UrlOBJ { get; set; }
public string UrlTextura { get; set; }
public string PathOBJbajado { get; set; }
public string PathTexturaBajada { get; set; }
public Cabeza (string nuevoId)
{
Id = nuevoId;
UrlOBJ = nuevoId +".obj";
UrlTextura = nuevoId + ".png";
}
}
As far I know it should be possible to obtain a JSON from it...However, JsonUtility.ToJson() returns just { }. How is this possible? What am I missing?
ToJson(...)?