JC.cs 607 B

12345678910111213141516171819202122232425
  1. using UnityEngine;
  2. using System.Collections.Generic;
  3. using ToneTuneToolkit.Common;
  4. namespace Examples
  5. {
  6. /// <summary>
  7. ///
  8. /// </summary>
  9. public class JC : MonoBehaviour
  10. {
  11. private void Start()
  12. {
  13. Dictionary<string, string> testDic = new Dictionary<string, string>();
  14. testDic["KeyA"] = "ValueA";
  15. testDic["KeyB"] = "ValueB";
  16. string testSting = DataConverter.Dic2Json(testDic);
  17. Debug.Log(testSting);
  18. Dictionary<string, string> dic = new Dictionary<string, string>();
  19. dic = DataConverter.Json2Dic(testSting);
  20. Debug.Log(dic["KeyA"]);
  21. }
  22. }
  23. }