コード例 #1
0
        static private void generateSnippets(IEnumerable <Type> types)
        {
            Configuration configuration = Utility.GetConfiguration();

            if (null != configuration)
            {
                BinderBase.SetLibraryOutputPath(configuration.snippetsOutputPath);
            }
            NamespaceBinder.Clear();

            List <Type> nestedTypes = new List <Type>();

            foreach (Type type in types)
            {
                if (type.IsNested)
                {
                    nestedTypes.Add(type);
                    continue;
                }
                generateSnippet(type);
            }
            foreach (Type type in nestedTypes)
            {
                generateSnippet(type);
            }

            foreach (NamespaceBinder space in NamespaceBinder.Spaces)
            {
                space.GenerateSnippets(true);
            }
            Entry.Log("General.Typescript snippets generate successfully!");
        }
コード例 #2
0
        static private void generateBinders(IEnumerable <Type> types, List <Type> delegates)
        {
            Configuration configuration = Utility.GetConfiguration();

            if (null != configuration)
            {
                BinderBase.SetBinderOutputPath(configuration.bindersOutputPath);
            }
            NamespaceBinder.Clear();

            List <Type> nestedTypes = new List <Type>();

            foreach (Type type in types)
            {
                if (type.IsNested)
                {
                    nestedTypes.Add(type);
                    continue;
                }
                generateBinder(type);
            }
            foreach (Type type in nestedTypes)
            {
                generateBinder(type);
            }

            foreach (NamespaceBinder space in NamespaceBinder.Spaces)
            {
                space.GenerateBinder(delegates, true);
            }

            AssetDatabase.Refresh();
            Entry.Log("General.Typescript binders generate successfully!");
        }