ExampleGenConfig.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. * Tencent is pleased to support the open source community by making xLua available.
  3. * Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
  4. * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
  5. * http://opensource.org/licenses/MIT
  6. * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
  7. */
  8. using System.Collections.Generic;
  9. using System;
  10. using UnityEngine;
  11. using XLua;
  12. //using System.Reflection;
  13. //using System.Linq;
  14. //配置的详细介绍请看Doc下《XLua的配置.doc》
  15. public static class ExampleGenConfig
  16. {
  17. //lua中要使用到C#库的配置,比如C#标准库,或者Unity API,第三方库等。
  18. [LuaCallCSharp]
  19. public static List<Type> LuaCallCSharp = new List<Type>() {
  20. typeof(System.Object),
  21. typeof(UnityEngine.Object),
  22. typeof(Vector2),
  23. typeof(Vector3),
  24. typeof(Vector4),
  25. typeof(Quaternion),
  26. typeof(Color),
  27. typeof(Ray),
  28. typeof(Bounds),
  29. typeof(Ray2D),
  30. typeof(Time),
  31. typeof(GameObject),
  32. typeof(Component),
  33. typeof(Behaviour),
  34. typeof(Transform),
  35. typeof(Resources),
  36. typeof(TextAsset),
  37. typeof(Keyframe),
  38. typeof(AnimationCurve),
  39. typeof(AnimationClip),
  40. typeof(MonoBehaviour),
  41. typeof(ParticleSystem),
  42. typeof(SkinnedMeshRenderer),
  43. typeof(Renderer),
  44. #pragma warning disable 2019
  45. #pragma warning disable 1634
  46. #pragma warning disable 618
  47. typeof(WWW),
  48. #pragma warning enable 618
  49. #pragma warning enable 1634
  50. #pragma warning enable 2019
  51. typeof(UnityEngine.Networking.UnityWebRequest),
  52. typeof(Light),
  53. typeof(Mathf),
  54. typeof(System.Collections.Generic.List<int>),
  55. typeof(Action<string>),
  56. typeof(UnityEngine.Debug)
  57. };
  58. //C#静态调用Lua的配置(包括事件的原型),仅可以配delegate,interface
  59. [CSharpCallLua]
  60. public static List<Type> CSharpCallLua = new List<Type>() {
  61. typeof(Action),
  62. typeof(Func<double, double, double>),
  63. typeof(Action<string>),
  64. typeof(Action<double>),
  65. typeof(UnityEngine.Events.UnityAction),
  66. typeof(System.Collections.IEnumerator)
  67. };
  68. //黑名单
  69. [BlackList]
  70. public static List<List<string>> BlackList = new List<List<string>>() {
  71. new List<string>(){"System.Xml.XmlNodeList", "ItemOf"},
  72. new List<string>(){"UnityEngine.WWW", "movie"},
  73. #if UNITY_WEBGL
  74. new List<string>(){"UnityEngine.WWW", "threadPriority"},
  75. #endif
  76. new List<string>(){"UnityEngine.Texture2D", "alphaIsTransparency"},
  77. new List<string>(){"UnityEngine.Security", "GetChainOfTrustValue"},
  78. new List<string>(){"UnityEngine.CanvasRenderer", "onRequestRebuild"},
  79. new List<string>(){"UnityEngine.Light", "areaSize"},
  80. new List<string>(){"UnityEngine.Light", "lightmapBakeType"},
  81. new List<string>(){"UnityEngine.WWW", "MovieTexture"},
  82. new List<string>(){"UnityEngine.WWW", "GetMovieTexture"},
  83. new List<string>(){"UnityEngine.AnimatorOverrideController", "PerformOverrideClipListCleanup"},
  84. #if !UNITY_WEBPLAYER
  85. new List<string>(){"UnityEngine.Application", "ExternalEval"},
  86. #endif
  87. new List<string>(){"UnityEngine.GameObject", "networkView"}, //4.6.2 not support
  88. new List<string>(){"UnityEngine.Component", "networkView"}, //4.6.2 not support
  89. new List<string>(){"System.IO.FileInfo", "GetAccessControl", "System.Security.AccessControl.AccessControlSections"},
  90. new List<string>(){"System.IO.FileInfo", "SetAccessControl", "System.Security.AccessControl.FileSecurity"},
  91. new List<string>(){"System.IO.DirectoryInfo", "GetAccessControl", "System.Security.AccessControl.AccessControlSections"},
  92. new List<string>(){"System.IO.DirectoryInfo", "SetAccessControl", "System.Security.AccessControl.DirectorySecurity"},
  93. new List<string>(){"System.IO.DirectoryInfo", "CreateSubdirectory", "System.String", "System.Security.AccessControl.DirectorySecurity"},
  94. new List<string>(){"System.IO.DirectoryInfo", "Create", "System.Security.AccessControl.DirectorySecurity"},
  95. new List<string>(){"UnityEngine.MonoBehaviour", "runInEditMode"},
  96. };
  97. }