public ProBufAPI(string messageStr, string parent) { string[] fieldArray; EmmyProtoBufExport.GetClassInfo("message", messageStr, parent, out packageName, out className, out fieldArray); for (int i = 0; i < fieldArray.Length - 1; i++) { string lineStr = (fieldArray[i].Split('=') [0]).Trim(); if (string.IsNullOrEmpty(lineStr)) { continue; } ProBufAPIFiled pf = new ProBufAPIFiled(lineStr, packageName); fieldList.Add(pf); } }
public ProBufAPIEnum(string messageStr, string parent) { string[] fieldArray; EmmyProtoBufExport.GetClassInfo("enum", messageStr, parent, out packageName, out className, out fieldArray); for (int i = 0; i < fieldArray.Length - 1; i++) { var lineStr = fieldArray[i].Split('='); var key = lineStr[0].Trim(); try { var number = System.Convert.ToInt32(lineStr[1].Trim()); fieldList[key] = number; } catch (System.Exception ex) { Debug.Log(ex.ToString()); } } }