fix unity 5.6 gen code error
@@ -32,6 +32,7 @@ namespace SLua
using UnityEditor;
using System.Text;
using System.Text.RegularExpressions;
+ using System.Runtime.CompilerServices;
public interface ICustomExportPost { }
@@ -119,6 +120,11 @@ namespace SLua
static bool filterType(Type t, List<string> noUseList, List<string> uselist)
{
+ if (t.IsDefined (typeof(CompilerGeneratedAttribute),false)) {
+ Debug.Log (t.Name + " is filtered out");
+ return false;
+ }
+
// check type in uselist
string fullName = t.FullName;
if (uselist != null && uselist.Count > 0)
@@ -652,7 +658,7 @@ namespace SLua
"Light.lightmappingMode",
"MonoBehaviour.runInEditMode",
"MonoBehaviour.useGUILayout",
-
+ "PlayableGraph.CreateScriptPlayable",
};
@@ -804,6 +810,10 @@ namespace SLua
if (!t.IsGenericTypeDefinition && (!IsObsolete(t) && t != typeof(YieldInstruction) && t != typeof(Coroutine))
|| (t.BaseType != null && t.BaseType == typeof(System.MulticastDelegate)))
{
+
+ if (t.IsNested && t.DeclaringType.IsPublic == false)
+ return false;
+
if (t.IsEnum)
{
StreamWriter file = Begin(t);
