Beispiel #1
0
    //Helper function to parse the language with the IDs
    private void SetupLanguage(string dataString)
    {
        if (dataString == null)
        {
            Debug.LogWarning("TextAsset Doesn't exist");
            return;
        }

        //Config
        JObject objJson  = JsonConvert.DeserializeObject <JObject> (dataString);
        JArray  dataList = new JArray();

        dataList = PR_Utility.ParseArray(objJson, "Sheet1");

        //Get the datas from  the JSON array
        foreach (JObject data in dataList)
        {
            //var data = hashData as Hashtable;
            string strKey = "";
            strKey = data["ID"].ToString();

            LanguageData languageText = new LanguageData();
            languageText.SetData(data);

            if (stringIDMap.Contains(strKey))
            {
                Debug.LogWarning(strKey + " already in the list");
            }
            else
            {
                stringIDMap.Add(strKey, languageText);
            }
        }
    }
Beispiel #2
0
 public void SetData(JObject data)
 {
     English   = PR_Utility.ParseString(data, "EN");
     Indonesia = PR_Utility.ParseString(data, "INDO");
 }
Beispiel #3
0
 public void SetData(Hashtable data)
 {
     English   = PR_Utility.ParseString(data, "EN");
     Indonesia = PR_Utility.ParseString(data, "INDO");
 }