예제 #1
0
        private bool SetupInspectionMaster()
        {
            string src = AssetManager.LoadTextData("Data/ChatWord");

            if (string.IsNullOrEmpty(src))
            {
                DebugUtility.LogError("ChatWindow Error:[Data/ChatWord] is Not Found or Not Data!");
                return(false);
            }
            try
            {
                JSON_ChatInspectionMaster[] jsonArray = JSONParser.parseJSONArray <JSON_ChatInspectionMaster>(src);
                if (jsonArray == null)
                {
                    throw new InvalidJSONException();
                }
                this.mChatInspectionMaster.Clear();
                foreach (JSON_ChatInspectionMaster json in jsonArray)
                {
                    ChatInspectionMaster inspectionMaster = new ChatInspectionMaster();
                    if (inspectionMaster.Deserialize(json))
                    {
                        this.mChatInspectionMaster.Add(inspectionMaster);
                    }
                }
            }
            catch (Exception ex)
            {
                DebugUtility.LogWarning("ChatWindow/SetupInspectionMaster parse error! e=" + ex.ToString());
                return(false);
            }
            return(true);
        }