using System;
using System.Reflection;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using XLua;

public static class XLuaGenConfig
{

    [CSObjectWrapEditor.GenPath]
    public static string common_path = "Assets/app/Native/xlua/Gen/";


    [ReflectionUse]
    public static List<Type> ReflectionUseGenerate
    {
        get
        {
            string[] modlist = new string[] {
                // "UnityEngine.UnityWebRequestAudioModule",
                // "UnityEngine.UnityWebRequestTextureModule"
            };

            List<Type> remains = new List<Type>();
            foreach (string mod in modlist)
            {
                Assembly assembly = Assembly.Load(mod);
                Type[] types = assembly.GetExportedTypes();

                foreach (Type t in types)
                {
                    if (t.IsDefined(typeof(ObsoleteAttribute), true) ||
                        t.IsNotPublic ||
                        (t.IsAbstract && !t.IsSealed))
                        continue;

                    remains.Add(t);
                }
            }
            return remains;
        }
    }
}
