Ejemplo n.º 1
0
    private void CreatTaskHotspotGroupJsonExample()
    {
        Debug.Log("SaveJson");
        //List<T> -> Json ( 例 : List<Enemy> )
        List <TaskHotspotGroup> tasks = ReadExcel.ReadTaskHotspotGroup(m_excelPath);
        //string str = JsonUtility.ToJson(tasks); // 输出 : { }
        string str = JsonUtility.ToJson(new Serialization <TaskHotspotGroup>(tasks));

        File.WriteAllText(Application.streamingAssetsPath + m_jsonListPath, str);
        Debug.Log(str);
    }