123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232 |
- #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<string>)),
- _GT(typeof(Dictionary<string,object>)),
- _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<Type> staticClassTypes = new List<Type>
- {
- //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<int>)),
- };
- public static List<Type> dynamicList = new List<Type>()
- {
- //typeof(MeshRenderer),
- //typeof(BoxCollider),
- //typeof(MeshCollider),
- };
- //重载函数,相同参数个数,相同位置out参数匹配出问题时, 需要强制匹配解决
- //使用方法参见例子14
- public static List<Type> outList = new List<Type>()
- {
- };
- public static BindType _GT(Type t)
- {
- return new BindType(t);
- }
- public static DelegateType _DT(Type t)
- {
- return new DelegateType(t);
- }
- }
- #endif
|