Exemplo n.º 1
0
        static void GenRegisterInfo(string nameSpace, StringBuilder sb, List <DelegateType> delegateList, List <DelegateType> wrappedDelegatesCache)
        {
            for (int i = 0; i < allTypes.Count; i++)
            {
                Type dt = CustomSettings.dynamicList.Find((p) => { return(allTypes[i].type == p); });

                if (dt == null && allTypes[i].nameSpace == nameSpace)
                {
                    string str = "\t\t" + allTypes[i].wrapName + "Wrap.Register(L);\r\n";
                    sb.Append(str);
                    allTypes.RemoveAt(i--);
                }
            }

            string funcName = null;

            for (int i = 0; i < delegateList.Count; i++)
            {
                DelegateType dt        = delegateList[i];
                Type         type      = dt.type;
                string       typeSpace = ToLuaDevExport.GetNameSpace(type, out funcName);

                if (typeSpace == nameSpace)
                {
                    funcName = ToLuaDevExport.ConvertToLibSign(funcName);
                    string abr = dt.abr;
                    abr = abr == null ? funcName : abr;
                    sb.AppendFormat("\t\tL.RegFunction(\"{0}\", {1});\r\n", abr, dt.name);
                    wrappedDelegatesCache.Add(dt);
                }
            }
        }
Exemplo n.º 2
0
        static ToLuaTree <string> InitTree()
        {
            ToLuaTree <string> tree = new ToLuaTree <string>();
            ToLuaNode <string> root = tree.GetRoot();

            BindType[] list = GenBindTypes(CustomSettings.customTypeList);

            for (int i = 0; i < list.Length; i++)
            {
                string space = list[i].nameSpace;
                AddSpaceNameToTree(tree, root, space);
            }

            DelegateType[] dts = CustomSettings.customDelegateList;
            string         str = null;

            for (int i = 0; i < dts.Length; i++)
            {
                string space = ToLuaDevExport.GetNameSpace(dts[i].type, out str);
                AddSpaceNameToTree(tree, root, space);
            }

            return(tree);
        }