Assets\Core\ToLua\Editor\Custom\CustomSettings.cs
using UnityEngine;
using System;
using System.Collections.Generic;
using LuaInterface;
using UnityEngine.UI;
using UnityEngine.AI;
using BindType = ToLuaMenu.BindType;
using System.Reflection;
using XW;
public static class CustomSettings
{
public static string saveDir = Application.dataPath + "/Source/Generate/";
public static string toluaBaseType = Application.dataPath + "/ToLua/BaseType/";
//导出时强制做为静态类的类型(注意 customTypeList 还要添加这个类型才能导出)
//unity 有些类作为sealed class, 其实完全等价于静态类
public static List<Type> staticClassTypes = new List<Type>
{
typeof(UnityEngine.Application),
typeof(UnityEngine.Time),
typeof(UnityEngine.Screen),
typeof(UnityEngine.SleepTimeout),
typeof(UnityEngine.Input),
typeof(UnityEngine.Resources),
typeof(UnityEngine.Physics),
typeof(UnityEngine.RenderSettings),
typeof(UnityEngine.QualitySettings),
typeof(UnityEngine.GL),
typeof(UnityEngine.Graphics),
typeof(UnityEngine.Shader),
typeof(UnityEngine.Random), // 2018.4.35f1 里面是非静态,2021.3.5是静态的
typeof(ShaderBlendModeHelper),
typeof(ShaderBlendModeHelper.BlendMode),
};
//附加导出委托类型(在导出委托时, customTypeList 中牵扯的委托类型都会导出, 无需写在这里)
public static DelegateType[] customDelegateList =
{
_DT(typeof(Action)),
_DT(typeof(UnityEngine.Events.UnityAction)),
_DT(typeof(System.Predicate<int>)),
_DT(typeof(System.Action<int>)),
_DT(typeof(System.Comparison<int>)),
_DT(typeof(System.Func<int, int>)),
有些类的某个函数不支持导出,那就只能屏蔽掉,屏蔽列表在这儿
Assets\Core\ToLua\Editor\ToLuaExport.cs
public static List<string> memberFilter = new List<string>
{
// 2021.3.5 不支持 以下
"Material.EnableKeyword",
"Material.DisableKeyword",
"Material.IsKeywordEnable