using System.Collections; using System.Collections.Generic; using UnityEngine; public class LoadSpeechData : MonoBehaviour { [SerializeField] TextAsset intentJson; private Dictionary _dicIntents = new Dictionary(); // Start is called before the first frame update void Start() { IntentList _intentList = JsonUtility.FromJson(intentJson.text); foreach (IntentData _obj in _intentList.intents) { Debug.Log($"IntentID: {_obj.intentID}, Sentences Count: {_obj.intentSentences.Count}"); string _combinedSentences = string.Join(", ", _obj.intentSentences); _dicIntents.Add(_obj.intentID, _combinedSentences); Debug.Log($"Added {_combinedSentences} to {_obj.intentID}"); } SpeechData.intents = _dicIntents; } }