#if USE_LUA using LuaInterface; using UnityEditor; using System; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; using BindType = ToLuaMenu.BindType; public class LuaExportList { public static string saveDir = Application.dataPath + "/Script/LuaGenerate"; public static string toluaBaseType = Application.dataPath + "/Script/LuaGenerate/BaseType/"; //在这里添加你要导出注册到lua的类型列表 public static BindType[] customTypeList = { _GT(typeof(Debugger)).SetNameSpace(null), #region Base _GT(typeof(UnityEngine.Object)), _GT(typeof(GameObject)), _GT(typeof(Transform)), _GT(typeof(Component)), _GT(typeof(Behaviour)), _GT(typeof(MonoBehaviour)), _GT(typeof(Vector3)), _GT(typeof(Vector4)), _GT(typeof(Vector2)), _GT(typeof(Color)), #endregion #region UGUI _GT(typeof(Selectable)), _GT(typeof(UIBehaviour)), _GT(typeof(Graphic)), _GT(typeof(MaskableGraphic)), _GT(typeof(ScrollRect)), _GT(typeof(Button)), _GT(typeof(Image)), _GT(typeof(Text)), _GT(typeof(RectTransform)), //自定义的UGUI拓展类 _GT(typeof(ScrollRectInput)), _GT(typeof(ReusingScrollRect)), #endregion #region Framework #region AnimSystem _GT(typeof(InterpType)), _GT(typeof(RepeatType)), _GT(typeof(AnimData)), _GT(typeof(AnimSystem)), #endregion #region UI _GT(typeof(UIBase)), _GT(typeof(UIWindowBase)), _GT(typeof(UIManager)), _GT(typeof(UIWindowLuaHelper)), _GT(typeof(UISystemEvent)), _GT(typeof(UIEvent)), #endregion #region Data _GT(typeof(List)), _GT(typeof(Dictionary)), _GT(typeof(JsonLuaHelper)), _GT(typeof(DataTable)), _GT(typeof(SingleData)), _GT(typeof(SingleField)), _GT(typeof(RecordTable)), _GT(typeof(DataManager)), _GT(typeof(ConfigManager)), _GT(typeof(RecordManager)), _GT(typeof(AudioPlayManager)), #endregion #region Input _GT(typeof(IInputEventBase)), _GT(typeof(InputUIEventType)), _GT(typeof(InputUIEventBase)), _GT(typeof(InputUIOnScrollEvent)), _GT(typeof(InputUIOnClickEvent)), _GT(typeof(InputUILongPressEvent)), _GT(typeof(InputNetworkMessageEvent)), _GT(typeof(InputNetworkConnectStatusEvent)), _GT(typeof(NetworkState)), _GT(typeof(InputManager)), _GT(typeof(NetworkManager)), #endregion //_GT(typeof(HeapObjectPool)), //_GT(typeof(ResourceManager)), //_GT(typeof(ApplicationManager)), //_GT(typeof(ApplicationStatusManager)), _GT(typeof(GameObjectManager)), #endregion #region Custom //要导出的C#类文件请放在这里 //格式: _GT(typeof(类名)), #endregion #region Note //这里是注释 //_GT(typeof(Component)), //_GT(typeof(Material)), //_GT(typeof(Light)), //_GT(typeof(Rigidbody)), //_GT(typeof(Camera)), //_GT(typeof(AudioSource)), //_GT(typeof(Behaviour)), //_GT(typeof(MonoBehaviour)), //_GT(typeof(TrackedReference)), //_GT(typeof(Application)), //_GT(typeof(Physics)), //_GT(typeof(Collider)), //_GT(typeof(Time)), //_GT(typeof(Texture)), //_GT(typeof(Texture2D)), //_GT(typeof(Shader)), //_GT(typeof(Renderer)), //_GT(typeof(WWW)), _GT(typeof(Screen)), //_GT(typeof(CameraClearFlags)), //_GT(typeof(AudioClip)), //_GT(typeof(AssetBundle)), //_GT(typeof(ParticleSystem)), //_GT(typeof(AsyncOperation)).SetBaseType(typeof(System.Object)), //_GT(typeof(LightType)), //_GT(typeof(SleepTimeout)), //_GT(typeof(Animator)), _GT(typeof(Input)), //_GT(typeof(KeyCode)), //_GT(typeof(SkinnedMeshRenderer)), //_GT(typeof(Space)), //_GT(typeof(MeshRenderer)), //_GT(typeof(ParticleEmitter)), //_GT(typeof(ParticleRenderer)), //_GT(typeof(ParticleAnimator)), //_GT(typeof(BoxCollider)), //_GT(typeof(MeshCollider)), //_GT(typeof(SphereCollider)), //_GT(typeof(CharacterController)), //_GT(typeof(CapsuleCollider)), //_GT(typeof(Animation)), //_GT(typeof(AnimationClip)).SetBaseType(typeof(UnityEngine.Object)), //_GT(typeof(AnimationState)), //_GT(typeof(AnimationBlendMode)), //_GT(typeof(QueueMode)), //_GT(typeof(PlayMode)), //_GT(typeof(WrapMode)), //_GT(typeof(QualitySettings)), //_GT(typeof(RenderSettings)), //_GT(typeof(BlendWeights)), //_GT(typeof(RenderTexture)), #endregion }; //导出时强制做为静态类的类型(注意customTypeList 还要添加这个类型才能导出) //unity 有些类作为sealed class, 其实完全等价于静态类 public static List staticClassTypes = new List { //typeof(UnityEngine.Application), //typeof(UnityEngine.Time), //typeof(UnityEngine.Screen), }; //附加导出委托类型(在导出委托时, customTypeList 中牵扯的委托类型都会导出, 无需写在这里) public static DelegateType[] customDelegateList = { //_DT(typeof(Action)), //_DT(typeof(UnityEngine.Events.UnityAction)), //_DT(typeof(System.Predicate)), }; public static List dynamicList = new List() { //typeof(MeshRenderer), //typeof(BoxCollider), //typeof(MeshCollider), }; //重载函数,相同参数个数,相同位置out参数匹配出问题时, 需要强制匹配解决 //使用方法参见例子14 public static List outList = new List() { }; public static BindType _GT(Type t) { return new BindType(t); } public static DelegateType _DT(Type t) { return new DelegateType(t); } } #endif