using UnityEngine; using System; using System.Collections.Generic; using LuaInterface; using LuaFramework; using System.IO; using BindType = ToLuaMenu.BindType; using UnityEngine.UI; using System.Reflection; using UnityEngine.SceneManagement; public static class CustomSettings { public static string FrameworkPath = AppConst.FrameworkRoot; public static string saveDir = FrameworkPath + "/ToLua/Source/Generate/";//"../SyEngine/Assets/LuaFramework/ToLua/Source/Generate/"; public static string luaDir = AppConst.AppDataPath + "/Lua/"; public static string toluaBaseType = FrameworkPath + "/ToLua/BaseType/"; //public static string toluaLuaDir = FrameworkPath + "/ToLua/Lua"; //导出时强制做为静态类的类型(注意customTypeList 还要添加这个类型才能导出) //unity 有些类作为sealed class, 其实完全等价于静态类 public static List staticClassTypes = new List { 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), }; //附加导出委托类型(在导出委托时, customTypeList 中牵扯的委托类型都会导出, 无需写在这里) public static DelegateType[] customDelegateList = { _DT(typeof(Action)), _DT(typeof(UnityEngine.Events.UnityAction)), }; //在这里添加你要导出注册到lua的类型列表 public static BindType[] customTypeList = { //------------------------为例子导出-------------------------------- //_GT(typeof(TestEventListener)), //_GT(typeof(TestAccount)), //_GT(typeof(Dictionary)).SetLibName("AccountMap"), //_GT(typeof(KeyValuePair)), //_GT(typeof(TestExport)), //_GT(typeof(TestExport.Space)), //------------------------------------------------------------------- _GT(typeof(Debugger)).SetNameSpace(null), #if USING_DOTWEENING _GT(typeof(DG.Tweening.DOTween)), _GT(typeof(DG.Tweening.Tween)).SetBaseType(typeof(System.Object)).AddExtendType(typeof(DG.Tweening.TweenExtensions)), _GT(typeof(DG.Tweening.Sequence)).AddExtendType(typeof(DG.Tweening.TweenSettingsExtensions)), _GT(typeof(DG.Tweening.Tweener)).AddExtendType(typeof(DG.Tweening.TweenSettingsExtensions)), _GT(typeof(DG.Tweening.LoopType)), _GT(typeof(DG.Tweening.PathMode)), _GT(typeof(DG.Tweening.PathType)), _GT(typeof(DG.Tweening.RotateMode)), _GT(typeof(Component)).AddExtendType(typeof(DG.Tweening.ShortcutExtensions)), _GT(typeof(Transform)).AddExtendType(typeof(DG.Tweening.ShortcutExtensions)), _GT(typeof(Light)).AddExtendType(typeof(DG.Tweening.ShortcutExtensions)), _GT(typeof(Material)).AddExtendType(typeof(DG.Tweening.ShortcutExtensions)), _GT(typeof(Rigidbody)).AddExtendType(typeof(DG.Tweening.ShortcutExtensions)), _GT(typeof(Camera)).AddExtendType(typeof(DG.Tweening.ShortcutExtensions)), _GT(typeof(AudioSource)).AddExtendType(typeof(DG.Tweening.ShortcutExtensions)), //_GT(typeof(LineRenderer)).AddExtendType(typeof(DG.Tweening.ShortcutExtensions)), //_GT(typeof(TrailRenderer)).AddExtendType(typeof(DG.Tweening.ShortcutExtensions)), #else _GT(typeof(Component)), _GT(typeof(Transform)), _GT(typeof(Material)), // _GT(typeof(Light)), _GT(typeof(Rigidbody)), _GT(typeof(Rigidbody2D)), _GT(typeof(Camera)), _GT(typeof(AudioSource)), _GT(typeof(Canvas)), _GT(typeof(CanvasGroup)), _GT(typeof(LineRenderer)), #endif _GT(typeof(TrailRenderer)), _GT(typeof(Behaviour)), _GT(typeof(MonoBehaviour)), _GT(typeof(GameObject)), _GT(typeof(TrackedReference)), _GT(typeof(Application)), _GT(typeof(Physics)), _GT(typeof(Collider)), _GT(typeof(Time)), _GT(typeof(Resources)), _GT(typeof(Texture)), _GT(typeof(Texture2D)), _GT(typeof(TextSpacing)), _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(SpriteRenderer)), _GT(typeof(TextMesh)), _GT(typeof(TextAsset)), _GT(typeof(Space)), _GT(typeof(UIDepth)), _GT(typeof(RuntimePlatform)), _GT(typeof(TextAnchor)), _GT(typeof(MeshRenderer)), //_GT(typeof(ParticleEmitter)), //_GT(typeof(ParticleRenderer)), //_GT(typeof(ParticleAnimator)), //_GT(typeof(MB3_MeshBaker)), _GT(typeof(Mesh)), _GT(typeof(MeshFilter)), _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(AnimatorClipInfo)), _GT(typeof(AnimationState)), _GT(typeof(AnimatorCullingMode)), _GT(typeof(AnimatorStateInfo)), _GT(typeof(AnimationBlendMode)), _GT(typeof(QueueMode)), _GT(typeof(PlayMode)), _GT(typeof(WrapMode)), _GT(typeof(QualitySettings)), _GT(typeof(RenderSettings)), _GT(typeof(BlendWeights)), _GT(typeof(RenderTexture)), //for LuaFramework _GT(typeof(InlieText)), _GT(typeof(InlineSpriteManager)), _GT(typeof(RectTransform)), _GT(typeof(Text)), _GT(typeof(Outline)), _GT(typeof(InputField)), _GT(typeof(Font)), _GT(typeof(Button)), _GT(typeof(Toggle)), _GT(typeof(Slider)), _GT(typeof(Image)), _GT(typeof(Image.Type)), _GT(typeof(Image.FillMethod)), _GT(typeof(ImageExtend)), _GT(typeof(RawImageExtend)), _GT(typeof(Sprite)), _GT(typeof(RawImage)), _GT(typeof(Util)), _GT(typeof(AppConst)), _GT(typeof(EnglineVersion)), _GT(typeof(LuaHelper)), _GT(typeof(FileTools)), _GT(typeof(ByteBuffer)), _GT(typeof(LuaBehaviour)), _GT(typeof(LuaEventListener)), _GT(typeof(LuaClickListener)), _GT(typeof(LuaDragListener)), _GT(typeof(LuaDragExtendListener)), _GT(typeof(ScrollRect)), // _GT(typeof(GameManager)), _GT(typeof(DBParserManager)), _GT(typeof(AfterImageManager)), _GT(typeof(LuaManager)), _GT(typeof(PanelManager)), _GT(typeof(SoundManager)), _GT(typeof(TimerManager)), _GT(typeof(DownLoadResManager)), _GT(typeof(NetworkManager)), _GT(typeof(SocketClient)), _GT(typeof(ResourceManager)), _GT(typeof(OutsideResourceManager)), _GT(typeof(OutSideFileType)), _GT(typeof(ParticleManager)), _GT(typeof(ParticleSystemRenderer)), _GT(typeof(MapManager)), _GT(typeof(CookiesManager)), _GT(typeof(Map)), _GT(typeof(GameStateMachine)), _GT(typeof(GameMachineManager)), _GT(typeof(GameState)), _GT(typeof(LogManager)), _GT(typeof(DBParser)), _GT(typeof(HTTPRequest)), _GT(typeof(HTTPResponse)), _GT(typeof(HTTPManager)), _GT(typeof(LogType)), _GT(typeof(ParticleSystemScalingMode)), _GT(typeof(TextureWrapMode)), _GT(typeof(Rect)), _GT(typeof(Graphics)), _GT(typeof(LayoutElement)), _GT(typeof(Mask)), _GT(typeof(SDKManager)), _GT(typeof(EmptyRaycast)), _GT(typeof(ScrollRect.ScrollRectEvent)), _GT(typeof(Toggle.ToggleEvent)), _GT(typeof(InputField.SubmitEvent)), _GT(typeof(GameConfig)), _GT(typeof(NetworkReachability)), _GT(typeof(CompressHelper)), _GT(typeof(SystemInfo)), _GT(typeof(EffectMask)), _GT(typeof(Debug)), _GT(typeof(Resolution)), _GT(typeof(LayoutGroup)), _GT(typeof(GridLayoutGroup)), _GT(typeof(InputField.OnChangeEvent)), _GT(typeof(LuaOverClickListener)), _GT(typeof(VHScrollRect)), _GT(typeof(ToggleGroup)), _GT(typeof(SceneManager)), _GT(typeof(Terrain)), _GT(typeof(Slider.SliderEvent)), _GT(typeof(Matrix4x4)), _GT(typeof(ParticleSystem.MainModule)), _GT(typeof(Spine.Unity.SkeletonAnimation)), _GT(typeof(ScreenCapture)), _GT(typeof(UnityEngine.Video.VideoPlayer)), _GT(typeof(UnityEngine.Video.VideoRenderMode)), _GT(typeof(System.DateTime)), _GT(typeof(Optimizer)), _GT(typeof(UnityEngine.VerticalWrapMode)), _GT(typeof(UnityEngine.HorizontalWrapMode)), _GT(typeof(UnityEngine.MaterialPropertyBlock)), _GT(typeof(ScreenEffect)), _GT(typeof(PartBloom)), _GT(typeof(RenderBloomTexture)), _GT(typeof(RoleCameraBloom)), _GT(typeof(ChangeShaderRender)), _GT(typeof(AdaptiveText)), _GT(typeof(Radar)),//雷达图 _GT(typeof(FXAAEffect)),//FXAA _GT(typeof(PostEffect)),//后处理整合 // _GT(typeof(LuaPerfect.ObjectRef)), // _GT(typeof(LuaPerfect.ObjectItem)), // _GT(typeof(LuaPerfect.ObjectFormater)), _GT(typeof(RecordManager)), _GT(typeof(UnityStandardAssets.ImageEffects.BloomOptimized)), _GT(typeof(GL)), _GT(typeof(TMPro.TextMeshProUGUI)), _GT(typeof(TMPro.TMP_InputField)), _GT(typeof(RenderTextureFormat)), _GT(typeof(ParticleCollide)), _GT(typeof(ButtonExtend)), _GT(typeof(EmptyRaycastExtend)), _GT(typeof(ExtendButtonScale)), _GT(typeof(EraseHandler)), _GT(typeof(RadiusBlur)), }; public static List dynamicList = new List() { /*typeof(MeshRenderer), typeof(ParticleEmitter), typeof(ParticleRenderer), typeof(ParticleAnimator), typeof(BoxCollider), typeof(MeshCollider), typeof(SphereCollider), typeof(CharacterController), typeof(CapsuleCollider), typeof(Animation), typeof(AnimationClip), typeof(AnimationState), typeof(BlendWeights), typeof(RenderTexture), typeof(Rigidbody),*/ }; //重载函数,相同参数个数,相同位置out参数匹配出问题时, 需要强制匹配解决 //使用方法参见例子14 public static List outList = new List() { }; static BindType _GT(Type t) { return new BindType(t); } static DelegateType _DT(Type t) { return new DelegateType(t); } }