فهرست منبع

(Sorry for the huge commit :( ):

* Support for Proxy objects
* Support for userdata custom converters improved significantly
* Support for sub-objects in property assigners
* MoonSharpHide attribute to specify members not to be exposed to Lua scripts
* MoonSharpVisible attribute now can be added to constructors too
* MoonSharpHidden attribute as a shortcut for MoonSharpVisible(false) also in an easier namespace to use
* UnityAssetScriptLoader has new constructors which don't require reflection use (to ease IL2CPP porting)
* Fixed a weird bug with using the same destination variable twice in a for-iterator statement (while syntax is parsed correctly, behavior is still undefined as it's not really correct Lua)
Xanathar 10 سال پیش
والد
کامیت
18bbfd0c88
37فایلهای تغییر یافته به همراه809 افزوده شده و 40 حذف شده
  1. 18 0
      src/MoonSharp.Interpreter.Tests/EndToEnd/ConfigPropertyAssignerTests.cs
  2. 50 0
      src/MoonSharp.Interpreter.Tests/EndToEnd/ProxyObjectsTests.cs
  3. 30 0
      src/MoonSharp.Interpreter.Tests/EndToEnd/SimpleTests.cs
  4. 1 0
      src/MoonSharp.Interpreter.Tests/MoonSharp.Interpreter.Tests.net35-client.csproj
  5. 9 2
      src/MoonSharp.Interpreter.Tests/TestRunner.cs
  6. 16 0
      src/MoonSharp.Interpreter/Interop/Attributes/MoonSharpHiddenAttribute.cs
  7. 28 0
      src/MoonSharp.Interpreter/Interop/Attributes/MoonSharpHideMemberAttribute.cs
  8. 2 1
      src/MoonSharp.Interpreter/Interop/Attributes/MoonSharpVisibleAttribute.cs
  9. 77 0
      src/MoonSharp.Interpreter/Interop/CustomConvertersCollection.cs
  10. 10 4
      src/MoonSharp.Interpreter/Interop/DescriptorHelpers.cs
  11. 85 4
      src/MoonSharp.Interpreter/Interop/PropertyTableAssigner.cs
  12. 48 0
      src/MoonSharp.Interpreter/Interop/ProxyObjects/DelegateProxyObjectFactory.cs
  13. 26 0
      src/MoonSharp.Interpreter/Interop/ProxyObjects/IScriptProxyObjectFactory.cs
  14. 36 19
      src/MoonSharp.Interpreter/Interop/StandardDescriptors/StandardUserDataDescriptor.cs
  15. 13 3
      src/MoonSharp.Interpreter/Loaders/UnityAssetsScriptLoader.cs
  16. 4 0
      src/MoonSharp.Interpreter/MoonSharp.Interpreter.net35-client.csproj
  17. 1 1
      src/MoonSharp.Interpreter/Script.cs
  18. 1 1
      src/MoonSharp.Interpreter/Tree/Statements/ForEachLoopStatement.cs
  19. 162 0
      src/Unity/UnityTestBed/Assembly-CSharp.csproj
  20. BIN
      src/Unity/UnityTestBed/Assets/1.unity
  21. BIN
      src/Unity/UnityTestBed/Assets/AssetStoreTools/Editor/AssetStoreToolsExtra.dll
  22. 52 0
      src/Unity/UnityTestBed/Assets/NewImageEffectShader.shader
  23. 58 0
      src/Unity/UnityTestBed/Assets/NewUnlitShader.shader
  24. BIN
      src/Unity/UnityTestBed/Assets/Plugins/MoonSharp.Interpreter.Tests.dll
  25. BIN
      src/Unity/UnityTestBed/Assets/Plugins/MoonSharp.Interpreter.dll
  26. 18 0
      src/Unity/UnityTestBed/Assets/TestRunner.cs
  27. 6 0
      src/Unity/UnityTestBed/Assets/link.xml
  28. BIN
      src/Unity/UnityTestBed/ProjectSettings/ClusterInputManager.asset
  29. BIN
      src/Unity/UnityTestBed/ProjectSettings/EditorBuildSettings.asset
  30. BIN
      src/Unity/UnityTestBed/ProjectSettings/GraphicsSettings.asset
  31. BIN
      src/Unity/UnityTestBed/ProjectSettings/ProjectSettings.asset
  32. 1 1
      src/Unity/UnityTestBed/ProjectSettings/ProjectVersion.txt
  33. BIN
      src/Unity/UnityTestBed/ProjectSettings/UnityAdsSettings.asset
  34. BIN
      src/Unity/UnityTestBed/ProjectSettings/UnityConnectSettings.asset
  35. 23 0
      src/Unity/UnityTestBed/UnityTestBed.sln
  36. 12 0
      src/Unity/UnityTestBed/UnityTestBed.userprefs
  37. 22 4
      src/Unity/UnityTestBed/UnityVS.UnityTestBed.CSharp.csproj

+ 18 - 0
src/MoonSharp.Interpreter.Tests/EndToEnd/ConfigPropertyAssignerTests.cs

@@ -10,6 +10,15 @@ namespace MoonSharp.Interpreter.Tests.EndToEnd
 	[TestFixture]
 	public class ConfigPropertyAssignerTests
 	{
+		private class MySubclass
+		{
+			[MoonSharpProperty]
+			public string MyString { get; set; }
+
+			[MoonSharpProperty("number")]
+			public int MyNumber { get; private set; }
+		}
+
 		private class MyClass
 		{
 			[MoonSharpProperty]
@@ -23,6 +32,9 @@ namespace MoonSharp.Interpreter.Tests.EndToEnd
 
 			[MoonSharpProperty]
 			public DynValue NativeValue { get; private set; }
+
+			[MoonSharpProperty]
+			public MySubclass SubObj { get; private set; }
 		}
 
 		private MyClass Test(string tableDef)
@@ -34,6 +46,9 @@ namespace MoonSharp.Interpreter.Tests.EndToEnd
 			Assert.AreEqual(DataType.Table, table.Type);
 
 			PropertyTableAssigner<MyClass> pta = new PropertyTableAssigner<MyClass>("class");
+			PropertyTableAssigner<MySubclass> pta2 = new PropertyTableAssigner<MySubclass>();
+
+			pta.SetSubassigner(pta2);
 
 			MyClass o = new MyClass();
 
@@ -52,11 +67,14 @@ namespace MoonSharp.Interpreter.Tests.EndToEnd
 				number = 3,
 				some_table = {},
 				nativeValue = function() end,
+				subObj = { number = 15, myString = 'hi' },
 				}");
 
 			Assert.AreEqual(x.MyNumber, 3);
 			Assert.AreEqual(x.MyString, "ciao");
 			Assert.AreEqual(x.NativeValue.Type, DataType.Function);
+			Assert.AreEqual(x.SubObj.MyNumber, 15);
+			Assert.AreEqual(x.SubObj.MyString, "hi");
 			Assert.IsNotNull(x.SomeTable);
 
 		}

+ 50 - 0
src/MoonSharp.Interpreter.Tests/EndToEnd/ProxyObjectsTests.cs

@@ -0,0 +1,50 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using MoonSharp.Interpreter.Interop;
+using NUnit.Framework;
+
+namespace MoonSharp.Interpreter.Tests.EndToEnd
+{
+	[TestFixture]
+	public class ProxyObjectsTests
+	{
+		private class Proxy
+		{
+			[MoonSharpVisible(false)]
+			public Random random;
+
+			[MoonSharpVisible(false)]
+			public Proxy(Random r)
+			{
+				random = r;
+			}
+
+			public int GetValue() { return 3; }
+		}
+
+		[Test]
+		public void ProxyTest()
+		{
+			Script.GlobalOptions.CustomConverters.RegisterProxy<Proxy, Random>(
+				r => new Proxy(r), p => p.random);
+
+			UserData.RegisterType<Proxy>();
+
+			Script S = new Script();
+
+			S.Globals["R"] = new Random();
+			S.Globals["func"] = (Action<Random>)(r => { Assert.IsNotNull(r); Assert.IsInstanceOf(typeof(Random), r); });
+
+			S.DoString(@"
+				x = R.GetValue();
+				func(R);
+			");
+
+			Assert.AreEqual(3.0, S.Globals.Get("x").Number);
+		}
+
+
+	}
+}

+ 30 - 0
src/MoonSharp.Interpreter.Tests/EndToEnd/SimpleTests.cs

@@ -1483,6 +1483,36 @@ namespace MoonSharp.Interpreter.Tests
 				");
 		}
 
+		[Test]
+		public void ParsingTest()
+		{
+			Script S = new Script(CoreModules.None);
+			DynValue res = S.LoadString(@"
+				t = {'a', 'b', 'c', ['d'] = 'f', ['e'] = 5, [65] = true, [true] = false}
+				function myFunc()
+				  return 'one', 'two'
+				end
+
+				print('Table Test 1:')
+				for k,v in pairs(t) do
+				  print(tostring(k) .. ' / ' .. tostring(v))
+				end
+				print('Table Test 2:')
+				for X,X in pairs(t) do
+				  print(tostring(X) .. ' / ' .. tostring(X))
+				end
+				print('Function Test 1:')
+				v1,v2 = myFunc()
+				print(v1)
+				print(v2)
+				print('Function Test 2:')
+				v,v = myFunc()
+				print(v)
+				print(v)
+				");			
+		}
+
+
 //		[Test]
 //		public void TestModulesLoadingWithoutCrash()
 //		{

+ 1 - 0
src/MoonSharp.Interpreter.Tests/MoonSharp.Interpreter.Tests.net35-client.csproj

@@ -128,6 +128,7 @@
     <Compile Include="EndToEnd\MetatableTests.cs">
       <SubType>Code</SubType>
     </Compile>
+    <Compile Include="EndToEnd\ProxyObjectsTests.cs" />
     <Compile Include="EndToEnd\StringLibTests.cs" />
     <Compile Include="EndToEnd\StructAssignmentTechnique.cs" />
     <Compile Include="EndToEnd\TailCallTests.cs" />

+ 9 - 2
src/MoonSharp.Interpreter.Tests/TestRunner.cs

@@ -62,9 +62,16 @@ namespace MoonSharp.Interpreter.Tests
 
 			Assembly asm = Assembly.GetExecutingAssembly();
 
-			foreach (Type t in asm.GetTypes().Where(t => t.GetCustomAttributes(typeof(TestFixtureAttribute), true).Any()))
+			Type[] types = asm.GetTypes().Where(t => t.GetCustomAttributes(typeof(TestFixtureAttribute), true).Any()).ToArray();
+
+			Console_WriteLine("Found {0} test types.", types.Length);
+
+			foreach (Type t in types)
 			{
-				foreach (MethodInfo mi in t.GetMethods().Where(m => m.GetCustomAttributes(typeof(TestAttribute), true).Any()))
+				MethodInfo[] tests = t.GetMethods().Where(m => m.GetCustomAttributes(typeof(TestAttribute), true).Any()).ToArray();
+				Console_WriteLine("Testing {0} - {1} tests found.", t.Name, tests.Length);
+
+				foreach (MethodInfo mi in tests)
 				{
 					if (whichTest != null && mi.Name != whichTest)
 						continue;

+ 16 - 0
src/MoonSharp.Interpreter/Interop/Attributes/MoonSharpHiddenAttribute.cs

@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace MoonSharp.Interpreter
+{
+	/// <summary>
+	/// Forces a class member visibility to scripts. Can be used to hide public members. Equivalent to MoonSharpVisible(false).
+	/// </summary>
+	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field
+		| AttributeTargets.Constructor | AttributeTargets.Event, Inherited = true, AllowMultiple = false)]
+	public sealed class MoonSharpHiddenAttribute : Attribute
+	{
+	}
+}

+ 28 - 0
src/MoonSharp.Interpreter/Interop/Attributes/MoonSharpHideMemberAttribute.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace MoonSharp.Interpreter
+{
+	/// <summary>
+	/// Lists a userdata member not to be exposed to scripts referencing it by name.
+	/// </summary>
+	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = true, AllowMultiple = true)]
+	public sealed class MoonSharpHideMemberAttribute : Attribute
+	{
+		/// <summary>
+		/// Gets the name of the member to be hidden.
+		/// </summary>
+		public string MemberName { get; private set; }
+
+		/// <summary>
+		/// Initializes a new instance of the <see cref="MoonSharpHideMemberAttribute"/> class.
+		/// </summary>
+		/// <param name="memberName">Name of the member to hide.</param>
+		public MoonSharpHideMemberAttribute(string memberName)
+		{
+			MemberName = memberName;
+		}
+	}
+}

+ 2 - 1
src/MoonSharp.Interpreter/Interop/Attributes/MoonSharpVisibleAttribute.cs

@@ -8,7 +8,8 @@ namespace MoonSharp.Interpreter.Interop
 	/// <summary>
 	/// Forces a class member visibility to scripts. Can be used to hide public members or to expose non-public ones.
 	/// </summary>
-	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event, Inherited = false, AllowMultiple = false)]
+	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field
+		| AttributeTargets.Constructor | AttributeTargets.Event, Inherited = true, AllowMultiple = false)]
 	public sealed class MoonSharpVisibleAttribute : Attribute
 	{
 		/// <summary>

+ 77 - 0
src/MoonSharp.Interpreter/Interop/CustomConvertersCollection.cs

@@ -12,6 +12,7 @@ namespace MoonSharp.Interpreter.Interop
 	public class CustomConvertersCollection 
 	{
 		private Dictionary<Type, Func<DynValue, object>>[] m_Script2Clr = new Dictionary<Type, Func<DynValue, object>>[(int)LuaTypeExtensions.MaxConvertibleTypes + 1];
+		private Dictionary<Type, Dictionary<Type, Func<object, object>>> m_Script2ClrUserData = new Dictionary<Type, Dictionary<Type, Func<object, object>>>();
 		private Dictionary<Type, Func<Script, object, DynValue>> m_Clr2Script = new Dictionary<Type, Func<Script, object, DynValue>>();
 
 		internal CustomConvertersCollection()
@@ -20,6 +21,52 @@ namespace MoonSharp.Interpreter.Interop
 				m_Script2Clr[i] = new Dictionary<Type, Func<DynValue, object>>();
 		}
 
+		public void SetScriptToClrUserDataSpecificCustomConversion(Type destType, Type userDataType, Func<object, object> converter = null)
+		{
+			var destTypeMap = m_Script2ClrUserData.GetOrCreate(destType, () => new Dictionary<Type, Func<object, object>>());
+			destTypeMap[userDataType] = converter;
+
+			SetScriptToClrCustomConversion(DataType.UserData, destType, v => DispatchUserDataCustomConverter(destTypeMap, v));
+		}
+
+		private object DispatchUserDataCustomConverter(Dictionary<Type, Func<object, object>> destTypeMap, DynValue v)
+		{
+			if (v.Type != DataType.UserData)
+				return null;
+
+			if (v.UserData.Object == null)
+				return null;
+
+			Type userDataType = v.UserData.Object.GetType();
+
+			Func<object, object> converter;
+
+			if (destTypeMap.TryGetValue(userDataType, out converter))
+			{
+				return converter(v.UserData.Object);
+			}
+
+			return null;
+		}
+
+		public Func<object, object> GetScriptToClrUserDataSpecificCustomConversion(Type destType, Type userDataType)
+		{
+			Dictionary<Type, Func<object, object>> destTypeMap;
+
+			if (m_Script2ClrUserData.TryGetValue(destType, out destTypeMap))
+			{
+				Func<object, object> converter;
+
+				if (destTypeMap.TryGetValue(userDataType, out converter))
+				{
+					return converter;
+				}
+			}
+
+			return null;
+		}
+
+
 
 		/// <summary>
 		/// Sets a custom converter from a script data type to a CLR data type. Set null to remove a previous custom converter.
@@ -121,6 +168,36 @@ namespace MoonSharp.Interpreter.Interop
 		}
 
 
+		/// <summary>
+		/// Registers a proxy handler
+		/// </summary>
+		/// <typeparam name="TProxy">The type of the proxy.</typeparam>
+		/// <typeparam name="TTarget">The type of the target.</typeparam>
+		/// <param name="proxyHandler">The proxy handler.</param>
+		public void RegisterProxy<TProxy, TTarget>(IProxyHandler<TProxy, TTarget> proxyHandler)
+			where TProxy : class
+			where TTarget : class
+		{
+			SetClrToScriptCustomConversion<TTarget>((s, t) => DynValue.FromObject(s, proxyHandler.ProxyWrap(t)));
+			SetScriptToClrCustomConversion(DataType.UserData, typeof(TTarget), v => proxyHandler.ProxyUnwrap((TProxy)v.UserData.Object));
+		}
+
+		/// <summary>
+		/// Registers a proxy handler using DelegateProxyHandler and the specified delegates.
+		/// </summary>
+		/// <typeparam name="TProxy">The type of the proxy.</typeparam>
+		/// <typeparam name="TTarget">The type of the target.</typeparam>
+		/// <param name="wrapDelegate">The wrap delegate.</param>
+		/// <param name="unwrapDelegate">The unwrap delegate.</param>
+		public void RegisterProxy<TProxy, TTarget>(Func<TTarget, TProxy> wrapDelegate, Func<TProxy, TTarget> unwrapDelegate)
+			where TProxy : class
+			where TTarget : class
+		{
+			RegisterProxy(new DelegateProxyHandler<TProxy, TTarget>(wrapDelegate, unwrapDelegate));
+		}
+
+
+
 		/// <summary>
 		/// Removes all converters.
 		/// </summary>

+ 10 - 4
src/MoonSharp.Interpreter/Interop/DescriptorHelpers.cs

@@ -12,24 +12,30 @@ namespace MoonSharp.Interpreter.Interop
 	public static class DescriptorHelpers
 	{
 		/// <summary>
-		/// Determines whether a 
-		/// <see cref="MoonSharpVisibleAttribute" /> is changing visibility of a member
+		/// Determines whether a
+		/// <see cref="MoonSharpVisibleAttribute" /> or a <see cref="MoonSharpHiddenAttribute" />  is changing visibility of a member
 		/// to scripts.
 		/// </summary>
 		/// <param name="mi">The member to check.</param>
 		/// <returns>
-		/// <c>true</c> if visibility is forced visible, 
+		/// <c>true</c> if visibility is forced visible,
 		/// <c>false</c> if visibility is forced hidden or the specified MemberInfo is null,
 		/// <c>if no attribute was found</c>
 		/// </returns>
+		/// <exception cref="System.InvalidOperationException">If both MoonSharpHiddenAttribute and MoonSharpVisibleAttribute are specified and they convey different messages.</exception>
 		public static bool? GetVisibilityFromAttributes(this MemberInfo mi)
 		{
 			if (mi == null)
 				return false;
 
 			MoonSharpVisibleAttribute va = mi.GetCustomAttributes(true).OfType<MoonSharpVisibleAttribute>().SingleOrDefault();
+			MoonSharpHiddenAttribute ha = mi.GetCustomAttributes(true).OfType<MoonSharpHiddenAttribute>().SingleOrDefault();
 
-			if (va != null)
+			if (va != null && ha != null && va.Visible)
+				throw new InvalidOperationException(string.Format("A member ('{0}') can't have discording MoonSharpHiddenAttribute and MoonSharpVisibleAttribute.", mi.Name));
+			else if (ha != null)
+				return false;
+			else if (va != null)
 				return va.Visible;
 			else
 				return null;

+ 85 - 4
src/MoonSharp.Interpreter/Interop/PropertyTableAssigner.cs

@@ -12,7 +12,7 @@ namespace MoonSharp.Interpreter.Interop
 	/// This is a generic version of <see cref="PropertyTableAssigner"/>.
 	/// </summary>
 	/// <typeparam name="T">The type of the object.</typeparam>
-	public class PropertyTableAssigner<T>
+	public class PropertyTableAssigner<T> : IPropertyTableAssigner
 	{
 		PropertyTableAssigner m_InternalAssigner;
 
@@ -54,6 +54,37 @@ namespace MoonSharp.Interpreter.Interop
 		{
 			return m_InternalAssigner;
 		}
+
+		/// <summary>
+		/// Sets the subassigner for the given type. Pass null to remove usage of subassigner for the given type.
+		/// </summary>
+		/// <param name="propertyType">Type of the property for which the subassigner will be used.</param>
+		/// <param name="assigner">The property assigner.</param>
+		public void SetSubassignerForType(Type propertyType, IPropertyTableAssigner assigner)
+		{
+			m_InternalAssigner.SetSubassignerForType(propertyType, assigner);
+		}
+
+		/// <summary>
+		/// Sets the subassigner for the given type
+		/// </summary>
+		/// <typeparam name="SubassignerType">Type of the property for which the subassigner will be used.</typeparam>
+		/// <param name="assigner">The property assigner.</param>
+		public void SetSubassigner<SubassignerType>(PropertyTableAssigner<SubassignerType> assigner)
+		{
+			m_InternalAssigner.SetSubassignerForType(typeof(SubassignerType), assigner);
+		}
+
+
+		/// <summary>
+		/// Assigns the properties of the specified object without checking the type.
+		/// </summary>
+		/// <param name="o">The object.</param>
+		/// <param name="data">The data.</param>
+		void IPropertyTableAssigner.AssignObjectUnchecked(object o, Table data)
+		{
+			AssignObject((T)o, data);
+		}
 	}
 
 
@@ -62,10 +93,11 @@ namespace MoonSharp.Interpreter.Interop
 	/// Properties must be decorated with the <see cref="MoonSharpPropertyAttribute"/>.
 	/// See <see cref="PropertyTableAssigner{T}"/> for a generic compile time type-safe version.
 	/// </summary>
-	public class PropertyTableAssigner 
+	public class PropertyTableAssigner : IPropertyTableAssigner
 	{
 		Type m_Type;
 		Dictionary<string, PropertyInfo> m_PropertyMap = new Dictionary<string, PropertyInfo>();
+		Dictionary<Type, IPropertyTableAssigner> m_SubAssigners = new Dictionary<Type, IPropertyTableAssigner>();
 
 		/// <summary>
 		/// Initializes a new instance of the <see cref="PropertyTableAssigner"/> class.
@@ -124,8 +156,19 @@ namespace MoonSharp.Interpreter.Interop
 
 				if (pi != null)
 				{
-					object o = Interop.Converters.ScriptToClrConversions.DynValueToObjectOfType(value,
-						pi.PropertyType, null, false);
+					object o;
+
+					if (value.Type == DataType.Table && m_SubAssigners.ContainsKey(pi.PropertyType))
+					{
+						var subassigner = m_SubAssigners[pi.PropertyType];
+						o = Activator.CreateInstance(pi.PropertyType);
+						subassigner.AssignObjectUnchecked(o, value.Table);
+					}
+					else
+					{
+						o = Interop.Converters.ScriptToClrConversions.DynValueToObjectOfType(value,
+							pi.PropertyType, null, false);
+					}
 
 					pi.GetSetMethod(true).Invoke(obj, new object[] { o });
 				}
@@ -172,5 +215,43 @@ namespace MoonSharp.Interpreter.Interop
 				AssignProperty(obj, pair.Key.String, pair.Value);
 			}
 		}
+
+		/// <summary>
+		/// Sets the subassigner for the given type. Pass null to remove usage of subassigner for the given type.
+		/// </summary>
+		/// <param name="propertyType">Type of the property for which the subassigner will be used.</param>
+		/// <param name="assigner">The property assigner.</param>
+		public void SetSubassignerForType(Type propertyType, IPropertyTableAssigner assigner)
+		{
+			if (propertyType.IsAbstract || propertyType.IsGenericType || propertyType.IsInterface || propertyType.IsValueType)
+			{
+				throw new ArgumentException("propertyType must be a concrete, reference type");
+			}
+
+			m_SubAssigners[propertyType] = assigner;
+		}
+
+		/// <summary>
+		/// Assigns the properties of the specified object without checking the type.
+		/// </summary>
+		/// <param name="o">The object.</param>
+		/// <param name="data">The data.</param>
+		void IPropertyTableAssigner.AssignObjectUnchecked(object obj, Table data)
+		{
+			this.AssignObject(obj, data);
+		}
+	}
+
+	/// <summary>
+	/// Common interface for property assigners - basically used for sub-assigners
+	/// </summary>
+	public interface IPropertyTableAssigner
+	{
+		/// <summary>
+		/// Assigns the properties of the specified object without checking the type.
+		/// </summary>
+		/// <param name="o">The object.</param>
+		/// <param name="data">The data.</param>
+		void AssignObjectUnchecked(object o, Table data);
 	}
 }

+ 48 - 0
src/MoonSharp.Interpreter/Interop/ProxyObjects/DelegateProxyObjectFactory.cs

@@ -0,0 +1,48 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace MoonSharp.Interpreter.Interop
+{
+	/// <summary>
+	/// Implementation of IScriptProxyObjectFactory taking two delegates for simple instancing of proxies.
+	/// </summary>
+	/// <typeparam name="TProxy">The type of the proxy.</typeparam>
+	/// <typeparam name="TTarget">The type of the target.</typeparam>
+	public class DelegateProxyHandler<TProxy, TTarget> : IProxyHandler<TProxy, TTarget>
+		where TProxy : class
+		where TTarget : class
+	{
+		Func<TTarget, TProxy> wrapDelegate;
+		Func<TProxy, TTarget> unwrapDelegate;
+
+		/// <summary>
+		/// Initializes a new instance of the <see cref="DelegateProxyHandler{TProxy, TTarget}"/> class.
+		/// </summary>
+		/// <param name="wrapDelegate">The proxy.</param>
+		/// <param name="unwrapDelegate">The deproxy.</param>
+		public DelegateProxyHandler(Func<TTarget, TProxy> wrapDelegate, Func<TProxy, TTarget> unwrapDelegate)
+		{
+			this.wrapDelegate = wrapDelegate;
+			this.unwrapDelegate = unwrapDelegate;
+		}
+
+		/// <summary>
+		/// Takes an instance of a proxy object and returns the real object behind it
+		/// </summary>
+		public TTarget ProxyUnwrap(TProxy proxyobj)
+		{
+			return unwrapDelegate(proxyobj);
+		}
+
+		/// <summary>
+		/// Takes an instance of a target object and returns a proxy object wrapping it
+		/// </summary>
+		public TProxy ProxyWrap(TTarget target)
+		{
+			return wrapDelegate(target);
+		}
+	}
+
+}

+ 26 - 0
src/MoonSharp.Interpreter/Interop/ProxyObjects/IScriptProxyObjectFactory.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace MoonSharp.Interpreter.Interop
+{
+	/// <summary>
+	/// Interface for proxy objects 
+	/// </summary>
+	/// <typeparam name="TProxy">The type of the proxy.</typeparam>
+	/// <typeparam name="TTarget">The type of the target.</typeparam>
+	public interface IProxyHandler<TProxy, TTarget>
+		where TProxy : class
+		where TTarget : class
+	{
+		/// <summary>
+		/// Takes an instance of a target object and returns a proxy object wrapping it
+		/// </summary>
+		TProxy ProxyWrap(TTarget target);
+		/// <summary>
+		/// Takes an instance of a proxy object and returns the real object behind it
+		/// </summary>
+		TTarget ProxyUnwrap(TProxy proxy);
+	}
+}

+ 36 - 19
src/MoonSharp.Interpreter/Interop/StandardDescriptors/StandardUserDataDescriptor.cs

@@ -20,7 +20,6 @@ namespace MoonSharp.Interpreter.Interop
 		/// </summary>
 		public InteropAccessMode AccessMode { get; private set; }
 
-
 		/// <summary>
 		/// Initializes a new instance of the <see cref="StandardUserDataDescriptor"/> class.
 		/// </summary>
@@ -49,6 +48,13 @@ namespace MoonSharp.Interpreter.Interop
 		/// </summary>
 		private void FillMemberList()
 		{
+			HashSet<string> membersToIgnore = new HashSet<string>(
+				this.Type
+					.GetCustomAttributes(typeof(MoonSharpHideMemberAttribute), true)
+					.OfType<MoonSharpHideMemberAttribute>()
+					.Select(a => a.MemberName)
+				);
+
 			Type type = this.Type;
 			var accessMode = this.AccessMode;
 
@@ -58,17 +64,22 @@ namespace MoonSharp.Interpreter.Interop
 			// add declared constructors
 			foreach (ConstructorInfo ci in type.GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static))
 			{
+				if (membersToIgnore.Contains("__new"))
+					continue;
+
 				AddMember("__new", MethodMemberDescriptor.TryCreateIfVisible(ci, this.AccessMode));
 			}
 
 			// valuetypes don't reflect their empty ctor.. actually empty ctors are a perversion, we don't care and implement ours
-			if (type.IsValueType)
+			if (type.IsValueType && !membersToIgnore.Contains("__new"))
 				AddMember("__new", new ValueTypeDefaultCtorMemberDescriptor(type));
 
 
 			// add methods to method list and metamethods
 			foreach (MethodInfo mi in type.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static))
 			{
+				if (membersToIgnore.Contains(mi.Name)) continue;
+
 				MethodMemberDescriptor md = MethodMemberDescriptor.TryCreateIfVisible(mi, this.AccessMode);
 
 				if (md != null)
@@ -95,7 +106,7 @@ namespace MoonSharp.Interpreter.Interop
 			// get properties
 			foreach (PropertyInfo pi in type.GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static))
 			{
-				if (pi.IsSpecialName || pi.GetIndexParameters().Any())
+				if (pi.IsSpecialName || pi.GetIndexParameters().Any() || membersToIgnore.Contains(pi.Name))
 					continue;
 
 				AddMember(pi.Name, PropertyMemberDescriptor.TryCreateIfVisible(pi, this.AccessMode));
@@ -104,7 +115,7 @@ namespace MoonSharp.Interpreter.Interop
 			// get fields
 			foreach (FieldInfo fi in type.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static))
 			{
-				if (fi.IsSpecialName)
+				if (fi.IsSpecialName || membersToIgnore.Contains(fi.Name))
 					continue;
 
 				AddMember(fi.Name, FieldMemberDescriptor.TryCreateIfVisible(fi, this.AccessMode));
@@ -113,7 +124,7 @@ namespace MoonSharp.Interpreter.Interop
 			// get events
 			foreach (EventInfo ei in type.GetEvents(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static))
 			{
-				if (ei.IsSpecialName)
+				if (ei.IsSpecialName || membersToIgnore.Contains(ei.Name))
 					continue;
 
 				AddMember(ei.Name, EventMemberDescriptor.TryCreateIfVisible(ei, this.AccessMode));
@@ -122,6 +133,9 @@ namespace MoonSharp.Interpreter.Interop
 			// get nested types and create statics
 			foreach (Type nestedType in type.GetNestedTypes(BindingFlags.NonPublic | BindingFlags.Public))
 			{
+				if (membersToIgnore.Contains(nestedType.Name))
+					continue;
+
 				if (!nestedType.IsGenericTypeDefinition)
 				{
 					if (nestedType.IsNestedPublic || nestedType.GetCustomAttributes(typeof(MoonSharpUserDataAttribute), true).Length > 0)
@@ -134,25 +148,28 @@ namespace MoonSharp.Interpreter.Interop
 				}
 			}
 
-			if (Type.IsArray)
+			if (!membersToIgnore.Contains("[this]"))
 			{
-				int rank = Type.GetArrayRank();
+				if (Type.IsArray)
+				{
+					int rank = Type.GetArrayRank();
 
-				ParameterDescriptor[] get_pars = new ParameterDescriptor[rank];
-				ParameterDescriptor[] set_pars = new ParameterDescriptor[rank + 1];
+					ParameterDescriptor[] get_pars = new ParameterDescriptor[rank];
+					ParameterDescriptor[] set_pars = new ParameterDescriptor[rank + 1];
 
-				for (int i = 0; i < rank; i++)
-					get_pars[i] = set_pars[i] = new ParameterDescriptor("idx" + i.ToString(), typeof(int));
+					for (int i = 0; i < rank; i++)
+						get_pars[i] = set_pars[i] = new ParameterDescriptor("idx" + i.ToString(), typeof(int));
 
-				set_pars[rank] = new ParameterDescriptor("value", Type.GetElementType());
+					set_pars[rank] = new ParameterDescriptor("value", Type.GetElementType());
 
-				AddMember(SPECIALNAME_INDEXER_SET, new ObjectCallbackMemberDescriptor(SPECIALNAME_INDEXER_SET, ArrayIndexerSet, set_pars));
-				AddMember(SPECIALNAME_INDEXER_GET, new ObjectCallbackMemberDescriptor(SPECIALNAME_INDEXER_GET, ArrayIndexerGet, get_pars));
-			}
-			else if (Type == typeof(Array))
-			{
-				AddMember(SPECIALNAME_INDEXER_SET, new ObjectCallbackMemberDescriptor(SPECIALNAME_INDEXER_SET, ArrayIndexerSet));
-				AddMember(SPECIALNAME_INDEXER_GET, new ObjectCallbackMemberDescriptor(SPECIALNAME_INDEXER_GET, ArrayIndexerGet));
+					AddMember(SPECIALNAME_INDEXER_SET, new ObjectCallbackMemberDescriptor(SPECIALNAME_INDEXER_SET, ArrayIndexerSet, set_pars));
+					AddMember(SPECIALNAME_INDEXER_GET, new ObjectCallbackMemberDescriptor(SPECIALNAME_INDEXER_GET, ArrayIndexerGet, get_pars));
+				}
+				else if (Type == typeof(Array))
+				{
+					AddMember(SPECIALNAME_INDEXER_SET, new ObjectCallbackMemberDescriptor(SPECIALNAME_INDEXER_SET, ArrayIndexerSet));
+					AddMember(SPECIALNAME_INDEXER_GET, new ObjectCallbackMemberDescriptor(SPECIALNAME_INDEXER_GET, ArrayIndexerGet));
+				}
 			}
 		}
 

+ 13 - 3
src/MoonSharp.Interpreter/Loaders/UnityAssetsScriptLoader.cs

@@ -34,6 +34,17 @@ namespace MoonSharp.Interpreter.Loaders
 			LoadResourcesWithReflection(assetsPath);
 		}
 
+		 
+		/// <summary>
+		/// Initializes a new instance of the <see cref="UnityAssetsScriptLoader"/> class.
+		/// </summary>
+		/// <param name="scriptToCodeMap">A dictionary mapping filenames to the proper Lua script code.</param>
+		public UnityAssetsScriptLoader(Dictionary<string, string> scriptToCodeMap)
+		{
+			m_Resources = scriptToCodeMap;
+		}
+
+
 		void LoadResourcesWithReflection(string assetsPath)
 		{
 			try
@@ -44,8 +55,7 @@ namespace MoonSharp.Interpreter.Loaders
 				MethodInfo textAssetNameGet = textAssetType.GetProperty("name").GetGetMethod();
 				MethodInfo textAssetTextGet = textAssetType.GetProperty("text").GetGetMethod();
 
-
-				MethodInfo loadAll = resourcesType.GetMethod("LoadAll", 
+				MethodInfo loadAll = resourcesType.GetMethod("LoadAll",
 					new Type[] { typeof(string), typeof(Type) });
 
 				Array array = (Array)loadAll.Invoke(null, new object[] { assetsPath, textAssetType });
@@ -62,7 +72,7 @@ namespace MoonSharp.Interpreter.Loaders
 			}
 			catch (Exception ex)
 			{
-				System.Diagnostics.Debug.WriteLine("UnityAssetsScriptLoader error : " + ex.Message);
+				Console.WriteLine("Error initializing UnityScriptLoader : {0}", ex);
 			}
 		}
 

+ 4 - 0
src/MoonSharp.Interpreter/MoonSharp.Interpreter.net35-client.csproj

@@ -139,6 +139,8 @@
     <Compile Include="DataStructs\ReferenceEqualityComparer.cs" />
     <Compile Include="Interop\Attributes\MoonSharpPropertyAttribute.cs" />
     <Compile Include="Interop\Attributes\MoonSharpUserDataMetamethodAttribute.cs" />
+    <Compile Include="Interop\Attributes\MoonSharpHideMemberAttribute.cs" />
+    <Compile Include="Interop\Attributes\MoonSharpHiddenAttribute.cs" />
     <Compile Include="Interop\BasicDescriptors\IMemberDescriptor.cs" />
     <Compile Include="Interop\BasicDescriptors\IOptimizableDescriptor.cs" />
     <Compile Include="Interop\BasicDescriptors\IOverloadableMemberDescriptor.cs" />
@@ -154,6 +156,8 @@
     <Compile Include="Interop\BasicDescriptors\DispatchingUserDataDescriptor.cs" />
     <Compile Include="Interop\IGeneratorUserDataDescriptor.cs" />
     <Compile Include="Interop\PropertyTableAssigner.cs" />
+    <Compile Include="Interop\ProxyObjects\DelegateProxyObjectFactory.cs" />
+    <Compile Include="Interop\ProxyObjects\IScriptProxyObjectFactory.cs" />
     <Compile Include="Interop\StandardDescriptors\EnumDescriptor.cs" />
     <Compile Include="Interop\StandardDescriptors\MemberDescriptors\ObjectCallbackMemberDescriptor.cs" />
     <Compile Include="Interop\StandardDescriptors\MemberDescriptors\FunctionMemberDescriptorBase.cs" />

+ 1 - 1
src/MoonSharp.Interpreter/Script.cs

@@ -28,7 +28,7 @@ namespace MoonSharp.Interpreter
 		/// <summary>
 		/// The version of the MoonSharp engine
 		/// </summary>
-		public const string VERSION = "1.1.0.0"; 
+		public const string VERSION = "1.2.0.0"; 
 
 		/// <summary>
 		/// The Lua version being supported

+ 1 - 1
src/MoonSharp.Interpreter/Tree/Statements/ForEachLoopStatement.cs

@@ -41,7 +41,7 @@ namespace MoonSharp.Interpreter.Tree.Statements
 			lcontext.Scope.PushBlock();
 
 			m_Names = names
-				.Select(n => lcontext.Scope.DefineLocal(n))
+				.Select(n => lcontext.Scope.TryDefineLocal(n))
 				.ToArray();
 
 			m_NameExps = m_Names

+ 162 - 0
src/Unity/UnityTestBed/Assembly-CSharp.csproj

@@ -0,0 +1,162 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>10.0.20506</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <RootNamespace></RootNamespace>
+    <ProjectGuid>{AD7D1EBC-977D-D15F-3A93-9E52E8413E13}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <AssemblyName>Assembly-CSharp</AssemblyName>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <BaseDirectory>Assets</BaseDirectory>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>Temp\bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE;UNITY_5_3_1;UNITY_5_3;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_SPRITE_POLYGON;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;ENABLE_LOCALIZATION;ENABLE_ANDROID_ATLAS_ETC1_COMPRESSION;ENABLE_EDITOR_TESTS_RUNNER;ENABLE_SUBSTANCE;ENABLE_GAMECENTER;ENABLE_NETWORK;ENABLE_LOG_MIXED_STACKTRACE;ENABLE_UNITYWEBREQUEST;ENABLE_TEXTUREID_MAP;PLAYERCONNECTION_LISTENS_FIXED_PORT;DEBUGGER_LISTENS_FIXED_PORT;PLATFORM_SUPPORTS_ADS_ID;SUPPORT_ENVIRONMENT_VARIABLES;PLATFORM_SUPPORTS_PROFILER;PLATFORM_HAS_NO_SUPPORT_FOR_BUCKET_ALLOCATOR;STRICTCPP_NEW_DELETE_SIGNATURES;WWW_USE_CURL;HAS_NEON_SKINNIG;UNITY_INPUT_SIMULATE_EVENTS;PLATFORM_ALWAYS_USES_STDOUT_FOR_LOG;ENABLE_UNITYADS_RUNTIME;UNITY_UNITYADS_API;UNITY_TVOS;UNITY_IPHONE_API;ENABLE_IL2CPP;DEVELOPMENT_BUILD;ENABLE_PROFILER;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX;ENABLE_IOS_ON_DEMAND_RESOURCES;ENABLE_IOS_APP_SLICING</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <NoWarn>0169</NoWarn>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>Temp\bin\Release\</OutputPath>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <NoWarn>0169</NoWarn>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.XML" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="UnityEngine">
+      <HintPath>/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll</HintPath>
+    </Reference>
+    <Reference Include="UnityEditor">
+      <HintPath>/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.dll</HintPath>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+     <Compile Include="Assets\TestRunner.cs" />
+     <None Include="Assets\Resources\Scripts\TestMore\203-lexico.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\014-fornum.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\314-regex.t.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\012-repeat.t.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\305-table.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\Modules\Test\Builder.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\106-table.t.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\108-userdata.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\203-lexico.t.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\221-table.t.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\306-math.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\107-thread.t.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\103-nil.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\304-string.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\306-math.t.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\104-number.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\301-basic.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\221-table.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\307-bit.t.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\320-stdin.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\304-string.t.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\106-table.txt" />
+     <None Include="Assets\Plugins\MoonSharp.Interpreter.xml" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\231-metatable.t.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\309-os.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\011-while.t.txt" />
+     <None Include="Assets\Plugins\nunit.framework.xml" />
+     <None Include="Assets\Resources\Scripts\TestMore\204-grammar.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\308-io.t.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\212-function.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\105-string.t.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\201-assign.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\200-examples.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\320-stdin.t.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\307-bit.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\012-repeat.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\000-sanity.t.txt" />
+     <None Include="Assets\Plugins\WSA\MoonSharp.Interpreter.xml" />
+     <None Include="Assets\Resources\Scripts\TestMore\015-forlist.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\104-number.t.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\108-userdata.t.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\231-metatable.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\309-os.t.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\Modules\Test\More.lua.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\223-iterator.t.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\214-coroutine.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\310-debug.t.txt" />
+     <None Include="Assets\link.xml" />
+     <None Include="Assets\Resources\Scripts\TestMore\308-io.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\102-function.t.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\214-coroutine.t.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\000-sanity.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\310-debug.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\222-constructor.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\001-if.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\213-closure.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\107-thread.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\Modules\Test\More.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\232-object.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\301-basic.t.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\Modules\Test\Builder.lua.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\011-while.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\002-table.t.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\305-table.t.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\101-boolean.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\211-scope.t.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\001-if.t.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\102-function.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\204-grammar.t.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\213-closure.t.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\222-constructor.t.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\212-function.t.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\014-fornum.t.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\232-object.t.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\103-nil.t.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\015-forlist.t.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\202-expr.t.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\101-boolean.t.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\223-iterator.txt" />
+     <None Include="Assets\NewImageEffectShader.shader" />
+     <None Include="Assets\Resources\Scripts\TestMore\002-table.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\202-expr.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\105-string.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\201-assign.t.txt" />
+     <None Include="Assets\Resources\MoonSharp\Scripts\200-examples.t.txt" />
+     <None Include="Assets\NewUnlitShader.shader" />
+     <None Include="Assets\Resources\Scripts\TestMore\211-scope.txt" />
+     <None Include="Assets\Resources\Scripts\TestMore\314-regex.txt" />
+ <Reference Include="UnityEngine.UI">
+ <HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.Networking">
+ <HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll</HintPath>
+ </Reference>
+ <Reference Include="MoonSharp.Interpreter">
+ <HintPath>/git/my/moonsharp/src/Unity/UnityTestBed/Assets/Plugins/MoonSharp.Interpreter.dll</HintPath>
+ </Reference>
+ <Reference Include="MoonSharp.Interpreter.Tests">
+ <HintPath>/git/my/moonsharp/src/Unity/UnityTestBed/Assets/Plugins/MoonSharp.Interpreter.Tests.dll</HintPath>
+ </Reference>
+ <Reference Include="nunit.framework">
+ <HintPath>/git/my/moonsharp/src/Unity/UnityTestBed/Assets/Plugins/nunit.framework.dll</HintPath>
+ </Reference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+  
+</Project>

BIN
src/Unity/UnityTestBed/Assets/1.unity


BIN
src/Unity/UnityTestBed/Assets/AssetStoreTools/Editor/AssetStoreToolsExtra.dll


+ 52 - 0
src/Unity/UnityTestBed/Assets/NewImageEffectShader.shader

@@ -0,0 +1,52 @@
+Shader "Hidden/NewImageEffectShader"
+{
+	Properties
+	{
+		_MainTex ("Texture", 2D) = "white" {}
+	}
+	SubShader
+	{
+		// No culling or depth
+		Cull Off ZWrite Off ZTest Always
+
+		Pass
+		{
+			CGPROGRAM
+			#pragma vertex vert
+			#pragma fragment frag
+			
+			#include "UnityCG.cginc"
+
+			struct appdata
+			{
+				float4 vertex : POSITION;
+				float2 uv : TEXCOORD0;
+			};
+
+			struct v2f
+			{
+				float2 uv : TEXCOORD0;
+				float4 vertex : SV_POSITION;
+			};
+
+			v2f vert (appdata v)
+			{
+				v2f o;
+				o.vertex = mul(UNITY_MATRIX_MVP, v.vertex);
+				o.uv = v.uv;
+				return o;
+			}
+			
+			sampler2D _MainTex;
+
+			fixed4 frag (v2f i) : SV_Target
+			{
+				fixed4 col = tex2D(_MainTex, i.uv);
+				// just invert the colors
+				col = 1 - col;
+				return col;
+			}
+			ENDCG
+		}
+	}
+}

+ 58 - 0
src/Unity/UnityTestBed/Assets/NewUnlitShader.shader

@@ -0,0 +1,58 @@
+Shader "Unlit/NewUnlitShader"
+{
+	Properties
+	{
+		_MainTex ("Texture", 2D) = "white" {}
+	}
+	SubShader
+	{
+		Tags { "RenderType"="Opaque" }
+		LOD 100
+
+		Pass
+		{
+			CGPROGRAM
+			#pragma vertex vert
+			#pragma fragment frag
+			// make fog work
+			#pragma multi_compile_fog
+			
+			#include "UnityCG.cginc"
+
+			struct appdata
+			{
+				float4 vertex : POSITION;
+				float2 uv : TEXCOORD0;
+			};
+
+			struct v2f
+			{
+				float2 uv : TEXCOORD0;
+				UNITY_FOG_COORDS(1)
+				float4 vertex : SV_POSITION;
+			};
+
+			sampler2D _MainTex;
+			float4 _MainTex_ST;
+			
+			v2f vert (appdata v)
+			{
+				v2f o;
+				o.vertex = mul(UNITY_MATRIX_MVP, v.vertex);
+				o.uv = TRANSFORM_TEX(v.uv, _MainTex);
+				UNITY_TRANSFER_FOG(o,o.vertex);
+				return o;
+			}
+			
+			fixed4 frag (v2f i) : SV_Target
+			{
+				// sample the texture
+				fixed4 col = tex2D(_MainTex, i.uv);
+				// apply fog
+				UNITY_APPLY_FOG(i.fogCoord, col);
+				return col;
+			}
+			ENDCG
+		}
+	}
+}

BIN
src/Unity/UnityTestBed/Assets/Plugins/MoonSharp.Interpreter.Tests.dll


BIN
src/Unity/UnityTestBed/Assets/Plugins/MoonSharp.Interpreter.dll


+ 18 - 0
src/Unity/UnityTestBed/Assets/TestRunner.cs

@@ -4,6 +4,8 @@ using System.Threading;
 using MoonSharp.Interpreter.Tests;
 using MoonSharp.Interpreter;
 using MoonSharp.Interpreter.Loaders;
+using System.Collections.Generic;
+using System.Linq;
 
 public class TestRunner : MonoBehaviour
 {
@@ -11,9 +13,25 @@ public class TestRunner : MonoBehaviour
 	object m_Lock = new object();
 	bool m_LastWasLine = true;
 
+    Dictionary<string, string> ReadAllScripts()
+    {
+        Dictionary<string, string> scripts = new  Dictionary<string, string>();
+
+        object[] result = Resources.LoadAll("MoonSharp/Scripts", typeof(TextAsset));
+
+        foreach(TextAsset ta in result.OfType<TextAsset>())
+        {
+            scripts.Add(ta.name, ta.text);
+        }
+
+        return scripts;
+    }
+
 	// Use this for initialization
 	void Start()
 	{
+        Script.DefaultOptions.ScriptLoader = new MoonSharp.Interpreter.Loaders.UnityAssetsScriptLoader(ReadAllScripts());
+
 		Debug.Log("STARTED!");
 		StartCoroutine(DoTests());
 	}

+ 6 - 0
src/Unity/UnityTestBed/Assets/link.xml

@@ -0,0 +1,6 @@
+<linker>
+    <assembly fullname="MoonSharp.Interpreter.Tests">
+        <type fullname="MoonSharp.Interpreter.Tests.SimpleTests" preserve="all" />
+        <type fullname="MoonSharp.Interpreter.Tests.*" preserve="all" />
+    </assembly>
+</linker> 

BIN
src/Unity/UnityTestBed/ProjectSettings/ClusterInputManager.asset


BIN
src/Unity/UnityTestBed/ProjectSettings/EditorBuildSettings.asset


BIN
src/Unity/UnityTestBed/ProjectSettings/GraphicsSettings.asset


BIN
src/Unity/UnityTestBed/ProjectSettings/ProjectSettings.asset


+ 1 - 1
src/Unity/UnityTestBed/ProjectSettings/ProjectVersion.txt

@@ -1,2 +1,2 @@
-m_EditorVersion: 5.0.0f4
+m_EditorVersion: 5.3.1f1
 m_StandardAssetsVersion: 0

BIN
src/Unity/UnityTestBed/ProjectSettings/UnityAdsSettings.asset


BIN
src/Unity/UnityTestBed/ProjectSettings/UnityConnectSettings.asset


+ 23 - 0
src/Unity/UnityTestBed/UnityTestBed.sln

@@ -0,0 +1,23 @@
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2008
+
+Project("{D10F82BE-7BDE-3FAF-1EF7-D7F63CE065FD}") = "UnityTestBed", "Assembly-CSharp.csproj", "{AD7D1EBC-977D-D15F-3A93-9E52E8413E13}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{AD7D1EBC-977D-D15F-3A93-9E52E8413E13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{AD7D1EBC-977D-D15F-3A93-9E52E8413E13}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{AD7D1EBC-977D-D15F-3A93-9E52E8413E13}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{AD7D1EBC-977D-D15F-3A93-9E52E8413E13}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(MonoDevelopProperties) = preSolution
+		StartupItem = Assembly-CSharp.csproj
+	EndGlobalSection
+EndGlobal

+ 12 - 0
src/Unity/UnityTestBed/UnityTestBed.userprefs

@@ -0,0 +1,12 @@
+<Properties StartupItem="Assembly-CSharp.csproj">
+  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" PreferredExecutionTarget="Unity.Instance.Unity Editor" />
+  <MonoDevelop.Ide.Workbench>
+    <Files>
+      <File FileName="Assets/NewImageEffectShader.shader" Line="1" Column="1" />
+    </Files>
+  </MonoDevelop.Ide.Workbench>
+  <MonoDevelop.Ide.DebuggingService.Breakpoints>
+    <BreakpointStore />
+  </MonoDevelop.Ide.DebuggingService.Breakpoints>
+  <MonoDevelop.Ide.DebuggingService.PinnedWatches />
+</Properties>

+ 22 - 4
src/Unity/UnityTestBed/UnityVS.UnityTestBed.CSharp.csproj

@@ -16,8 +16,8 @@
     <TargetFrameworkProfile>Unity Subset v3.5</TargetFrameworkProfile>
     <CompilerResponseFile></CompilerResponseFile>
     <UnityProjectType>Game:1</UnityProjectType>
-    <UnityBuildTarget>StandaloneWindows:5</UnityBuildTarget>
-    <UnityVersion>5.0.0f4</UnityVersion>
+    <UnityBuildTarget>tvOS:37</UnityBuildTarget>
+    <UnityVersion>5.3.1f1</UnityVersion>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
@@ -25,7 +25,7 @@
     <OutputPath>Temp\UnityVS_bin\Debug\</OutputPath>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <DefineConstants>DEBUG;TRACE;UNITY_5_0_0;UNITY_5_0;UNITY_5;ENABLE_LICENSE_RENAME;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_NEW_HIERARCHY;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_NONPRO;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_MONO;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN</DefineConstants>
+    <DefineConstants>DEBUG;TRACE;UNITY_5_3_1;UNITY_5_3;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_SPRITE_POLYGON;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;ENABLE_LOCALIZATION;ENABLE_ANDROID_ATLAS_ETC1_COMPRESSION;ENABLE_EDITOR_TESTS_RUNNER;ENABLE_SUBSTANCE;ENABLE_GAMECENTER;ENABLE_NETWORK;ENABLE_LOG_MIXED_STACKTRACE;ENABLE_UNITYWEBREQUEST;ENABLE_TEXTUREID_MAP;PLAYERCONNECTION_LISTENS_FIXED_PORT;DEBUGGER_LISTENS_FIXED_PORT;PLATFORM_SUPPORTS_ADS_ID;SUPPORT_ENVIRONMENT_VARIABLES;PLATFORM_SUPPORTS_PROFILER;PLATFORM_HAS_NO_SUPPORT_FOR_BUCKET_ALLOCATOR;STRICTCPP_NEW_DELETE_SIGNATURES;WWW_USE_CURL;HAS_NEON_SKINNIG;UNITY_INPUT_SIMULATE_EVENTS;PLATFORM_ALWAYS_USES_STDOUT_FOR_LOG;ENABLE_UNITYADS_RUNTIME;UNITY_UNITYADS_API;UNITY_TVOS;UNITY_IPHONE_API;ENABLE_IL2CPP;DEVELOPMENT_BUILD;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX;ENABLE_IOS_ON_DEMAND_RESOURCES;ENABLE_IOS_APP_SLICING</DefineConstants>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
@@ -33,7 +33,7 @@
     <OutputPath>Temp\UnityVS_bin\Release\</OutputPath>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <DefineConstants>TRACE;UNITY_5_0_0;UNITY_5_0;UNITY_5;ENABLE_LICENSE_RENAME;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_NEW_HIERARCHY;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_NONPRO;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_MONO;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN</DefineConstants>
+    <DefineConstants>TRACE;UNITY_5_3_1;UNITY_5_3;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_SPRITE_POLYGON;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;ENABLE_LOCALIZATION;ENABLE_ANDROID_ATLAS_ETC1_COMPRESSION;ENABLE_EDITOR_TESTS_RUNNER;ENABLE_SUBSTANCE;ENABLE_GAMECENTER;ENABLE_NETWORK;ENABLE_LOG_MIXED_STACKTRACE;ENABLE_UNITYWEBREQUEST;ENABLE_TEXTUREID_MAP;PLAYERCONNECTION_LISTENS_FIXED_PORT;DEBUGGER_LISTENS_FIXED_PORT;PLATFORM_SUPPORTS_ADS_ID;SUPPORT_ENVIRONMENT_VARIABLES;PLATFORM_SUPPORTS_PROFILER;PLATFORM_HAS_NO_SUPPORT_FOR_BUCKET_ALLOCATOR;STRICTCPP_NEW_DELETE_SIGNATURES;WWW_USE_CURL;HAS_NEON_SKINNIG;UNITY_INPUT_SIMULATE_EVENTS;PLATFORM_ALWAYS_USES_STDOUT_FOR_LOG;ENABLE_UNITYADS_RUNTIME;UNITY_UNITYADS_API;UNITY_TVOS;UNITY_IPHONE_API;ENABLE_IL2CPP;DEVELOPMENT_BUILD;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX;ENABLE_IOS_ON_DEMAND_RESOURCES;ENABLE_IOS_APP_SLICING</DefineConstants>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="mscorlib" />
@@ -52,6 +52,21 @@
     <Reference Include="UnityEngine.UI">
       <HintPath>Library\UnityAssemblies\UnityEngine.UI.dll</HintPath>
     </Reference>
+    <Reference Include="UnityEngine.Networking">
+      <HintPath>Library\UnityAssemblies\UnityEngine.Networking.dll</HintPath>
+    </Reference>
+    <Reference Include="UnityEditor.iOS.Extensions.Xcode">
+      <HintPath>Library\UnityAssemblies\UnityEditor.iOS.Extensions.Xcode.dll</HintPath>
+    </Reference>
+    <Reference Include="UnityEditor.iOS.Extensions.Common">
+      <HintPath>Library\UnityAssemblies\UnityEditor.iOS.Extensions.Common.dll</HintPath>
+    </Reference>
+    <Reference Include="UnityEditor.iOS.Extensions.Xcode">
+      <HintPath>Library\UnityAssemblies\UnityEditor.iOS.Extensions.Xcode.dll</HintPath>
+    </Reference>
+    <Reference Include="UnityEditor.iOS.Extensions.Common">
+      <HintPath>Library\UnityAssemblies\UnityEditor.iOS.Extensions.Common.dll</HintPath>
+    </Reference>
     <Reference Include="MoonSharp.Interpreter">
       <HintPath>Assets\Plugins\MoonSharp.Interpreter.dll</HintPath>
     </Reference>
@@ -66,6 +81,9 @@
     <Compile Include="Assets\TestRunner.cs" />
   </ItemGroup>
   <ItemGroup>
+    <None Include="Assets\link.xml" />
+    <None Include="Assets\NewImageEffectShader.shader" />
+    <None Include="Assets\NewUnlitShader.shader" />
     <None Include="Assets\Plugins\MoonSharp.Interpreter.xml" />
     <None Include="Assets\Plugins\nunit.framework.xml" />
     <None Include="Assets\Plugins\WSA\MoonSharp.Interpreter.xml" />