public Type Find(string typeName) { CCTypeMeta_t t = null; typeDic.TryGetValue(typeName, out t); return(t.type); }
public CCTypeMeta_t FindTypeMeta(string typeName) { CCTypeMeta_t t = null; typeDic.TryGetValue(typeName, out t); return(t); }
public virtual CCTypeMeta_t AddType(Type type) { CCTypeMeta_t p = null; if (typeDic.ContainsKey(type.Name)) { } else { p = new CCTypeMeta_t(type); typeDic.Add(type.Name, p); } return(p); }
// public override CCTypeMeta_t AddType(Type type) { CCTypeMeta_t p = base.AddType(type); if (p != null) { p.ClassID = ClassID(type); } else { UnityEngine.Debug.LogError("AddType fail:" + type.ToString()); } return(p); }
//必须使用dll工程去替换非DLL工程 //查找并替换行 //dll -- > script public virtual int TestAndFindMissInLine(int lineNo, string sLine, out string sNewLine) { //匹配DLL引用 //baa3e98256fcd8542a6a5ba1a0290fa5 sNewLine = ""; Match m = rgx_11500000.Match(sLine); if (m != null && m.Success) { missrow++; // string fileID = m.Groups[1].ToString(); string fileType = m.Groups[2].ToString(); //根据fileID找到 CCTypeMeta_t t = _dll.FindByFileID(fileID); //只是提供一个dll的类型表 if (t == null) { string log = string.Format("[{0}] 未找到Ref={1},{2},{3}", lineNo, fileID, sLine, _curFile); CCTypeMeta_t t2 = _dllBack.FindByFileID(fileID); if (t2 == null) { Debug.LogWarning(log); return(0); // log = log + t2.type; } t = t2; } //根据t,找到对应的文件.. Meta_t v; v = m_dstMetas.FindByType(t.type); //表示目标工程路径 if (v == null) { Debug.LogWarning(string.Format("[{0}] 未找到m_dstMetas ={1},{2},{3}", lineNo, t.type.Name, sLine, _curFile)); return(0); } //构造替换语句 " + + " //Debug.Log(string.Format("[{0}]找到Ref={1},{2},{3}", lineNo, t, v.fn, sLine)); sNewLine = string.Format(@" m_Script: {{fileID: {0}, guid: {1}, type: {2}}}", t.ClassIDString, v.uuid, fileType); replacerow++; return(1); } return(0); }