diff --git a/Assets/Example/ExampleBehaviour.cs b/Assets/Example/ExampleBehaviour.cs index 8429b4b..78756a9 100644 --- a/Assets/Example/ExampleBehaviour.cs +++ b/Assets/Example/ExampleBehaviour.cs @@ -3,131 +3,42 @@ using NLua; -public class ExampleBehaviour : MonoBehaviour { +public class ExampleBehaviour : NLuaBehaviour +{ + protected override string LuaScriptFileName + { + get { return "ExampleBehaviour.lua"; } + } - string source = @" -import 'System' -import 'UnityEngine' -import 'Assembly-CSharp' -- The user-code assembly generated by Unity. + public override void Awake() + { + base.Awake(); -local Angle = Vector3.up; -local Speed = 5; - -local showEnv = false -local envScroll = Vector2.zero - -function Update() - transform:RotateAround(transform.position,Angle,Speed * Time.deltaTime) - - if Input.GetKey(KeyCode.W) then - Speed = Speed + 1 - end - - if Input.GetKey(KeyCode.S) then - Speed = Speed - 1 - end - - if Input.GetKey(KeyCode.A) then - Angle.z = Angle.z + 1 - end - - if Input.GetKey(KeyCode.D) then - Angle.z = Angle.z - 1 - end - -end - -function OnGUI() - GUILayout.BeginArea(Rect(10,10,(Screen.width / 2) - 20,Screen.height - 20)) - - -- Adding '{ }' to the end of GUI functions satisfies their 'params' argument. - GUILayout.Label('[W/S] Speed: ' .. Speed) - GUILayout.Label('[A/D] Rot Angle: ' .. Angle:ToString()) - - GUILayout.EndArea() - - GUILayout.BeginArea(Rect((Screen.width / 2) + 10,10,(Screen.width / 2) - 20,Screen.height - 20)) - - if GUILayout.Button('Show Enviroment',{ }) then - showEnv = not showEnv - end - - if showEnv then - envScroll = GUILayout.BeginScrollView(envScroll,{ }) - for k, v in pairs(_G) do - GUILayout.BeginHorizontal({ }) - - GUILayout.Label(k,{ }) - GUILayout.FlexibleSpace() - GUILayout.Label(tostring(v),{ }) - - GUILayout.EndHorizontal() - end - GUILayout.EndScrollView() - end - - GUILayout.EndArea() -end - -"; - - Lua env; - - void Awake() { - env = new Lua(); - env.LoadCLRPackage(); - env["this"] = this; // Give the script access to the gameobject. env["transform"] = transform; - - //System.Object[] result = new System.Object[0]; - try { - //result = env.DoString(source); - env.DoString(source); - } catch(NLua.Exceptions.LuaException e) { - Debug.LogError(FormatException(e), gameObject); - } - } - void Start () { - Call("Start"); + void Start () + { + if (initialized == true) + { + Call("Start"); + } } - void Update () { - Call("Update"); - } - - void OnGUI() { - Call("OnGUI"); - } - - public System.Object[] Call(string function, params System.Object[] args) { - System.Object[] result = new System.Object[0]; - if(env == null) return result; - LuaFunction lf = env.GetFunction(function); - if(lf == null) return result; - try { - // Note: calling a function that does not - // exist does not throw an exception. - if(args != null) { - result = lf.Call(args); - } else { - result = lf.Call(); - } - } catch(NLua.Exceptions.LuaException e) { - Debug.LogError(FormatException(e), gameObject); - throw e; - } - return result; - } - - public System.Object[] Call(string function) { - return Call(function, null); + void Update () + { + if (initialized == true) + { + Call("Update"); + } } - public static string FormatException(NLua.Exceptions.LuaException e) { - string source = (string.IsNullOrEmpty(e.Source)) ? "" : e.Source.Substring(0, e.Source.Length - 2); - return string.Format("{0}\nLua (at {2})", e.Message, string.Empty, source); + void OnGUI() + { + if (initialized == true) + { + Call("OnGUI"); + } } } diff --git a/Assets/Example/NLuaBehaviour.cs b/Assets/Example/NLuaBehaviour.cs new file mode 100644 index 0000000..da41608 --- /dev/null +++ b/Assets/Example/NLuaBehaviour.cs @@ -0,0 +1,89 @@ +using UnityEngine; +using System.Collections; + +using NLua; + +public abstract class NLuaBehaviour : MonoBehaviour +{ + protected bool initialized; + protected Lua env; + + protected abstract string LuaScriptFileName + { + get; + } + + public virtual void Awake() + { + env = new Lua(); + env.LoadCLRPackage(); + + StartCoroutine(LoadFile(LuaScriptFileName)); + } + + public System.Object[] Call(string function, params System.Object[] args) + { + System.Object[] result = new System.Object[0]; + if (env == null) return result; + LuaFunction lf = env.GetFunction(function); + if (lf == null) return result; + try + { + // Note: calling a function that does not + // exist does not throw an exception. + if (args != null) + { + result = lf.Call(args); + } + else + { + result = lf.Call(); + } + } + catch (NLua.Exceptions.LuaException e) + { + Debug.LogError(FormatException(e), gameObject); + } + return result; + } + + public System.Object[] Call(string function) + { + return Call(function, null); + } + + public static string FormatException(NLua.Exceptions.LuaException e) + { + string source = (string.IsNullOrEmpty(e.Source)) ? "" : e.Source.Substring(0, e.Source.Length - 2); + return string.Format("{0}\nLua (at {2})", e.Message, string.Empty, source); + } + + public IEnumerator LoadFile(string luaFileName) + { + string filePath = Application.streamingAssetsPath + "/" + luaFileName; + + string luaScript = null; + if (filePath.Contains("://")) + { + WWW www = new WWW(filePath); + yield return www; + + luaScript = www.text; + } + else + { + luaScript = System.IO.File.ReadAllText(filePath); + } + + try + { + env.DoString(luaScript); + } + catch (NLua.Exceptions.LuaException e) + { + Debug.LogError(FormatException(e), gameObject); + } + + initialized = true; + } +} diff --git a/Assets/Example/NLuaBehaviour.cs.meta b/Assets/Example/NLuaBehaviour.cs.meta new file mode 100644 index 0000000..c9c4d48 --- /dev/null +++ b/Assets/Example/NLuaBehaviour.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 16220a520932f824493fcd70988361ea +timeCreated: 1449804880 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Example/SpawnSphere.cs b/Assets/Example/SpawnSphere.cs index b8b9bd9..5e57e39 100644 --- a/Assets/Example/SpawnSphere.cs +++ b/Assets/Example/SpawnSphere.cs @@ -3,80 +3,45 @@ using NLua; -public class SpawnSphere : MonoBehaviour { - - string source = @" -import 'System' -import 'UnityEngine' -import 'Assembly-CSharp' -- The user-code assembly generated by Unity - -function Update() - if Input.GetKey(KeyCode.Space) then - GameObject.Instantiate(sphere, transform.position, Quaternion.identity) - end -end - -"; - - Lua env; +public class SpawnSphere : NLuaBehaviour +{ + protected override string LuaScriptFileName + { + get { return "SpawnSphere.lua"; } + } public GameObject sphere; - void Awake() { - env = new Lua(); - env.LoadCLRPackage(); + public override void Awake() + { + base.Awake(); env["this"] = this; env["transform"] = transform; env["sphere"] = sphere; // Give the script access to the prefab. - - //System.Object[] result = new System.Object[0]; - try { - //result = env.DoString(source); - env.DoString(source); - } catch(NLua.Exceptions.LuaException e) { - Debug.LogError(FormatException(e), gameObject); - } - - } - - void Start() { - Call("Start"); - } - - void Update() { - Call("Update"); - } - - void OnGUI() { - Call("OnGUI"); } - public System.Object[] Call(string function, params System.Object[] args) { - System.Object[] result = new System.Object[0]; - if(env == null) return result; - LuaFunction lf = env.GetFunction(function); - if(lf == null) return result; - try { - // Note: calling a function that does not - // exist does not throw an exception. - if(args != null) { - result = lf.Call(args); - } else { - result = lf.Call(); - } - } catch(NLua.Exceptions.LuaException e) { - Debug.LogError(FormatException(e), gameObject); - } - return result; + void Start() + { + if (initialized == true) + { + Call("Start"); + } } - public System.Object[] Call(string function) { - return Call(function, null); + void Update() + { + if (initialized == true) + { + Call("Update"); + } } - public static string FormatException(NLua.Exceptions.LuaException e) { - string source = (string.IsNullOrEmpty(e.Source)) ? "" : e.Source.Substring(0, e.Source.Length - 2); - return string.Format("{0}\nLua (at {2})", e.Message, string.Empty, source); + void OnGUI() + { + if (initialized == true) + { + Call("OnGUI"); + } } } diff --git a/Assets/Example/Sphere.prefab.meta b/Assets/Example/Sphere.prefab.meta index 2a21fa9..c94ebea 100644 --- a/Assets/Example/Sphere.prefab.meta +++ b/Assets/Example/Sphere.prefab.meta @@ -1,4 +1,6 @@ fileFormatVersion: 2 -guid: bfa161fc153e32046a29630e75799ad7 +guid: aa19b85ee62ca440b8b7ea141c2ea0f5 NativeFormatImporter: userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Example/TestBehaviour.cs b/Assets/Example/TestBehaviour.cs index 5ff723e..73032b3 100644 --- a/Assets/Example/TestBehaviour.cs +++ b/Assets/Example/TestBehaviour.cs @@ -3,79 +3,42 @@ using NLua; -public class TestBehaviour : MonoBehaviour { +public class TestBehaviour : NLuaBehaviour +{ + protected override string LuaScriptFileName + { + get { return "TestBehaviour.lua"; } + } - string source = @" -import 'System' -import 'UnityEngine' -import 'Assembly-CSharp' -- The user-code assembly generated by Unity - -function Start() - -- `ExampleBehaviour` class is not in a namespace, which is - -- typical of C# scripts in Unity. This should successfully - -- resolve to a ProxyType as of NLua commit [dc976e8] - Debug.Log(ExampleBehaviour) - Debug.Log(this:GetComponent('Transform')) -end - -"; - - Lua env; - - void Awake() { - env = new Lua(); - env.LoadCLRPackage(); + public override void Awake() + { + base.Awake(); env["this"] = this; // Give the script access to the gameobject. env["transform"] = transform; - - //System.Object[] result = new System.Object[0]; - try { - //result = env.DoString(source); - env.DoString(source); - } catch(NLua.Exceptions.LuaException e) { - Debug.LogError(FormatException(e), gameObject); - } - - } - - void Start() { - Call("Start"); - } - - void Update() { - Call("Update"); - } - - void OnGUI() { - Call("OnGUI"); } - public System.Object[] Call(string function, params System.Object[] args) { - System.Object[] result = new System.Object[0]; - if(env == null) return result; - LuaFunction lf = env.GetFunction(function); - if(lf == null) return result; - try { - // Note: calling a function that does not - // exist does not throw an exception. - if(args != null) { - result = lf.Call(args); - } else { - result = lf.Call(); - } - } catch(NLua.Exceptions.LuaException e) { - Debug.LogError(FormatException(e), gameObject); - } - return result; + void Start() + { + if (initialized == true) + { + Call("Start"); + } } - public System.Object[] Call(string function) { - return Call(function, null); + void Update() + { + if (initialized == true) + { + Call("Update"); + } } - public static string FormatException(NLua.Exceptions.LuaException e) { - string source = (string.IsNullOrEmpty(e.Source)) ? "" : e.Source.Substring(0, e.Source.Length - 2); - return string.Format("{0}\nLua (at {2})", e.Message, string.Empty, source); + void OnGUI() + { + if (initialized == true) + { + Call("OnGUI"); + } } } diff --git a/Assets/Example/example.unity b/Assets/Example/example.unity index 256b9df..88c91f1 100644 --- a/Assets/Example/example.unity +++ b/Assets/Example/example.unity @@ -12,57 +12,68 @@ SceneSettings: backfaceThreshold: 100 --- !u!104 &2 RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 m_Fog: 0 m_FogColor: {r: .5, g: .5, b: .5, a: 1} m_FogMode: 3 m_FogDensity: .00999999978 m_LinearFogStart: 0 m_LinearFogEnd: 300 - m_AmbientLight: {r: .200000003, g: .200000003, b: .200000003, a: 1} + m_AmbientSkyColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} + m_AmbientEquatorColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} + m_AmbientGroundColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 m_SkyboxMaterial: {fileID: 0} m_HaloStrength: .5 m_FlareStrength: 1 m_FlareFadeSpeed: 3 m_HaloTexture: {fileID: 0} - m_SpotCookie: {fileID: 0} - m_ObjectHideFlags: 0 ---- !u!127 &3 -LevelGameManager: - m_ObjectHideFlags: 0 + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} --- !u!157 &4 LightmapSettings: m_ObjectHideFlags: 0 - m_LightProbes: {fileID: 0} - m_Lightmaps: [] + serializedVersion: 5 + m_GIWorkflowMode: 1 m_LightmapsMode: 1 - m_BakedColorSpace: 0 - m_UseDualLightmapsInForward: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 m_LightmapEditorSettings: - m_Resolution: 50 - m_LastUsedResolution: 0 + serializedVersion: 3 + m_Resolution: 1 + m_BakeResolution: 50 m_TextureWidth: 1024 m_TextureHeight: 1024 - m_BounceBoost: 1 - m_BounceIntensity: 1 - m_SkyLightColor: {r: .860000014, g: .930000007, b: 1, a: 1} - m_SkyLightIntensity: 0 - m_Quality: 0 - m_Bounces: 1 - m_FinalGatherRays: 1000 - m_FinalGatherContrastThreshold: .0500000007 - m_FinalGatherGradientThreshold: 0 - m_FinalGatherInterpolationPoints: 15 - m_AOAmount: 0 - m_AOMaxDistance: .100000001 - m_AOContrast: 1 - m_LODSurfaceMappingDistance: 1 - m_Padding: 0 + m_AOMaxDistance: 1 + m_Padding: 2 + m_CompAOExponent: 0 + m_LightmapParameters: {fileID: 0} m_TextureCompression: 0 - m_LockAtlas: 0 + m_FinalGather: 0 + m_FinalGatherRayCount: 1024 + m_ReflectionCompression: 2 + m_LightmapSnapshot: {fileID: 0} + m_RuntimeCPUUsage: 25 --- !u!196 &5 NavMeshSettings: + serializedVersion: 2 m_ObjectHideFlags: 0 m_BuildSettings: + serializedVersion: 2 agentRadius: .5 agentHeight: 2 agentSlope: 45 @@ -71,9 +82,96 @@ NavMeshSettings: maxJumpAcrossDistance: 0 accuratePlacement: 0 minRegionArea: 2 - widthInaccuracy: 16.666666 - heightInaccuracy: 10 - m_NavMesh: {fileID: 0} + cellSize: .166666657 + manualCellSize: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &90716564 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 90716569} + - 33: {fileID: 90716568} + - 65: {fileID: 90716567} + - 23: {fileID: 90716566} + - 114: {fileID: 90716565} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &90716565 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 90716564} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 00df89d07bdd9ab4db246ee1555e510b, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!23 &90716566 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 90716564} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_UseLightProbes: 1 + m_ReflectionProbeUsage: 1 + m_ProbeAnchor: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: .5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 +--- !u!65 &90716567 +BoxCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 90716564} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &90716568 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 90716564} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &90716569 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 90716564} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 3 --- !u!1 &197087827 GameObject: m_ObjectHideFlags: 0 @@ -97,10 +195,10 @@ Light: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 197087827} m_Enabled: 1 - serializedVersion: 3 + serializedVersion: 6 m_Type: 0 m_Color: {r: 1, g: 1, b: 1, a: 1} - m_Intensity: 1 + m_Intensity: 2 m_Range: 10 m_SpotAngle: 30 m_CookieSize: 10 @@ -109,21 +207,18 @@ Light: m_Resolution: -1 m_Strength: 1 m_Bias: .0500000007 - m_Softness: 4 - m_SoftnessFade: 1 + m_NormalBias: .400000006 m_Cookie: {fileID: 0} m_DrawHalo: 0 - m_ActuallyLightmapped: 0 m_Flare: {fileID: 0} m_RenderMode: 0 m_CullingMask: serializedVersion: 2 m_Bits: 4294967295 m_Lightmapping: 1 - m_ShadowSamples: 1 + m_BounceIntensity: 1 m_ShadowRadius: 0 m_ShadowAngle: 0 - m_IndirectIntensity: 1 m_AreaSize: {x: 1, y: 1} --- !u!4 &197087829 Transform: @@ -136,7 +231,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 2 + m_RootOrder: 1 --- !u!1 &653652740 GameObject: m_ObjectHideFlags: 0 @@ -164,7 +259,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 97117a0f54bb6d24b83a8c1064c0bcf1, type: 3} m_Name: m_EditorClassIdentifier: - sphere: {fileID: 100000, guid: bfa161fc153e32046a29630e75799ad7, type: 2} + sphere: {fileID: 192592, guid: bfa161fc153e32046a29630e75799ad7, type: 2} --- !u!4 &653652742 Transform: m_ObjectHideFlags: 0 @@ -176,88 +271,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 3 ---- !u!1 &1194942334 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 1194942339} - - 33: {fileID: 1194942338} - - 65: {fileID: 1194942337} - - 23: {fileID: 1194942336} - - 114: {fileID: 1194942335} - m_Layer: 0 - m_Name: Cube - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1194942335 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1194942334} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 00df89d07bdd9ab4db246ee1555e510b, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!23 &1194942336 -Renderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1194942334} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_LightmapIndex: 255 - m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0} - m_Materials: - - {fileID: 10302, guid: 0000000000000000f000000000000000, type: 0} - m_SubsetIndices: - m_StaticBatchRoot: {fileID: 0} - m_UseLightProbes: 0 - m_LightProbeAnchor: {fileID: 0} - m_ScaleInLightmap: 1 - m_SortingLayerID: 0 - m_SortingOrder: 0 ---- !u!65 &1194942337 -BoxCollider: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1194942334} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} ---- !u!33 &1194942338 -MeshFilter: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1194942334} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!4 &1194942339 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1194942334} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 1 + m_RootOrder: 2 --- !u!1 &2094396654 GameObject: m_ObjectHideFlags: 0 @@ -327,10 +341,12 @@ Camera: m_RenderingPath: -1 m_TargetTexture: {fileID: 0} m_TargetDisplay: 0 + m_TargetEye: 3 m_HDR: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 m_StereoSeparation: .0219999999 + m_StereoMirrorMode: 0 --- !u!4 &2094396659 Transform: m_ObjectHideFlags: 0 diff --git a/Assets/KeraLua.meta b/Assets/KeraLua.meta deleted file mode 100644 index 2167389..0000000 --- a/Assets/KeraLua.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 3593de129f0e6944ca4b09d7b60e7a90 -folderAsset: yes -DefaultImporter: - userData: diff --git a/Assets/NLua.meta b/Assets/NLua.meta deleted file mode 100644 index a3307f5..0000000 --- a/Assets/NLua.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 178628399d1475a4da5187c628b57113 -folderAsset: yes -DefaultImporter: - userData: diff --git a/Assets/Plugins.meta b/Assets/Plugins.meta index 068f0fb..3b31e43 100644 --- a/Assets/Plugins.meta +++ b/Assets/Plugins.meta @@ -1,5 +1,9 @@ fileFormatVersion: 2 -guid: 3c30f4bae57472042bf78bad8a463486 +guid: 1de8baddd5e6093408f02688a5c36618 folderAsset: yes +timeCreated: 1449934526 +licenseType: Free DefaultImporter: userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Android.meta b/Assets/Plugins/Android.meta new file mode 100644 index 0000000..b0eea7d --- /dev/null +++ b/Assets/Plugins/Android.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 0b6b101bf3636d3438374b5cd7a53ce6 +folderAsset: yes +timeCreated: 1449934526 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Android/libs.meta b/Assets/Plugins/Android/libs.meta new file mode 100644 index 0000000..daa1d38 --- /dev/null +++ b/Assets/Plugins/Android/libs.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 742fe4b1307dad142b80f7a128046c31 +folderAsset: yes +timeCreated: 1449632021 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Android/libs/armeabi-v7a.meta b/Assets/Plugins/Android/libs/armeabi-v7a.meta new file mode 100644 index 0000000..4c584a3 --- /dev/null +++ b/Assets/Plugins/Android/libs/armeabi-v7a.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 329b6865844ad4149a1556df54f00399 +folderAsset: yes +timeCreated: 1449044856 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Android/libs/armeabi-v7a/liblua52.so b/Assets/Plugins/Android/libs/armeabi-v7a/liblua52.so new file mode 100644 index 0000000..e596482 Binary files /dev/null and b/Assets/Plugins/Android/libs/armeabi-v7a/liblua52.so differ diff --git a/Assets/Plugins/Android/libs/armeabi-v7a/liblua52.so.meta b/Assets/Plugins/Android/libs/armeabi-v7a/liblua52.so.meta new file mode 100644 index 0000000..c8b41f4 --- /dev/null +++ b/Assets/Plugins/Android/libs/armeabi-v7a/liblua52.so.meta @@ -0,0 +1,72 @@ +fileFormatVersion: 2 +guid: 773d5f918975d6e46b6faa1ecdf07086 +timeCreated: 1449044856 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: ARMv7 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_13 + WP8: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + SDK: AnySDK + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Android/libs/x86.meta b/Assets/Plugins/Android/libs/x86.meta new file mode 100644 index 0000000..7a12381 --- /dev/null +++ b/Assets/Plugins/Android/libs/x86.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 30089a63f8a18eb438f8bee3caf1429e +folderAsset: yes +timeCreated: 1449044856 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Android/libs/x86/liblua52.so b/Assets/Plugins/Android/libs/x86/liblua52.so new file mode 100644 index 0000000..361dbef Binary files /dev/null and b/Assets/Plugins/Android/libs/x86/liblua52.so differ diff --git a/Assets/Plugins/Android/libs/x86/liblua52.so.meta b/Assets/Plugins/Android/libs/x86/liblua52.so.meta new file mode 100644 index 0000000..86a637a --- /dev/null +++ b/Assets/Plugins/Android/libs/x86/liblua52.so.meta @@ -0,0 +1,72 @@ +fileFormatVersion: 2 +guid: 1f6deeb7858a97845b54185e64660af3 +timeCreated: 1449044856 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: x86 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_13 + WP8: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + SDK: AnySDK + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Linux.meta b/Assets/Plugins/Linux.meta new file mode 100644 index 0000000..359debc --- /dev/null +++ b/Assets/Plugins/Linux.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: a07ab92c41a142b4bb35f7132e97f61f +folderAsset: yes +timeCreated: 1449934526 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Linux/x86.meta b/Assets/Plugins/Linux/x86.meta new file mode 100644 index 0000000..3847c14 --- /dev/null +++ b/Assets/Plugins/Linux/x86.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 82cf30fbe03162c4d9c70c68805b35cc +folderAsset: yes +timeCreated: 1449472206 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Linux/x86/liblua52.so b/Assets/Plugins/Linux/x86/liblua52.so new file mode 100644 index 0000000..84cd47e Binary files /dev/null and b/Assets/Plugins/Linux/x86/liblua52.so differ diff --git a/Assets/Plugins/Linux/x86/liblua52.so.meta b/Assets/Plugins/Linux/x86/liblua52.so.meta new file mode 100644 index 0000000..eb5f9b6 --- /dev/null +++ b/Assets/Plugins/Linux/x86/liblua52.so.meta @@ -0,0 +1,80 @@ +fileFormatVersion: 2 +guid: 7d605a6192cb29d489de0de20a28cc72 +timeCreated: 1449472252 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 1 + settings: + CPU: x86 + DefaultValueInitialized: true + OS: Linux + Linux: + enabled: 1 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: None + LinuxUniversal: + enabled: 1 + settings: + CPU: x86 + OSXIntel: + enabled: 0 + settings: + CPU: None + OSXIntel64: + enabled: 0 + settings: + CPU: None + OSXUniversal: + enabled: 0 + settings: + CPU: None + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_13 + WP8: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + Win: + enabled: 1 + settings: + CPU: AnyCPU + Win64: + enabled: 1 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + SDK: AnySDK + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Linux/x86_64.meta b/Assets/Plugins/Linux/x86_64.meta new file mode 100644 index 0000000..f89dd14 --- /dev/null +++ b/Assets/Plugins/Linux/x86_64.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 6134d721300756b4d9e87d2a949efb01 +folderAsset: yes +timeCreated: 1449472215 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Linux/x86_64/liblua52.so b/Assets/Plugins/Linux/x86_64/liblua52.so new file mode 100644 index 0000000..f941d0e Binary files /dev/null and b/Assets/Plugins/Linux/x86_64/liblua52.so differ diff --git a/Assets/Plugins/Linux/x86_64/liblua52.so.meta b/Assets/Plugins/Linux/x86_64/liblua52.so.meta new file mode 100644 index 0000000..34cf5d9 --- /dev/null +++ b/Assets/Plugins/Linux/x86_64/liblua52.so.meta @@ -0,0 +1,80 @@ +fileFormatVersion: 2 +guid: 9b39a3b7539c31f4c936d62c5950572b +timeCreated: 1449472252 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 1 + settings: + CPU: x86_64 + DefaultValueInitialized: true + OS: Linux + Linux: + enabled: 0 + settings: + CPU: None + Linux64: + enabled: 1 + settings: + CPU: x86_64 + LinuxUniversal: + enabled: 1 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: None + OSXIntel64: + enabled: 0 + settings: + CPU: None + OSXUniversal: + enabled: 0 + settings: + CPU: None + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_13 + WP8: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + Win: + enabled: 1 + settings: + CPU: AnyCPU + Win64: + enabled: 1 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + SDK: AnySDK + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Mac.meta b/Assets/Plugins/Mac.meta new file mode 100644 index 0000000..edb68a0 --- /dev/null +++ b/Assets/Plugins/Mac.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 194343782e415974a9ab2b5e13b23886 +folderAsset: yes +timeCreated: 1449934526 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Mac/lua52.bundle.meta b/Assets/Plugins/Mac/lua52.bundle.meta new file mode 100644 index 0000000..0063bed --- /dev/null +++ b/Assets/Plugins/Mac/lua52.bundle.meta @@ -0,0 +1,79 @@ +fileFormatVersion: 2 +guid: b09222f4d77dd844eb3defd6bcf429a7 +folderAsset: yes +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 1 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: OSX + Linux: + enabled: 1 + settings: + CPU: x86 + Linux64: + enabled: 1 + settings: + CPU: x86_64 + LinuxUniversal: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel: + enabled: 1 + settings: + CPU: None + OSXIntel64: + enabled: 1 + settings: + CPU: AnyCPU + OSXUniversal: + enabled: 1 + settings: + CPU: AnyCPU + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_13 + WP8: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + Win: + enabled: 1 + settings: + CPU: AnyCPU + Win64: + enabled: 1 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + SDK: AnySDK + iOS: + enabled: 1 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/lua52.bundle/Contents.meta b/Assets/Plugins/Mac/lua52.bundle/Contents.meta similarity index 100% rename from Assets/Plugins/lua52.bundle/Contents.meta rename to Assets/Plugins/Mac/lua52.bundle/Contents.meta diff --git a/Assets/Plugins/lua52.bundle/Contents/Info.plist b/Assets/Plugins/Mac/lua52.bundle/Contents/Info.plist similarity index 100% rename from Assets/Plugins/lua52.bundle/Contents/Info.plist rename to Assets/Plugins/Mac/lua52.bundle/Contents/Info.plist diff --git a/Assets/Plugins/lua52.bundle/Contents/Info.plist.meta b/Assets/Plugins/Mac/lua52.bundle/Contents/Info.plist.meta similarity index 100% rename from Assets/Plugins/lua52.bundle/Contents/Info.plist.meta rename to Assets/Plugins/Mac/lua52.bundle/Contents/Info.plist.meta diff --git a/Assets/Plugins/lua52.bundle/Contents/MacOS.meta b/Assets/Plugins/Mac/lua52.bundle/Contents/MacOS.meta similarity index 100% rename from Assets/Plugins/lua52.bundle/Contents/MacOS.meta rename to Assets/Plugins/Mac/lua52.bundle/Contents/MacOS.meta diff --git a/Assets/Plugins/lua52.bundle/Contents/MacOS/lua52 b/Assets/Plugins/Mac/lua52.bundle/Contents/MacOS/lua52 similarity index 100% rename from Assets/Plugins/lua52.bundle/Contents/MacOS/lua52 rename to Assets/Plugins/Mac/lua52.bundle/Contents/MacOS/lua52 diff --git a/Assets/Plugins/lua52.bundle/Contents/MacOS/lua52.dylib b/Assets/Plugins/Mac/lua52.bundle/Contents/MacOS/lua52.dylib similarity index 100% rename from Assets/Plugins/lua52.bundle/Contents/MacOS/lua52.dylib rename to Assets/Plugins/Mac/lua52.bundle/Contents/MacOS/lua52.dylib diff --git a/Assets/Plugins/lua52.bundle/Contents/MacOS/lua52.dylib.meta b/Assets/Plugins/Mac/lua52.bundle/Contents/MacOS/lua52.dylib.meta similarity index 100% rename from Assets/Plugins/lua52.bundle/Contents/MacOS/lua52.dylib.meta rename to Assets/Plugins/Mac/lua52.bundle/Contents/MacOS/lua52.dylib.meta diff --git a/Assets/Plugins/lua52.bundle/Contents/MacOS/lua52.meta b/Assets/Plugins/Mac/lua52.bundle/Contents/MacOS/lua52.meta similarity index 100% rename from Assets/Plugins/lua52.bundle/Contents/MacOS/lua52.meta rename to Assets/Plugins/Mac/lua52.bundle/Contents/MacOS/lua52.meta diff --git a/Assets/Plugins/NLua.dll b/Assets/Plugins/NLua.dll new file mode 100644 index 0000000..46f610b Binary files /dev/null and b/Assets/Plugins/NLua.dll differ diff --git a/Assets/Plugins/NLua.dll.meta b/Assets/Plugins/NLua.dll.meta new file mode 100644 index 0000000..380fc8d --- /dev/null +++ b/Assets/Plugins/NLua.dll.meta @@ -0,0 +1,92 @@ +fileFormatVersion: 2 +guid: 4c65817b164fa12499c88dba7a6a562e +timeCreated: 1449934528 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 1 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 1 + settings: + CPU: x86 + Linux64: + enabled: 1 + settings: + CPU: x86_64 + LinuxUniversal: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 1 + settings: + CPU: AnyCPU + OSXUniversal: + enabled: 1 + settings: + CPU: AnyCPU + SamsungTV: + enabled: 1 + settings: + STV_MODEL: STANDARD_13 + Tizen: + enabled: 1 + settings: {} + WP8: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + Web: + enabled: 1 + settings: {} + WebGL: + enabled: 1 + settings: {} + WebStreamed: + enabled: 1 + settings: {} + Win: + enabled: 1 + settings: + CPU: AnyCPU + Win64: + enabled: 1 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + SDK: AnySDK + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Windows.meta b/Assets/Plugins/Windows.meta new file mode 100644 index 0000000..60a77f1 --- /dev/null +++ b/Assets/Plugins/Windows.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: cbf6fd5658501d34299d23112f94d12f +folderAsset: yes +timeCreated: 1449934526 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Windows/ARM.meta b/Assets/Plugins/Windows/ARM.meta new file mode 100644 index 0000000..4d50154 --- /dev/null +++ b/Assets/Plugins/Windows/ARM.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 19a15783d674392488a0a581ee69c8f8 +folderAsset: yes +timeCreated: 1449561455 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Windows/ARM/lua52.dll b/Assets/Plugins/Windows/ARM/lua52.dll new file mode 100644 index 0000000..9b29394 Binary files /dev/null and b/Assets/Plugins/Windows/ARM/lua52.dll differ diff --git a/Assets/Plugins/Windows/ARM/lua52.dll.meta b/Assets/Plugins/Windows/ARM/lua52.dll.meta new file mode 100644 index 0000000..db67132 --- /dev/null +++ b/Assets/Plugins/Windows/ARM/lua52.dll.meta @@ -0,0 +1,72 @@ +fileFormatVersion: 2 +guid: a9905c137eceac147a6e33c4e9810bc9 +timeCreated: 1449561455 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_13 + WP8: + enabled: 1 + settings: + CPU: ARM + DontProcess: False + PlaceholderPath: + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: ARM + DontProcess: False + PlaceholderPath: + SDK: AnySDK + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Windows/NLua.dll b/Assets/Plugins/Windows/NLua.dll new file mode 100644 index 0000000..e8a81a0 Binary files /dev/null and b/Assets/Plugins/Windows/NLua.dll differ diff --git a/Assets/Plugins/Windows/NLua.dll.meta b/Assets/Plugins/Windows/NLua.dll.meta new file mode 100644 index 0000000..75d4c38 --- /dev/null +++ b/Assets/Plugins/Windows/NLua.dll.meta @@ -0,0 +1,72 @@ +fileFormatVersion: 2 +guid: 29ca486bb3d432e4db6665268879d26c +timeCreated: 1449934528 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_13 + WP8: + enabled: 1 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: Assets/Plugins/NLua.dll + SDK: AnySDK + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/x86.meta b/Assets/Plugins/Windows/x86.meta similarity index 100% rename from Assets/Plugins/x86.meta rename to Assets/Plugins/Windows/x86.meta diff --git a/Assets/Plugins/x86/lua52.dll b/Assets/Plugins/Windows/x86/lua52.dll similarity index 100% rename from Assets/Plugins/x86/lua52.dll rename to Assets/Plugins/Windows/x86/lua52.dll diff --git a/Assets/Plugins/Windows/x86/lua52.dll.meta b/Assets/Plugins/Windows/x86/lua52.dll.meta new file mode 100644 index 0000000..42d8d41 --- /dev/null +++ b/Assets/Plugins/Windows/x86/lua52.dll.meta @@ -0,0 +1,90 @@ +fileFormatVersion: 2 +guid: ebc4f28cb3b6b154196aa2c0a58602c6 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 1 + settings: + CPU: x86 + DefaultValueInitialized: true + OS: Windows + Linux: + enabled: 1 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: None + LinuxUniversal: + enabled: 1 + settings: + CPU: x86 + OSXIntel: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: None + OSXUniversal: + enabled: 1 + settings: + CPU: x86 + SamsungTV: + enabled: 1 + settings: + STV_MODEL: STANDARD_13 + Tizen: + enabled: 1 + settings: {} + WP8: + enabled: 1 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + Web: + enabled: 1 + settings: {} + WebGL: + enabled: 1 + settings: {} + WebStreamed: + enabled: 1 + settings: {} + Win: + enabled: 1 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: None + WindowsStoreApps: + enabled: 1 + settings: + CPU: X86 + DontProcess: False + PlaceholderPath: + SDK: AnySDK + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/x86_64.meta b/Assets/Plugins/Windows/x86_64.meta similarity index 100% rename from Assets/Plugins/x86_64.meta rename to Assets/Plugins/Windows/x86_64.meta diff --git a/Assets/Plugins/x86_64/lua52.dll b/Assets/Plugins/Windows/x86_64/lua52.dll similarity index 100% rename from Assets/Plugins/x86_64/lua52.dll rename to Assets/Plugins/Windows/x86_64/lua52.dll diff --git a/Assets/Plugins/Windows/x86_64/lua52.dll.meta b/Assets/Plugins/Windows/x86_64/lua52.dll.meta new file mode 100644 index 0000000..dc6d5fb --- /dev/null +++ b/Assets/Plugins/Windows/x86_64/lua52.dll.meta @@ -0,0 +1,90 @@ +fileFormatVersion: 2 +guid: 93bf0548ae88719439f2ab25ebd0ae57 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 1 + settings: + CPU: x86_64 + DefaultValueInitialized: true + OS: Windows + Linux: + enabled: 0 + settings: + CPU: None + Linux64: + enabled: 1 + settings: + CPU: x86_64 + LinuxUniversal: + enabled: 1 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: None + OSXIntel64: + enabled: 1 + settings: + CPU: AnyCPU + OSXUniversal: + enabled: 1 + settings: + CPU: x86_64 + SamsungTV: + enabled: 1 + settings: + STV_MODEL: STANDARD_13 + Tizen: + enabled: 1 + settings: {} + WP8: + enabled: 1 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + Web: + enabled: 1 + settings: {} + WebGL: + enabled: 1 + settings: {} + WebStreamed: + enabled: 1 + settings: {} + Win: + enabled: 0 + settings: + CPU: None + Win64: + enabled: 1 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: X64 + DontProcess: False + PlaceholderPath: + SDK: AnySDK + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/iOS.meta b/Assets/Plugins/iOS.meta new file mode 100644 index 0000000..35bce88 --- /dev/null +++ b/Assets/Plugins/iOS.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d4540e5088bbd6a44b040932b15bc85d +folderAsset: yes +timeCreated: 1449934526 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/iOS/NLua.dll b/Assets/Plugins/iOS/NLua.dll new file mode 100644 index 0000000..01bda1d Binary files /dev/null and b/Assets/Plugins/iOS/NLua.dll differ diff --git a/Assets/Plugins/iOS/NLua.dll.meta b/Assets/Plugins/iOS/NLua.dll.meta new file mode 100644 index 0000000..de892ee --- /dev/null +++ b/Assets/Plugins/iOS/NLua.dll.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 04c25b0ca84e33547975610186182b8a +timeCreated: 1449934527 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + iOS: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/iOS/liblua52.a b/Assets/Plugins/iOS/liblua52.a new file mode 100644 index 0000000..232195b Binary files /dev/null and b/Assets/Plugins/iOS/liblua52.a differ diff --git a/Assets/Plugins/iOS/liblua52.a.meta b/Assets/Plugins/iOS/liblua52.a.meta new file mode 100644 index 0000000..d8de5d9 --- /dev/null +++ b/Assets/Plugins/iOS/liblua52.a.meta @@ -0,0 +1,72 @@ +fileFormatVersion: 2 +guid: 3b506d7caead942c8a6fbffa1470f948 +timeCreated: 1449289299 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_13 + WP8: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + SDK: AnySDK + iOS: + enabled: 1 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/lua52.bundle.meta b/Assets/Plugins/lua52.bundle.meta deleted file mode 100644 index 71322d0..0000000 --- a/Assets/Plugins/lua52.bundle.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: b09222f4d77dd844eb3defd6bcf429a7 -folderAsset: yes -DefaultImporter: - userData: diff --git a/Assets/Plugins/x86/lua52.dll.meta b/Assets/Plugins/x86/lua52.dll.meta deleted file mode 100644 index 59939c6..0000000 --- a/Assets/Plugins/x86/lua52.dll.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: ebc4f28cb3b6b154196aa2c0a58602c6 -DefaultImporter: - userData: diff --git a/Assets/Plugins/x86_64/lua52.dll.meta b/Assets/Plugins/x86_64/lua52.dll.meta deleted file mode 100644 index d3fe4ff..0000000 --- a/Assets/Plugins/x86_64/lua52.dll.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 93bf0548ae88719439f2ab25ebd0ae57 -DefaultImporter: - userData: diff --git a/Assets/Resources.meta b/Assets/Resources.meta new file mode 100644 index 0000000..45e1f4f --- /dev/null +++ b/Assets/Resources.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: af802ad4a73c3974db89f3484795a8b8 +folderAsset: yes +timeCreated: 1449934526 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Sphere.prefab b/Assets/Resources/Sphere.prefab new file mode 100644 index 0000000..bcf51c4 --- /dev/null +++ b/Assets/Resources/Sphere.prefab @@ -0,0 +1,88 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &192592 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 497954} + - 33: {fileID: 3308052} + - 135: {fileID: 13543354} + - 23: {fileID: 2304822} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &497954 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 192592} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!23 &2304822 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 192592} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_UseLightProbes: 1 + m_ReflectionProbeUsage: 1 + m_ProbeAnchor: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: .5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 +--- !u!33 &3308052 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 192592} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!135 &13543354 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 192592} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: .5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 192592} + m_IsPrefabParent: 1 diff --git a/Assets/Resources/Sphere.prefab.meta b/Assets/Resources/Sphere.prefab.meta new file mode 100644 index 0000000..a2d5e86 --- /dev/null +++ b/Assets/Resources/Sphere.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bfa161fc153e32046a29630e75799ad7 +timeCreated: 1449912954 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/StreamingAssets.meta b/Assets/StreamingAssets.meta new file mode 100644 index 0000000..c2b2b94 --- /dev/null +++ b/Assets/StreamingAssets.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 668582101e6bf52428afa956406f9d82 +folderAsset: yes +timeCreated: 1449934526 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/StreamingAssets/ExampleBehaviour.lua b/Assets/StreamingAssets/ExampleBehaviour.lua new file mode 100644 index 0000000..d0310e9 --- /dev/null +++ b/Assets/StreamingAssets/ExampleBehaviour.lua @@ -0,0 +1,83 @@ +import 'System' +import 'UnityEngine' +import 'Assembly-CSharp' -- The user-code assembly generated by Unity. + +local Angle = Vector3.up; +local Speed = 5; + +local showEnv = false +local envScroll = Vector2.zero + +function Update() + transform:RotateAround(transform.position,Angle,Speed * Time.deltaTime) + + if Input.GetKey(KeyCode.W) then + Speed = Speed + 1 + end + + if Input.GetKey(KeyCode.S) then + Speed = Speed - 1 + end + + if Input.GetKey(KeyCode.A) then + Angle.z = Angle.z + 1 + end + + if Input.GetKey(KeyCode.D) then + Angle.z = Angle.z - 1 + end + +end + +function OnGUI() + GUILayout.BeginArea(Rect(10,10,(Screen.width / 2) - 20,Screen.height - 20)) + + -- Adding '{ }' to the end of GUI functions satisfies their 'params' argument. + GUILayout.BeginVertical() + GUILayout.BeginHorizontal() + if GUILayout.Button('<--', { }) then + Speed = Speed - 1 + end + GUILayout.Label('[W/S] Speed: ' .. Speed) + if GUILayout.Button('-->', { }) then + Speed = Speed + 1 + end + GUILayout.EndHorizontal() + GUILayout.EndVertical() + + GUILayout.BeginVertical() + GUILayout.BeginHorizontal() + if GUILayout.Button('<--', { }) then + Angle.z = Angle.z - 1 + end + GUILayout.Label('[A/D] Rot Angle: ' .. Angle:ToString()) + if GUILayout.Button('-->', { }) then + Angle.z = Angle.z + 1 + end + GUILayout.EndHorizontal() + GUILayout.EndVertical() + + GUILayout.EndArea() + + GUILayout.BeginArea(Rect((Screen.width / 2) + 10,10,(Screen.width / 2) - 20,Screen.height - 20)) + + if GUILayout.Button('Show Enviroment',{ }) then + showEnv = not showEnv + end + + if showEnv then + envScroll = GUILayout.BeginScrollView(envScroll,{ }) + for k, v in pairs(_G) do + GUILayout.BeginHorizontal({ }) + + GUILayout.Label(k,{ }) + GUILayout.FlexibleSpace() + GUILayout.Label(tostring(v),{ }) + + GUILayout.EndHorizontal() + end + GUILayout.EndScrollView() + end + + GUILayout.EndArea() +end \ No newline at end of file diff --git a/Assets/StreamingAssets/ExampleBehaviour.lua.meta b/Assets/StreamingAssets/ExampleBehaviour.lua.meta new file mode 100644 index 0000000..f1d13be --- /dev/null +++ b/Assets/StreamingAssets/ExampleBehaviour.lua.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 69dc24d08ab434738b19f795770f745d +timeCreated: 1449806137 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/StreamingAssets/SpawnSphere.lua b/Assets/StreamingAssets/SpawnSphere.lua new file mode 100644 index 0000000..5837120 --- /dev/null +++ b/Assets/StreamingAssets/SpawnSphere.lua @@ -0,0 +1,9 @@ +import 'System' +import 'UnityEngine' +import 'Assembly-CSharp' -- The user-code assembly generated by Unity + +function Update() + if Input.GetKey(KeyCode.Space) then + GameObject.Instantiate(sphere, transform.position, Quaternion.identity) + end +end \ No newline at end of file diff --git a/Assets/StreamingAssets/SpawnSphere.lua.meta b/Assets/StreamingAssets/SpawnSphere.lua.meta new file mode 100644 index 0000000..de144aa --- /dev/null +++ b/Assets/StreamingAssets/SpawnSphere.lua.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3a6a61e06706f4170896dc5c31bf1506 +timeCreated: 1449806137 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/StreamingAssets/TestBehaviour.lua b/Assets/StreamingAssets/TestBehaviour.lua new file mode 100644 index 0000000..3b893db --- /dev/null +++ b/Assets/StreamingAssets/TestBehaviour.lua @@ -0,0 +1,11 @@ +import 'System' +import 'UnityEngine' +import 'Assembly-CSharp' -- The user-code assembly generated by Unity + +function Start() + -- `ExampleBehaviour` class is not in a namespace, which is + -- typical of C# scripts in Unity. This should successfully + -- resolve to a ProxyType as of NLua commit [dc976e8] + Debug.Log(ExampleBehaviour) + Debug.Log(this:GetComponent('Transform')) +end \ No newline at end of file diff --git a/Assets/StreamingAssets/TestBehaviour.lua.meta b/Assets/StreamingAssets/TestBehaviour.lua.meta new file mode 100644 index 0000000..59eba4e --- /dev/null +++ b/Assets/StreamingAssets/TestBehaviour.lua.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 66ecd098c33f847a6b8f5a9e9eb90ecb +timeCreated: 1449806137 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/link.xml b/Assets/link.xml new file mode 100644 index 0000000..85e7461 --- /dev/null +++ b/Assets/link.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Assets/link.xml.meta b/Assets/link.xml.meta new file mode 100644 index 0000000..96421b5 --- /dev/null +++ b/Assets/link.xml.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5e8deafef8e384f7290814acb48cbe5d +timeCreated: 1449807538 +licenseType: Free +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index da53064..d412550 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -3,19 +3,18 @@ --- !u!129 &1 PlayerSettings: m_ObjectHideFlags: 0 - serializedVersion: 6 + serializedVersion: 7 AndroidProfiler: 0 defaultScreenOrientation: 0 targetDevice: 2 - targetGlesGraphics: 1 - targetIOSGraphics: -1 targetResolution: 0 + useOnDemandResources: 0 accelerometerFrequency: 60 companyName: DefaultCompany productName: NLua - cloudProjectId: defaultCursor: {fileID: 0} cursorHotspot: {x: 0, y: 0} + m_ShowUnitySplashScreen: 1 defaultScreenWidth: 1024 defaultScreenHeight: 768 defaultScreenWidthWeb: 960 @@ -25,12 +24,12 @@ PlayerSettings: m_ActiveColorSpace: 0 m_MTRendering: 1 m_MobileMTRendering: 0 - m_UseDX11: 0 m_Stereoscopic3D: 0 iosShowActivityIndicatorOnLoading: -1 androidShowActivityIndicatorOnLoading: -1 iosAppInBackgroundBehavior: 0 displayResolutionDialog: 1 + iosAllowHTTPDownload: 1 allowedAutorotateToPortrait: 1 allowedAutorotateToPortraitUpsideDown: 1 allowedAutorotateToLandscapeRight: 1 @@ -63,41 +62,60 @@ PlayerSettings: xboxSpeechDB: 0 xboxEnableHeadOrientation: 0 xboxEnableGuest: 0 + n3dsDisableStereoscopicView: 0 + n3dsEnableSharedListOpt: 1 + n3dsEnableVSync: 0 xboxOneResolution: 0 ps3SplashScreen: {fileID: 0} videoMemoryForVertexBuffers: 0 psp2PowerMode: 0 psp2AcquireBGM: 1 + wiiUTVResolution: 0 + wiiUGamePadMSAA: 1 + wiiUSupportsNunchuk: 0 + wiiUSupportsClassicController: 0 + wiiUSupportsBalanceBoard: 0 + wiiUSupportsMotionPlus: 0 + wiiUSupportsProController: 0 + wiiUAllowScreenCapture: 1 + wiiUControllerCount: 0 m_SupportedAspectRatios: 4:3: 1 5:4: 1 16:10: 1 16:9: 1 Others: 1 - bundleIdentifier: com.Company.ProductName + bundleIdentifier: com.nlua.unity3d bundleVersion: 1.0 preloadedAssets: [] metroEnableIndependentInputSource: 0 metroEnableLowLatencyPresentationAPI: 0 xboxOneDisableKinectGpuReservation: 0 + virtualRealitySupported: 0 productGUID: a8b12717a7ebb2f4cb98a1f86dbbdca9 AndroidBundleVersionCode: 1 AndroidMinSdkVersion: 9 AndroidPreferredInstallLocation: 1 aotOptions: - apiCompatibilityLevel: 1 + apiCompatibilityLevel: 2 + stripEngineCode: 0 iPhoneStrippingLevel: 0 iPhoneScriptCallOptimization: 0 + iPhoneBuildNumber: 0 ForceInternetPermission: 0 ForceSDCardPermission: 0 CreateWallpaper: 0 APKExpansionFiles: 0 preloadShaders: 0 StripUnusedMeshComponents: 0 + VertexChannelCompressionMask: + serializedVersion: 2 + m_Bits: 238 iPhoneSdkVersion: 988 iPhoneTargetOSVersion: 22 uIPrerenderedIcon: 0 uIRequiresPersistentWiFi: 0 + uIRequiresFullScreen: 1 uIStatusBarHidden: 1 uIExitOnSuspend: 0 uIStatusBarStyle: 0 @@ -118,9 +136,20 @@ PlayerSettings: serializedVersion: 2 rgba: 0 iOSLaunchScreenFillPct: 1 + iOSLaunchScreenSize: 100 iOSLaunchScreenCustomXibPath: + iOSLaunchScreeniPadType: 0 + iOSLaunchScreeniPadImage: {fileID: 0} + iOSLaunchScreeniPadBackgroundColor: + serializedVersion: 2 + rgba: 0 + iOSLaunchScreeniPadFillPct: 100 + iOSLaunchScreeniPadSize: 100 + iOSLaunchScreeniPadCustomXibPath: + iOSDeviceRequirements: [] AndroidTargetDevice: 0 AndroidSplashScreenScale: 0 + androidSplashScreen: {fileID: 0} AndroidKeystoreName: AndroidKeyaliasName: AndroidTVCompatibility: 1 @@ -130,15 +159,42 @@ PlayerSettings: - width: 320 height: 180 banner: {fileID: 0} + androidGamepadSupportLevel: 0 resolutionDialogBanner: {fileID: 0} m_BuildTargetIcons: - m_BuildTarget: m_Icons: - - m_Icon: {fileID: 0} - m_Size: 128 + - serializedVersion: 2 + m_Icon: {fileID: 0} + m_Width: 128 + m_Height: 128 m_BuildTargetBatching: [] + m_BuildTargetGraphicsAPIs: + - m_BuildTarget: WindowsStandaloneSupport + m_APIs: 01000000 + m_Automatic: 0 + - m_BuildTarget: AndroidPlayer + m_APIs: 08000000 + m_Automatic: 0 webPlayerTemplate: APPLICATION:Default m_TemplateCustomTags: {} + wiiUTitleID: 0005000011000000 + wiiUGroupID: 00010000 + wiiUCommonSaveSize: 4096 + wiiUAccountSaveSize: 2048 + wiiUOlvAccessKey: 0 + wiiUTinCode: 0 + wiiUJoinGameId: 0 + wiiUJoinGameModeMask: 0000000000000000 + wiiUCommonBossSize: 0 + wiiUAccountBossSize: 0 + wiiUAddOnUniqueIDs: [] + wiiUMainThreadStackSize: 3072 + wiiULoaderThreadStackSize: 1024 + wiiUSystemHeapSize: 128 + wiiUTVStartupScreen: {fileID: 0} + wiiUGamePadStartupScreen: {fileID: 0} + wiiUProfilerLibPath: actionOnDotNetUnhandledException: 1 enableInternalProfiler: 0 logObjCUncaughtExceptions: 1 @@ -189,26 +245,43 @@ PlayerSettings: ps4BackgroundImagePath: ps4StartupImagePath: ps4SaveDataImagePath: + ps4SdkOverride: ps4BGMPath: ps4ShareFilePath: + ps4ShareOverlayImagePath: + ps4PrivacyGuardImagePath: ps4NPtitleDatPath: ps4RemotePlayKeyAssignment: -1 + ps4RemotePlayKeyMappingDir: ps4EnterButtonAssignment: 1 ps4ApplicationParam1: 0 ps4ApplicationParam2: 0 ps4ApplicationParam3: 0 ps4ApplicationParam4: 0 + ps4DownloadDataSize: 0 + ps4GarlicHeapSize: 2048 ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ ps4pnSessions: 1 ps4pnPresence: 1 ps4pnFriends: 1 ps4pnGameCustomData: 1 playerPrefsSupport: 0 + ps4ReprojectionSupport: 0 + ps4UseAudio3dBackend: 0 + ps4Audio3dVirtualSpeakerCount: 14 + ps4attribCpuUsage: 0 + ps4SocialScreenEnabled: 0 + ps4attribUserManagement: 0 + ps4attribMoveSupport: 0 + ps4attrib3DSupport: 0 + ps4attribShareSupport: 0 + ps4IncludedModules: [] monoEnv: psp2Splashimage: {fileID: 0} psp2NPTrophyPackPath: psp2NPSupportGBMorGJP: 0 psp2NPAgeRating: 12 + psp2NPTitleDatPath: psp2NPCommsID: psp2NPCommunicationsID: psp2NPCommsPassphrase: @@ -221,8 +294,9 @@ PlayerSettings: psp2LiveAreaTrialPath: psp2PatchChangeInfoPath: psp2PatchOriginalPackage: - psp2PackagePassword: + psp2PackagePassword: F69AzBlax3CF3EDNhm3soLBPh71Yexui psp2KeystoneFile: + psp2MemoryExpansionMode: 0 psp2DRMType: 0 psp2StorageType: 0 psp2MediaCapacity: 0 @@ -339,10 +413,20 @@ PlayerSettings: blackberrySquareSplashScreen: {fileID: 0} tizenProductDescription: tizenProductURL: - tizenCertificatePath: - tizenCertificatePassword: + tizenSigningProfileName: tizenGPSPermissions: 0 tizenMicrophonePermissions: 0 + n3dsUseExtSaveData: 0 + n3dsCompressStaticMem: 1 + n3dsExtSaveDataNumber: 0x12345 + n3dsStackSize: 131072 + n3dsTargetPlatform: 2 + n3dsRegion: 7 + n3dsMediaSize: 0 + n3dsLogoStyle: 3 + n3dsTitle: GameName + n3dsProductCode: + n3dsApplicationId: 0xFF3FF stvDeviceAddress: stvProductDescription: stvProductAuthor: @@ -359,6 +443,7 @@ PlayerSettings: XboxOnePackagingOverridePath: XboxOneAppManifestOverridePath: XboxOnePackageEncryption: 0 + XboxOnePackageUpdateGranularity: 2 XboxOneDescription: XboxOneIsContentPackage: 0 XboxOneEnableGPUVariability: 0 @@ -367,28 +452,44 @@ PlayerSettings: XboxOneAllowedProductIds: [] XboxOnePersistentLocalStorageSize: 0 intPropertyNames: + - Android::ScriptingBackend - Metro::ScriptingBackend + - Standalone::ScriptingBackend - WP8::ScriptingBackend - WebGL::ScriptingBackend - WebGL::audioCompressionFormat - WebGL::exceptionSupport - WebGL::memorySize - iOS::Architecture + - iOS::EnableIncrementalBuildSupportForIl2cpp - iOS::ScriptingBackend + Android::ScriptingBackend: 0 Metro::ScriptingBackend: 2 + Standalone::ScriptingBackend: 0 WP8::ScriptingBackend: 2 WebGL::ScriptingBackend: 1 WebGL::audioCompressionFormat: 4 WebGL::exceptionSupport: 0 WebGL::memorySize: 256 - iOS::Architecture: 2 - iOS::ScriptingBackend: 0 + iOS::Architecture: 0 + iOS::EnableIncrementalBuildSupportForIl2cpp: 1 + iOS::ScriptingBackend: 1 boolPropertyNames: + - WebGL::analyzeBuildSize - WebGL::dataCaching + - WebGL::useEmbeddedResources + WebGL::analyzeBuildSize: 0 WebGL::dataCaching: 0 + WebGL::useEmbeddedResources: 0 stringPropertyNames: - WebGL::emscriptenArgs - WebGL::template + - additionalIl2CppArgs::additionalIl2CppArgs WebGL::emscriptenArgs: WebGL::template: APPLICATION:Default - firstStreamedLevelWithResources: 0 + additionalIl2CppArgs::additionalIl2CppArgs: + firstStreamedSceneWithResources: 0 + cloudProjectId: + projectName: + organizationId: + cloudEnabled: 0 diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt new file mode 100644 index 0000000..a6bc721 --- /dev/null +++ b/ProjectSettings/ProjectVersion.txt @@ -0,0 +1,2 @@ +m_EditorVersion: 5.2.3f1 +m_StandardAssetsVersion: 0 diff --git a/ProjectSettings/UnityAdsSettings.asset b/ProjectSettings/UnityAdsSettings.asset new file mode 100644 index 0000000..224050c --- /dev/null +++ b/ProjectSettings/UnityAdsSettings.asset @@ -0,0 +1,11 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!292 &1 +UnityAdsSettings: + m_ObjectHideFlags: 0 + m_Enabled: 0 + m_InitializeOnStartup: 1 + m_TestMode: 0 + m_EnabledPlatforms: 4294967295 + m_IosGameId: + m_AndroidGameId: diff --git a/ProjectSettings/UnityAnalyticsManager.asset b/ProjectSettings/UnityAnalyticsManager.asset new file mode 100644 index 0000000..4a7b668 --- /dev/null +++ b/ProjectSettings/UnityAnalyticsManager.asset @@ -0,0 +1,10 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!303 &1 +UnityAnalyticsManager: + m_ObjectHideFlags: 0 + m_Enabled: 0 + m_InitializeOnStartup: 1 + m_TestMode: 0 + m_TestEventUrl: + m_TestConfigUrl: diff --git a/README.md b/README.md index 9ad8be7..6e01322 100644 --- a/README.md +++ b/README.md @@ -42,4 +42,18 @@ See the SpawnSphere example. **How do I run C# coroutines?** -See [this comment](https://github.com/NLua/NLua/issues/110#issuecomment-59874806) for details, essentially though you either have to call lua functions indriectily, or roll your own coroutine manager (not hugely difficult). Direct support for coroutines may be included in future releases. +See [this comment](https://github.com/NLua/NLua/issues/110#issuecomment-59874806) for details, essentially though you either have to call Lua functions indirectly, or roll your own coroutine manager (not hugely difficult). Direct support for coroutines may be included in future releases. + +**How do I build for iOS?** + +iOS is more difficult to build for because the code is compiled using AOT compilation and Unity strips all assemblies by default. To get around this, there are a few steps you must take: + +- Make sure you use the NLua.dll inside of the iOS folder. +- Prevent stripping of your code. Unity strips your code by looking at all of the references inside of your assemblies. Because Lua scripts are not part of compilation process, anything not referenced inside of your C# code or plugins will be stripped. Preventing stripping will make your app size much larger, so consider adding only the classes and namespaces you need to preserve. +To prevent this, make sure any Unity or .dll code is used inside your C# code or add any namespaces or assemblies to the link.xml file. See [this page](http://docs.unity3d.com/Manual/iphone-iOS-Optimization.html) for more details. +- Make sure you have your compatibility mode set to .net 2.0 subset. There is a bug with running NLua on iOS currently that is fixed by having compatibility set to .net 2.0 subset. See [this page](http://forum.unity3d.com/threads/unity-5-0-3f2-il2cpp-problem-attempting-to-call-method-system-reflection-monoproperty-getteradapt.332335/) for more details. + +**How do I rebuild NLua.dll?** + +There are two .csproj files inside of the /src/ folders: one for windows store applications (NLua_WSA.csproj) and another for all other platforms (NLua.csproj). Simple open them up with Visual Studio, select your configuration, and rebuild. +Alternatively, you can remove the NLua.dll files from the plugins folder and use the scripts from the src folder directly. iOS has problems running NLua this way, however. \ No newline at end of file diff --git a/Assets/KeraLua/CharPtr.cs b/src/KeraLua/CharPtr.cs similarity index 100% rename from Assets/KeraLua/CharPtr.cs rename to src/KeraLua/CharPtr.cs diff --git a/Assets/KeraLua/CharPtr.cs.meta b/src/KeraLua/CharPtr.cs.meta similarity index 100% rename from Assets/KeraLua/CharPtr.cs.meta rename to src/KeraLua/CharPtr.cs.meta diff --git a/Assets/KeraLua/DynamicLibraryPath.cs b/src/KeraLua/DynamicLibraryPath.cs similarity index 98% rename from Assets/KeraLua/DynamicLibraryPath.cs rename to src/KeraLua/DynamicLibraryPath.cs index 03bd7cc..e41eae1 100644 --- a/Assets/KeraLua/DynamicLibraryPath.cs +++ b/src/KeraLua/DynamicLibraryPath.cs @@ -1,4 +1,5 @@ -using System; +#if USE_DYNAMIC_DLL_REGISTER +using System; using System.IO; using System.Reflection; using System.Runtime.InteropServices; @@ -97,3 +98,4 @@ static void RegisterLibrarySearchPath (string path) static extern bool SetDllDirectory (string lpPathName); } } +#endif \ No newline at end of file diff --git a/Assets/KeraLua/DynamicLibraryPath.cs.meta b/src/KeraLua/DynamicLibraryPath.cs.meta similarity index 100% rename from Assets/KeraLua/DynamicLibraryPath.cs.meta rename to src/KeraLua/DynamicLibraryPath.cs.meta diff --git a/Assets/KeraLua/Lua.cs b/src/KeraLua/Lua.cs similarity index 100% rename from Assets/KeraLua/Lua.cs rename to src/KeraLua/Lua.cs diff --git a/Assets/KeraLua/Lua.cs.meta b/src/KeraLua/Lua.cs.meta similarity index 100% rename from Assets/KeraLua/Lua.cs.meta rename to src/KeraLua/Lua.cs.meta diff --git a/Assets/KeraLua/LuaDebug.cs b/src/KeraLua/LuaDebug.cs similarity index 100% rename from Assets/KeraLua/LuaDebug.cs rename to src/KeraLua/LuaDebug.cs diff --git a/Assets/KeraLua/LuaDebug.cs.meta b/src/KeraLua/LuaDebug.cs.meta similarity index 100% rename from Assets/KeraLua/LuaDebug.cs.meta rename to src/KeraLua/LuaDebug.cs.meta diff --git a/Assets/KeraLua/LuaState.cs b/src/KeraLua/LuaState.cs similarity index 100% rename from Assets/KeraLua/LuaState.cs rename to src/KeraLua/LuaState.cs diff --git a/Assets/KeraLua/LuaState.cs.meta b/src/KeraLua/LuaState.cs.meta similarity index 100% rename from Assets/KeraLua/LuaState.cs.meta rename to src/KeraLua/LuaState.cs.meta diff --git a/Assets/KeraLua/LuaTag.cs b/src/KeraLua/LuaTag.cs similarity index 100% rename from Assets/KeraLua/LuaTag.cs rename to src/KeraLua/LuaTag.cs diff --git a/Assets/KeraLua/LuaTag.cs.meta b/src/KeraLua/LuaTag.cs.meta similarity index 100% rename from Assets/KeraLua/LuaTag.cs.meta rename to src/KeraLua/LuaTag.cs.meta diff --git a/Assets/KeraLua/NativeMethods.cs b/src/KeraLua/NativeMethods.cs similarity index 99% rename from Assets/KeraLua/NativeMethods.cs rename to src/KeraLua/NativeMethods.cs index 3a71f51..819c341 100644 --- a/Assets/KeraLua/NativeMethods.cs +++ b/src/KeraLua/NativeMethods.cs @@ -8,15 +8,15 @@ namespace KeraLua { static class NativeMethods - { - -#if MONOTOUCH + { + +#if MONOTOUCH || (!UNITY_EDITOR && (UNITY_IOS || UNITY_WEBGL)) const string LIBNAME = "__Internal"; #else #if DEBUGLUA const string LIBNAME = "lua52d"; #else - const string LIBNAME = "lua52"; + const string LIBNAME = "lua52"; #endif #if USE_DYNAMIC_DLL_REGISTER diff --git a/Assets/KeraLua/NativeMethods.cs.meta b/src/KeraLua/NativeMethods.cs.meta similarity index 100% rename from Assets/KeraLua/NativeMethods.cs.meta rename to src/KeraLua/NativeMethods.cs.meta diff --git a/Assets/KeraLua/Platform.meta b/src/KeraLua/Platform.meta similarity index 100% rename from Assets/KeraLua/Platform.meta rename to src/KeraLua/Platform.meta diff --git a/Assets/KeraLua/Platform/CLSCompliantAttribute.cs b/src/KeraLua/Platform/CLSCompliantAttribute.cs similarity index 100% rename from Assets/KeraLua/Platform/CLSCompliantAttribute.cs rename to src/KeraLua/Platform/CLSCompliantAttribute.cs diff --git a/Assets/KeraLua/Platform/CLSCompliantAttribute.cs.meta b/src/KeraLua/Platform/CLSCompliantAttribute.cs.meta similarity index 100% rename from Assets/KeraLua/Platform/CLSCompliantAttribute.cs.meta rename to src/KeraLua/Platform/CLSCompliantAttribute.cs.meta diff --git a/Assets/NLua/COPYRIGHT b/src/NLua/COPYRIGHT similarity index 100% rename from Assets/NLua/COPYRIGHT rename to src/NLua/COPYRIGHT diff --git a/Assets/NLua/COPYRIGHT.meta b/src/NLua/COPYRIGHT.meta similarity index 100% rename from Assets/NLua/COPYRIGHT.meta rename to src/NLua/COPYRIGHT.meta diff --git a/Assets/NLua/CheckType.cs b/src/NLua/CheckType.cs similarity index 100% rename from Assets/NLua/CheckType.cs rename to src/NLua/CheckType.cs diff --git a/Assets/NLua/CheckType.cs.meta b/src/NLua/CheckType.cs.meta similarity index 100% rename from Assets/NLua/CheckType.cs.meta rename to src/NLua/CheckType.cs.meta diff --git a/Assets/NLua/Config.meta b/src/NLua/Config.meta similarity index 100% rename from Assets/NLua/Config.meta rename to src/NLua/Config.meta diff --git a/Assets/NLua/Config/NLuaConfig.cs b/src/NLua/Config/NLuaConfig.cs similarity index 100% rename from Assets/NLua/Config/NLuaConfig.cs rename to src/NLua/Config/NLuaConfig.cs diff --git a/Assets/NLua/Config/NLuaConfig.cs.meta b/src/NLua/Config/NLuaConfig.cs.meta similarity index 100% rename from Assets/NLua/Config/NLuaConfig.cs.meta rename to src/NLua/Config/NLuaConfig.cs.meta diff --git a/Assets/NLua/Event.meta b/src/NLua/Event.meta similarity index 100% rename from Assets/NLua/Event.meta rename to src/NLua/Event.meta diff --git a/Assets/NLua/Event/DebugHookEventArgs.cs b/src/NLua/Event/DebugHookEventArgs.cs similarity index 100% rename from Assets/NLua/Event/DebugHookEventArgs.cs rename to src/NLua/Event/DebugHookEventArgs.cs diff --git a/Assets/NLua/Event/DebugHookEventArgs.cs.meta b/src/NLua/Event/DebugHookEventArgs.cs.meta similarity index 100% rename from Assets/NLua/Event/DebugHookEventArgs.cs.meta rename to src/NLua/Event/DebugHookEventArgs.cs.meta diff --git a/Assets/NLua/Event/EventCodes.cs b/src/NLua/Event/EventCodes.cs similarity index 100% rename from Assets/NLua/Event/EventCodes.cs rename to src/NLua/Event/EventCodes.cs diff --git a/Assets/NLua/Event/EventCodes.cs.meta b/src/NLua/Event/EventCodes.cs.meta similarity index 100% rename from Assets/NLua/Event/EventCodes.cs.meta rename to src/NLua/Event/EventCodes.cs.meta diff --git a/Assets/NLua/Event/EventMasks.cs b/src/NLua/Event/EventMasks.cs similarity index 100% rename from Assets/NLua/Event/EventMasks.cs rename to src/NLua/Event/EventMasks.cs diff --git a/Assets/NLua/Event/EventMasks.cs.meta b/src/NLua/Event/EventMasks.cs.meta similarity index 100% rename from Assets/NLua/Event/EventMasks.cs.meta rename to src/NLua/Event/EventMasks.cs.meta diff --git a/Assets/NLua/Event/HookExceptionEventArgs.cs b/src/NLua/Event/HookExceptionEventArgs.cs similarity index 100% rename from Assets/NLua/Event/HookExceptionEventArgs.cs rename to src/NLua/Event/HookExceptionEventArgs.cs diff --git a/Assets/NLua/Event/HookExceptionEventArgs.cs.meta b/src/NLua/Event/HookExceptionEventArgs.cs.meta similarity index 100% rename from Assets/NLua/Event/HookExceptionEventArgs.cs.meta rename to src/NLua/Event/HookExceptionEventArgs.cs.meta diff --git a/Assets/NLua/Exceptions.meta b/src/NLua/Exceptions.meta similarity index 100% rename from Assets/NLua/Exceptions.meta rename to src/NLua/Exceptions.meta diff --git a/Assets/NLua/Exceptions/LuaException.cs b/src/NLua/Exceptions/LuaException.cs similarity index 100% rename from Assets/NLua/Exceptions/LuaException.cs rename to src/NLua/Exceptions/LuaException.cs diff --git a/Assets/NLua/Exceptions/LuaException.cs.meta b/src/NLua/Exceptions/LuaException.cs.meta similarity index 100% rename from Assets/NLua/Exceptions/LuaException.cs.meta rename to src/NLua/Exceptions/LuaException.cs.meta diff --git a/Assets/NLua/Exceptions/LuaScriptException.cs b/src/NLua/Exceptions/LuaScriptException.cs similarity index 100% rename from Assets/NLua/Exceptions/LuaScriptException.cs rename to src/NLua/Exceptions/LuaScriptException.cs diff --git a/Assets/NLua/Exceptions/LuaScriptException.cs.meta b/src/NLua/Exceptions/LuaScriptException.cs.meta similarity index 100% rename from Assets/NLua/Exceptions/LuaScriptException.cs.meta rename to src/NLua/Exceptions/LuaScriptException.cs.meta diff --git a/Assets/NLua/Extensions.meta b/src/NLua/Extensions.meta similarity index 100% rename from Assets/NLua/Extensions.meta rename to src/NLua/Extensions.meta diff --git a/Assets/NLua/Extensions/GeneralExtensions.cs b/src/NLua/Extensions/GeneralExtensions.cs similarity index 90% rename from Assets/NLua/Extensions/GeneralExtensions.cs rename to src/NLua/Extensions/GeneralExtensions.cs index a575c97..22b91fb 100644 --- a/Assets/NLua/Extensions/GeneralExtensions.cs +++ b/src/NLua/Extensions/GeneralExtensions.cs @@ -156,13 +156,27 @@ public static MethodInfo [] GetExtensionMethods (this Type type, IEnumerable (); + List extensionMethods = new List(); + for (int i = 0; i < types.Count; i++) + { + if (types[i].IsSealed() && types[i].IsGenericType() == false && types[i].IsNested == false) + { + MethodInfo[] typeMethods = types[i].GetMethods(BindingFlags.Static | BindingFlags.Public); + for (int j = 0; j < typeMethods.Length; j++) + { + if (typeMethods[j].IsDefined(typeof(ExtensionAttribute), false) == true) + { + Type paramType = typeMethods[j].GetParameters()[0].ParameterType; + if (paramType == type || type.IsSubclassOf(paramType) == true) + { + extensionMethods.Add(typeMethods[j]); + } + } + } + } + } + + return extensionMethods.ToArray(); } /// @@ -383,6 +397,11 @@ public static bool ImplementInterface (this Type t, string name) return t.GetTypeInfo ().ImplementedInterfaces.Any (i => i.Name == name); } + public static bool IsSubclassOf(this Type type, Type baseType) + { + return type.GetTypeInfo().IsAssignableFrom(baseType.GetTypeInfo()); + } + #endif } diff --git a/Assets/NLua/Extensions/GeneralExtensions.cs.meta b/src/NLua/Extensions/GeneralExtensions.cs.meta similarity index 100% rename from Assets/NLua/Extensions/GeneralExtensions.cs.meta rename to src/NLua/Extensions/GeneralExtensions.cs.meta diff --git a/Assets/NLua/GenerateEventAssembly.meta b/src/NLua/GenerateEventAssembly.meta similarity index 100% rename from Assets/NLua/GenerateEventAssembly.meta rename to src/NLua/GenerateEventAssembly.meta diff --git a/Assets/NLua/GenerateEventAssembly/ClassGenerator.cs b/src/NLua/GenerateEventAssembly/ClassGenerator.cs similarity index 100% rename from Assets/NLua/GenerateEventAssembly/ClassGenerator.cs rename to src/NLua/GenerateEventAssembly/ClassGenerator.cs diff --git a/Assets/NLua/GenerateEventAssembly/ClassGenerator.cs.meta b/src/NLua/GenerateEventAssembly/ClassGenerator.cs.meta similarity index 100% rename from Assets/NLua/GenerateEventAssembly/ClassGenerator.cs.meta rename to src/NLua/GenerateEventAssembly/ClassGenerator.cs.meta diff --git a/Assets/NLua/GenerateEventAssembly/CodeGeneration.cs b/src/NLua/GenerateEventAssembly/CodeGeneration.cs similarity index 96% rename from Assets/NLua/GenerateEventAssembly/CodeGeneration.cs rename to src/NLua/GenerateEventAssembly/CodeGeneration.cs index e225e63..5571fd6 100644 --- a/Assets/NLua/GenerateEventAssembly/CodeGeneration.cs +++ b/src/NLua/GenerateEventAssembly/CodeGeneration.cs @@ -31,7 +31,7 @@ using NLua.Extensions; -#if !MONOTOUCH +#if !MONOTOUCH && !UNITY_3D using System.Reflection.Emit; #endif using System.Collections; @@ -55,7 +55,7 @@ class CodeGeneration private static readonly CodeGeneration instance = new CodeGeneration (); private AssemblyName assemblyName; -#if !MONOTOUCH && !SILVERLIGHT && !NETFX_CORE +#if !MONOTOUCH && !SILVERLIGHT && !NETFX_CORE && !UNITY_3D private Dictionary eventHandlerCollection = new Dictionary (); private Type eventHandlerParent = typeof(LuaEventHandler); private Type delegateParent = typeof(LuaDelegate); @@ -65,7 +65,7 @@ class CodeGeneration private int luaClassNumber = 1; #endif - static CodeGeneration () + static CodeGeneration () { } @@ -74,12 +74,12 @@ private CodeGeneration () // Create an assembly name assemblyName = new AssemblyName (); assemblyName.Name = "NLua_generatedcode"; - // Create a new assembly with one module. -#if !MONOTOUCH && !SILVERLIGHT && !NETFX_CORE + // Create a new assembly with one module. +#if !MONOTOUCH && !SILVERLIGHT && !NETFX_CORE && !UNITY_3D newAssembly = Thread.GetDomain ().DefineDynamicAssembly (assemblyName, AssemblyBuilderAccess.Run); newModule = newAssembly.DefineDynamicModule ("NLua_generatedcode"); #endif - } + } /* * Singleton instance of the class @@ -99,6 +99,8 @@ private Type GenerateEvent (Type eventHandlerType) throw new NotImplementedException(" Emit not available on Silverlight "); #elif NETFX_CORE throw new NotImplementedException(" Emit not available on Windows Store "); +#elif UNITY_3D + throw new NotImplementedException (" Emit not available on Unity iOS. Disabled for all platforms. "); #else string typeName; lock (this) { @@ -143,6 +145,8 @@ private Type GenerateDelegate (Type delegateType) throw new NotImplementedException("GenerateDelegate is not available on Silverlight, please register your LuaDelegate type with Lua.RegisterLuaDelegateType( yourDelegate, theLuaDelegateHandler) "); #elif NETFX_CORE throw new NotImplementedException("GenerateDelegate is not available on Windows Store, please register your LuaDelegate type with Lua.RegisterLuaDelegateType( yourDelegate, theLuaDelegateHandler) "); +#elif UNITY_3D + throw new NotImplementedException("GenerateDelegate is not available on Unity, please register your LuaDelegate type with Lua.RegisterLuaDelegateType( yourDelegate, theLuaDelegateHandler) "); #else string typeName; lock (this) { @@ -326,6 +330,8 @@ public void GenerateClass (Type klass, out Type newType, out Type[][] returnType throw new NotImplementedException (" Emit not available on Silverlight "); #elif NETFX_CORE throw new NotImplementedException (" Emit not available on Windows Store "); +#elif UNITY_3D + throw new NotImplementedException(" Emit not available on Unity "); #else string typeName; lock (this) { @@ -396,7 +402,7 @@ public void GenerateClass (Type klass, out Type newType, out Type[][] returnType generator.Emit (OpCodes.Ret); newType = myType.CreateType (); // Creates the type #endif - } + } void GetReturnTypesFromMethod (MethodInfo method, out Type[] returnTypes) { @@ -430,7 +436,7 @@ void GetReturnTypesFromMethod (MethodInfo method, out Type[] returnTypes) returnTypes = returnTypesList.ToArray (); } -#if !MONOTOUCH && !SILVERLIGHT && !NETFX_CORE +#if !MONOTOUCH && !SILVERLIGHT && !NETFX_CORE && !UNITY_3D /* * Generates an overriden implementation of method inside myType that delegates @@ -659,6 +665,8 @@ public LuaEventHandler GetEvent (Type eventHandlerType, LuaFunction eventHandler throw new NotImplementedException (" Emit not available on Silverlight "); #elif NETFX_CORE throw new NotImplementedException (" Emit not available on Windows Store "); +#elif UNITY_3D + throw new NotImplementedException(" Emit not available on Unity "); #else Type eventConsumerType; @@ -673,7 +681,7 @@ public LuaEventHandler GetEvent (Type eventHandlerType, LuaFunction eventHandler luaEventHandler.handler = eventHandler; return luaEventHandler; #endif - } + } public void RegisterLuaDelegateType (Type delegateType, Type luaDelegateType) { diff --git a/Assets/NLua/GenerateEventAssembly/CodeGeneration.cs.meta b/src/NLua/GenerateEventAssembly/CodeGeneration.cs.meta similarity index 100% rename from Assets/NLua/GenerateEventAssembly/CodeGeneration.cs.meta rename to src/NLua/GenerateEventAssembly/CodeGeneration.cs.meta diff --git a/Assets/NLua/GenerateEventAssembly/DelegateGenerator.cs b/src/NLua/GenerateEventAssembly/DelegateGenerator.cs similarity index 100% rename from Assets/NLua/GenerateEventAssembly/DelegateGenerator.cs rename to src/NLua/GenerateEventAssembly/DelegateGenerator.cs diff --git a/Assets/NLua/GenerateEventAssembly/DelegateGenerator.cs.meta b/src/NLua/GenerateEventAssembly/DelegateGenerator.cs.meta similarity index 100% rename from Assets/NLua/GenerateEventAssembly/DelegateGenerator.cs.meta rename to src/NLua/GenerateEventAssembly/DelegateGenerator.cs.meta diff --git a/Assets/NLua/GenerateEventAssembly/ILuaGeneratedType.cs b/src/NLua/GenerateEventAssembly/ILuaGeneratedType.cs similarity index 100% rename from Assets/NLua/GenerateEventAssembly/ILuaGeneratedType.cs rename to src/NLua/GenerateEventAssembly/ILuaGeneratedType.cs diff --git a/Assets/NLua/GenerateEventAssembly/ILuaGeneratedType.cs.meta b/src/NLua/GenerateEventAssembly/ILuaGeneratedType.cs.meta similarity index 100% rename from Assets/NLua/GenerateEventAssembly/ILuaGeneratedType.cs.meta rename to src/NLua/GenerateEventAssembly/ILuaGeneratedType.cs.meta diff --git a/Assets/NLua/GenerateEventAssembly/LuaClassType.cs b/src/NLua/GenerateEventAssembly/LuaClassType.cs similarity index 100% rename from Assets/NLua/GenerateEventAssembly/LuaClassType.cs rename to src/NLua/GenerateEventAssembly/LuaClassType.cs diff --git a/Assets/NLua/GenerateEventAssembly/LuaClassType.cs.meta b/src/NLua/GenerateEventAssembly/LuaClassType.cs.meta similarity index 100% rename from Assets/NLua/GenerateEventAssembly/LuaClassType.cs.meta rename to src/NLua/GenerateEventAssembly/LuaClassType.cs.meta diff --git a/Assets/NLua/Lua.cs b/src/NLua/Lua.cs similarity index 99% rename from Assets/NLua/Lua.cs rename to src/NLua/Lua.cs index eacb224..438c55a 100644 --- a/Assets/NLua/Lua.cs +++ b/src/NLua/Lua.cs @@ -334,8 +334,8 @@ public void Close () } } -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] +#if MONOTOUCH || UNITY_3D + [AOT.MonoPInvokeCallback (typeof (LuaNativeFunction))] #endif static int PanicCallback (LuaState luaState) { @@ -964,9 +964,9 @@ public string SetUpValue (int funcindex, int n) /// /// lua state /// Pointer to LuaDebug (lua_debug) structure - /// -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaHook))] + /// +#if MONOTOUCH || UNITY_3D + [AOT.MonoPInvokeCallback (typeof (LuaHook))] #endif #if USE_KOPILUA static void DebugHookCallback (LuaState luaState, LuaDebug debug) diff --git a/Assets/NLua/Lua.cs.meta b/src/NLua/Lua.cs.meta similarity index 100% rename from Assets/NLua/Lua.cs.meta rename to src/NLua/Lua.cs.meta diff --git a/Assets/NLua/LuaBase.cs b/src/NLua/LuaBase.cs similarity index 100% rename from Assets/NLua/LuaBase.cs rename to src/NLua/LuaBase.cs diff --git a/Assets/NLua/LuaBase.cs.meta b/src/NLua/LuaBase.cs.meta similarity index 100% rename from Assets/NLua/LuaBase.cs.meta rename to src/NLua/LuaBase.cs.meta diff --git a/Assets/NLua/LuaFunction.cs b/src/NLua/LuaFunction.cs similarity index 100% rename from Assets/NLua/LuaFunction.cs rename to src/NLua/LuaFunction.cs diff --git a/Assets/NLua/LuaFunction.cs.meta b/src/NLua/LuaFunction.cs.meta similarity index 100% rename from Assets/NLua/LuaFunction.cs.meta rename to src/NLua/LuaFunction.cs.meta diff --git a/Assets/NLua/LuaGlobalAttribute.cs b/src/NLua/LuaGlobalAttribute.cs similarity index 100% rename from Assets/NLua/LuaGlobalAttribute.cs rename to src/NLua/LuaGlobalAttribute.cs diff --git a/Assets/NLua/LuaGlobalAttribute.cs.meta b/src/NLua/LuaGlobalAttribute.cs.meta similarity index 100% rename from Assets/NLua/LuaGlobalAttribute.cs.meta rename to src/NLua/LuaGlobalAttribute.cs.meta diff --git a/Assets/NLua/LuaHideAttribute.cs b/src/NLua/LuaHideAttribute.cs similarity index 100% rename from Assets/NLua/LuaHideAttribute.cs rename to src/NLua/LuaHideAttribute.cs diff --git a/Assets/NLua/LuaHideAttribute.cs.meta b/src/NLua/LuaHideAttribute.cs.meta similarity index 100% rename from Assets/NLua/LuaHideAttribute.cs.meta rename to src/NLua/LuaHideAttribute.cs.meta diff --git a/Assets/NLua/LuaLib.meta b/src/NLua/LuaLib.meta similarity index 100% rename from Assets/NLua/LuaLib.meta rename to src/NLua/LuaLib.meta diff --git a/Assets/NLua/LuaLib/GCOptions.cs b/src/NLua/LuaLib/GCOptions.cs similarity index 100% rename from Assets/NLua/LuaLib/GCOptions.cs rename to src/NLua/LuaLib/GCOptions.cs diff --git a/Assets/NLua/LuaLib/GCOptions.cs.meta b/src/NLua/LuaLib/GCOptions.cs.meta similarity index 100% rename from Assets/NLua/LuaLib/GCOptions.cs.meta rename to src/NLua/LuaLib/GCOptions.cs.meta diff --git a/Assets/NLua/LuaLib/LuaEnums.cs b/src/NLua/LuaLib/LuaEnums.cs similarity index 100% rename from Assets/NLua/LuaLib/LuaEnums.cs rename to src/NLua/LuaLib/LuaEnums.cs diff --git a/Assets/NLua/LuaLib/LuaEnums.cs.meta b/src/NLua/LuaLib/LuaEnums.cs.meta similarity index 100% rename from Assets/NLua/LuaLib/LuaEnums.cs.meta rename to src/NLua/LuaLib/LuaEnums.cs.meta diff --git a/Assets/NLua/LuaLib/LuaIndexes.cs b/src/NLua/LuaLib/LuaIndexes.cs similarity index 100% rename from Assets/NLua/LuaLib/LuaIndexes.cs rename to src/NLua/LuaLib/LuaIndexes.cs diff --git a/Assets/NLua/LuaLib/LuaIndexes.cs.meta b/src/NLua/LuaLib/LuaIndexes.cs.meta similarity index 100% rename from Assets/NLua/LuaLib/LuaIndexes.cs.meta rename to src/NLua/LuaLib/LuaIndexes.cs.meta diff --git a/Assets/NLua/LuaLib/LuaLib.cs b/src/NLua/LuaLib/LuaLib.cs similarity index 100% rename from Assets/NLua/LuaLib/LuaLib.cs rename to src/NLua/LuaLib/LuaLib.cs diff --git a/Assets/NLua/LuaLib/LuaLib.cs.meta b/src/NLua/LuaLib/LuaLib.cs.meta similarity index 100% rename from Assets/NLua/LuaLib/LuaLib.cs.meta rename to src/NLua/LuaLib/LuaLib.cs.meta diff --git a/Assets/NLua/LuaLib/LuaTypes.cs b/src/NLua/LuaLib/LuaTypes.cs similarity index 100% rename from Assets/NLua/LuaLib/LuaTypes.cs rename to src/NLua/LuaLib/LuaTypes.cs diff --git a/Assets/NLua/LuaLib/LuaTypes.cs.meta b/src/NLua/LuaLib/LuaTypes.cs.meta similarity index 100% rename from Assets/NLua/LuaLib/LuaTypes.cs.meta rename to src/NLua/LuaLib/LuaTypes.cs.meta diff --git a/Assets/NLua/LuaLib/References.cs b/src/NLua/LuaLib/References.cs similarity index 100% rename from Assets/NLua/LuaLib/References.cs rename to src/NLua/LuaLib/References.cs diff --git a/Assets/NLua/LuaLib/References.cs.meta b/src/NLua/LuaLib/References.cs.meta similarity index 100% rename from Assets/NLua/LuaLib/References.cs.meta rename to src/NLua/LuaLib/References.cs.meta diff --git a/Assets/NLua/LuaRegistrationHelper.cs b/src/NLua/LuaRegistrationHelper.cs similarity index 100% rename from Assets/NLua/LuaRegistrationHelper.cs rename to src/NLua/LuaRegistrationHelper.cs diff --git a/Assets/NLua/LuaRegistrationHelper.cs.meta b/src/NLua/LuaRegistrationHelper.cs.meta similarity index 100% rename from Assets/NLua/LuaRegistrationHelper.cs.meta rename to src/NLua/LuaRegistrationHelper.cs.meta diff --git a/Assets/NLua/LuaTable.cs b/src/NLua/LuaTable.cs similarity index 100% rename from Assets/NLua/LuaTable.cs rename to src/NLua/LuaTable.cs diff --git a/Assets/NLua/LuaTable.cs.meta b/src/NLua/LuaTable.cs.meta similarity index 100% rename from Assets/NLua/LuaTable.cs.meta rename to src/NLua/LuaTable.cs.meta diff --git a/Assets/NLua/LuaUserData.cs b/src/NLua/LuaUserData.cs similarity index 100% rename from Assets/NLua/LuaUserData.cs rename to src/NLua/LuaUserData.cs diff --git a/Assets/NLua/LuaUserData.cs.meta b/src/NLua/LuaUserData.cs.meta similarity index 100% rename from Assets/NLua/LuaUserData.cs.meta rename to src/NLua/LuaUserData.cs.meta diff --git a/Assets/NLua/Metatables.cs b/src/NLua/Metatables.cs similarity index 91% rename from Assets/NLua/Metatables.cs rename to src/NLua/Metatables.cs index 1074cb5..f7d5745 100644 --- a/Assets/NLua/Metatables.cs +++ b/src/NLua/Metatables.cs @@ -126,11 +126,11 @@ public MetaFunctions (ObjectTranslator translator) LessThanOrEqualFunction = new LuaNativeFunction (MetaFunctions.LessThanOrEqualLua); } - /* - * __call metafunction of CLR delegates, retrieves and calls the delegate. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] + /* + * __call metafunction of CLR delegates, retrieves and calls the delegate. + */ +#if MONOTOUCH || UNITY_3D + [AOT.MonoPInvokeCallback (typeof (LuaNativeFunction))] #endif private static int RunFunctionDelegate (LuaState luaState) { @@ -145,11 +145,11 @@ private static int RunFunctionDelegate (LuaState luaState, ObjectTranslator tran return func (luaState); } - /* - * __gc metafunction of CLR objects. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] + /* + * __gc metafunction of CLR objects. + */ +#if MONOTOUCH || UNITY_3D + [AOT.MonoPInvokeCallback (typeof (LuaNativeFunction))] #endif private static int CollectObject (LuaState luaState) { @@ -167,11 +167,11 @@ private static int CollectObject (LuaState luaState, ObjectTranslator translator return 0; } - /* - * __tostring metafunction of CLR objects. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] + /* + * __tostring metafunction of CLR objects. + */ +#if MONOTOUCH || UNITY_3D + [AOT.MonoPInvokeCallback (typeof (LuaNativeFunction))] #endif private static int ToStringLua (LuaState luaState) { @@ -192,23 +192,23 @@ private static int ToStringLua (LuaState luaState, ObjectTranslator translator) } -/* - * __add metafunction of CLR objects. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] + /* + * __add metafunction of CLR objects. + */ +#if MONOTOUCH || UNITY_3D + [AOT.MonoPInvokeCallback (typeof (LuaNativeFunction))] #endif static int AddLua (LuaState luaState) { var translator = ObjectTranslatorPool.Instance.Find (luaState); return MatchOperator (luaState, "op_Addition", translator); } - - /* - * __sub metafunction of CLR objects. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] + + /* + * __sub metafunction of CLR objects. + */ +#if MONOTOUCH || UNITY_3D + [AOT.MonoPInvokeCallback (typeof (LuaNativeFunction))] #endif static int SubtractLua (LuaState luaState) { @@ -216,23 +216,23 @@ static int SubtractLua (LuaState luaState) return MatchOperator (luaState, "op_Subtraction", translator); } - /* - * __mul metafunction of CLR objects. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] + /* + * __mul metafunction of CLR objects. + */ +#if MONOTOUCH || UNITY_3D + [AOT.MonoPInvokeCallback (typeof (LuaNativeFunction))] #endif static int MultiplyLua (LuaState luaState) { var translator = ObjectTranslatorPool.Instance.Find (luaState); return MatchOperator (luaState, "op_Multiply", translator); } - - /* - * __div metafunction of CLR objects. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] + + /* + * __div metafunction of CLR objects. + */ +#if MONOTOUCH || UNITY_3D + [AOT.MonoPInvokeCallback (typeof (LuaNativeFunction))] #endif static int DivideLua (LuaState luaState) { @@ -240,23 +240,23 @@ static int DivideLua (LuaState luaState) return MatchOperator (luaState, "op_Division", translator); } - /* - * __mod metafunction of CLR objects. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] + /* + * __mod metafunction of CLR objects. + */ +#if MONOTOUCH || UNITY_3D + [AOT.MonoPInvokeCallback (typeof (LuaNativeFunction))] #endif static int ModLua (LuaState luaState) { var translator = ObjectTranslatorPool.Instance.Find (luaState); return MatchOperator (luaState, "op_Modulus", translator); } - - /* - * __unm metafunction of CLR objects. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] + + /* + * __unm metafunction of CLR objects. + */ +#if MONOTOUCH || UNITY_3D + [AOT.MonoPInvokeCallback (typeof (LuaNativeFunction))] #endif static int UnaryNegationLua (LuaState luaState) { @@ -288,11 +288,11 @@ static int UnaryNegationLua (LuaState luaState, ObjectTranslator translator) } - /* - * __eq metafunction of CLR objects. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] + /* + * __eq metafunction of CLR objects. + */ +#if MONOTOUCH || UNITY_3D + [AOT.MonoPInvokeCallback (typeof (LuaNativeFunction))] #endif static int EqualLua (LuaState luaState) { @@ -300,23 +300,23 @@ static int EqualLua (LuaState luaState) return MatchOperator (luaState, "op_Equality", translator); } - /* - * __lt metafunction of CLR objects. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] + /* + * __lt metafunction of CLR objects. + */ +#if MONOTOUCH || UNITY_3D + [AOT.MonoPInvokeCallback (typeof (LuaNativeFunction))] #endif static int LessThanLua (LuaState luaState) { var translator = ObjectTranslatorPool.Instance.Find (luaState); return MatchOperator (luaState, "op_LessThan", translator); } - - /* - * __le metafunction of CLR objects. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] + + /* + * __le metafunction of CLR objects. + */ +#if MONOTOUCH || UNITY_3D + [AOT.MonoPInvokeCallback (typeof (LuaNativeFunction))] #endif static int LessThanOrEqualLua (LuaState luaState) { @@ -361,15 +361,15 @@ public static void DumpStack (ObjectTranslator translator, LuaState luaState) } } - /* - * Called by the __index metafunction of CLR objects in case the - * method is not cached or it is a field/property/event. - * Receives the object and the member name as arguments and returns - * either the value of the member or a delegate to call it. - * If the member does not exist returns nil. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] + /* + * Called by the __index metafunction of CLR objects in case the + * method is not cached or it is a field/property/event. + * Receives the object and the member name as arguments and returns + * either the value of the member or a delegate to call it. + * If the member does not exist returns nil. + */ +#if MONOTOUCH || UNITY_3D + [AOT.MonoPInvokeCallback (typeof (LuaNativeFunction))] #endif private static int GetMethod (LuaState luaState) { @@ -473,12 +473,12 @@ private int GetMethodInternal (LuaState luaState) return 2; } - /* - * __index metafunction of base classes (the base field of Lua tables). - * Adds a prefix to the method name to call the base version of the method. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] + /* + * __index metafunction of base classes (the base field of Lua tables). + * Adds a prefix to the method name to call the base version of the method. + */ +#if MONOTOUCH || UNITY_3D + [AOT.MonoPInvokeCallback (typeof (LuaNativeFunction))] #endif private static int GetBaseMethod (LuaState luaState) { @@ -762,13 +762,13 @@ void SetMemberCache (Dictionary memberCache, ProxyType objType, members [memberName] = member; } - /* - * __newindex metafunction of CLR objects. Receives the object, - * the member name and the value to be stored as arguments. Throws - * and error if the assignment is invalid. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] + /* + * __newindex metafunction of CLR objects. Receives the object, + * the member name and the value to be stored as arguments. Throws + * and error if the assignment is invalid. + */ +#if MONOTOUCH || UNITY_3D + [AOT.MonoPInvokeCallback (typeof (LuaNativeFunction))] #endif private static int SetFieldOrProperty (LuaState luaState) { @@ -946,11 +946,11 @@ void ThrowError (LuaState luaState, Exception e) translator.ThrowError (luaState, e); } - /* - * __index metafunction of type references, works on static members. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] + /* + * __index metafunction of type references, works on static members. + */ +#if MONOTOUCH || UNITY_3D + [AOT.MonoPInvokeCallback (typeof (LuaNativeFunction))] #endif private static int GetClassMethod (LuaState luaState) { @@ -987,11 +987,11 @@ private int GetClassMethodInternal (LuaState luaState) } } - /* - * __newindex function of type references, works on static members. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] + /* + * __newindex function of type references, works on static members. + */ +#if MONOTOUCH || UNITY_3D + [AOT.MonoPInvokeCallback (typeof (LuaNativeFunction))] #endif private static int SetClassFieldOrProperty (LuaState luaState) { @@ -1014,12 +1014,12 @@ private int SetClassFieldOrPropertyInternal (LuaState luaState) return SetMember (luaState, target, null, BindingFlags.Static); } - /* - * __call metafunction of Delegates. - */ - #if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] - #endif + /* + * __call metafunction of Delegates. + */ +#if MONOTOUCH || UNITY_3D + [AOT.MonoPInvokeCallback (typeof (LuaNativeFunction))] +#endif static int CallDelegate (LuaState luaState) { var translator = ObjectTranslatorPool.Instance.Find (luaState); @@ -1065,14 +1065,14 @@ int CallDelegateInternal (LuaState luaState) return 1; } - /* - * __call metafunction of type references. Searches for and calls - * a constructor for the type. Returns nil if the constructor is not - * found or if the arguments are invalid. Throws an error if the constructor - * generates an exception. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] + /* + * __call metafunction of type references. Searches for and calls + * a constructor for the type. Returns nil if the constructor is not + * found or if the arguments are invalid. Throws an error if the constructor + * generates an exception. + */ +#if MONOTOUCH || UNITY_3D + [AOT.MonoPInvokeCallback (typeof (LuaNativeFunction))] #endif private static int CallConstructor (LuaState luaState) { diff --git a/Assets/NLua/Metatables.cs.meta b/src/NLua/Metatables.cs.meta similarity index 100% rename from Assets/NLua/Metatables.cs.meta rename to src/NLua/Metatables.cs.meta diff --git a/Assets/NLua/Method.meta b/src/NLua/Method.meta similarity index 100% rename from Assets/NLua/Method.meta rename to src/NLua/Method.meta diff --git a/Assets/NLua/Method/EventHandlerContainer.cs b/src/NLua/Method/EventHandlerContainer.cs similarity index 100% rename from Assets/NLua/Method/EventHandlerContainer.cs rename to src/NLua/Method/EventHandlerContainer.cs diff --git a/Assets/NLua/Method/EventHandlerContainer.cs.meta b/src/NLua/Method/EventHandlerContainer.cs.meta similarity index 100% rename from Assets/NLua/Method/EventHandlerContainer.cs.meta rename to src/NLua/Method/EventHandlerContainer.cs.meta diff --git a/Assets/NLua/Method/LuaClassHelper.cs b/src/NLua/Method/LuaClassHelper.cs similarity index 100% rename from Assets/NLua/Method/LuaClassHelper.cs rename to src/NLua/Method/LuaClassHelper.cs diff --git a/Assets/NLua/Method/LuaClassHelper.cs.meta b/src/NLua/Method/LuaClassHelper.cs.meta similarity index 100% rename from Assets/NLua/Method/LuaClassHelper.cs.meta rename to src/NLua/Method/LuaClassHelper.cs.meta diff --git a/Assets/NLua/Method/LuaDelegate.cs b/src/NLua/Method/LuaDelegate.cs similarity index 100% rename from Assets/NLua/Method/LuaDelegate.cs rename to src/NLua/Method/LuaDelegate.cs diff --git a/Assets/NLua/Method/LuaDelegate.cs.meta b/src/NLua/Method/LuaDelegate.cs.meta similarity index 100% rename from Assets/NLua/Method/LuaDelegate.cs.meta rename to src/NLua/Method/LuaDelegate.cs.meta diff --git a/Assets/NLua/Method/LuaEventHandler.cs b/src/NLua/Method/LuaEventHandler.cs similarity index 100% rename from Assets/NLua/Method/LuaEventHandler.cs rename to src/NLua/Method/LuaEventHandler.cs diff --git a/Assets/NLua/Method/LuaEventHandler.cs.meta b/src/NLua/Method/LuaEventHandler.cs.meta similarity index 100% rename from Assets/NLua/Method/LuaEventHandler.cs.meta rename to src/NLua/Method/LuaEventHandler.cs.meta diff --git a/Assets/NLua/Method/LuaMethodWrapper.cs b/src/NLua/Method/LuaMethodWrapper.cs similarity index 100% rename from Assets/NLua/Method/LuaMethodWrapper.cs rename to src/NLua/Method/LuaMethodWrapper.cs diff --git a/Assets/NLua/Method/LuaMethodWrapper.cs.meta b/src/NLua/Method/LuaMethodWrapper.cs.meta similarity index 100% rename from Assets/NLua/Method/LuaMethodWrapper.cs.meta rename to src/NLua/Method/LuaMethodWrapper.cs.meta diff --git a/Assets/NLua/Method/MethodArgs.cs b/src/NLua/Method/MethodArgs.cs similarity index 100% rename from Assets/NLua/Method/MethodArgs.cs rename to src/NLua/Method/MethodArgs.cs diff --git a/Assets/NLua/Method/MethodArgs.cs.meta b/src/NLua/Method/MethodArgs.cs.meta similarity index 100% rename from Assets/NLua/Method/MethodArgs.cs.meta rename to src/NLua/Method/MethodArgs.cs.meta diff --git a/Assets/NLua/Method/MethodCache.cs b/src/NLua/Method/MethodCache.cs similarity index 100% rename from Assets/NLua/Method/MethodCache.cs rename to src/NLua/Method/MethodCache.cs diff --git a/Assets/NLua/Method/MethodCache.cs.meta b/src/NLua/Method/MethodCache.cs.meta similarity index 100% rename from Assets/NLua/Method/MethodCache.cs.meta rename to src/NLua/Method/MethodCache.cs.meta diff --git a/Assets/NLua/Method/RegisterEventHandler.cs b/src/NLua/Method/RegisterEventHandler.cs similarity index 100% rename from Assets/NLua/Method/RegisterEventHandler.cs rename to src/NLua/Method/RegisterEventHandler.cs diff --git a/Assets/NLua/Method/RegisterEventHandler.cs.meta b/src/NLua/Method/RegisterEventHandler.cs.meta similarity index 100% rename from Assets/NLua/Method/RegisterEventHandler.cs.meta rename to src/NLua/Method/RegisterEventHandler.cs.meta diff --git a/Assets/NLua/ObjectTranslator.cs b/src/NLua/ObjectTranslator.cs similarity index 95% rename from Assets/NLua/ObjectTranslator.cs rename to src/NLua/ObjectTranslator.cs index fd6a35f..fc26cd1 100644 --- a/Assets/NLua/ObjectTranslator.cs +++ b/src/NLua/ObjectTranslator.cs @@ -258,12 +258,12 @@ internal void ThrowError (LuaState luaState, object e) LuaLib.LuaError (luaState); } - /* - * Implementation of load_assembly. Throws an error - * if the assembly is not found. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] + /* + * Implementation of load_assembly. Throws an error + * if the assembly is not found. + */ +#if MONOTOUCH || UNITY_3D + [AOT.MonoPInvokeCallback (typeof (LuaNativeFunction))] #endif private static int LoadAssembly (LuaState luaState) { @@ -345,12 +345,12 @@ public MethodInfo GetExtensionMethod (Type type, string name) return type.GetExtensionMethod (name, assemblies); } - /* - * Implementation of import_type. Returns nil if the - * type is not found. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] + /* + * Implementation of import_type. Returns nil if the + * type is not found. + */ +#if MONOTOUCH || UNITY_3D + [AOT.MonoPInvokeCallback (typeof (LuaNativeFunction))] #endif private static int ImportType (LuaState luaState) { @@ -371,13 +371,13 @@ private int ImportTypeInternal (LuaState luaState) return 1; } - /* - * Implementation of make_object. Registers a table (first - * argument in the stack) as an object subclassing the - * type passed as second argument in the stack. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] + /* + * Implementation of make_object. Registers a table (first + * argument in the stack) as an object subclassing the + * type passed as second argument in the stack. + */ +#if MONOTOUCH || UNITY_3D + [AOT.MonoPInvokeCallback (typeof (LuaNativeFunction))] #endif private static int RegisterTable (LuaState luaState) { @@ -423,12 +423,12 @@ private int RegisterTableInternal (LuaState luaState) return 0; } - /* - * Implementation of free_object. Clears the metatable and the - * base field, freeing the created object for garbage-collection - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] + /* + * Implementation of free_object. Clears the metatable and the + * base field, freeing the created object for garbage-collection + */ +#if MONOTOUCH || UNITY_3D + [AOT.MonoPInvokeCallback (typeof (LuaNativeFunction))] #endif private static int UnregisterTable (LuaState luaState) { @@ -467,12 +467,12 @@ private int UnregisterTableInternal (LuaState luaState) return 0; } - /* - * Implementation of get_method_bysig. Returns nil - * if no matching method is not found. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] + /* + * Implementation of get_method_bysig. Returns nil + * if no matching method is not found. + */ +#if MONOTOUCH || UNITY_3D + [AOT.MonoPInvokeCallback (typeof (LuaNativeFunction))] #endif private static int GetMethodSignature (LuaState luaState) { @@ -519,12 +519,12 @@ private int GetMethodSignatureInternal (LuaState luaState) return 1; } - /* - * Implementation of get_constructor_bysig. Returns nil - * if no matching constructor is found. - */ -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] + /* + * Implementation of get_constructor_bysig. Returns nil + * if no matching constructor is found. + */ +#if MONOTOUCH || UNITY_3D + [AOT.MonoPInvokeCallback (typeof (LuaNativeFunction))] #endif private static int GetConstructorSignature (LuaState luaState) { @@ -1010,8 +1010,8 @@ static int PushError (LuaState luaState, string msg) return 2; } -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] +#if MONOTOUCH || UNITY_3D + [AOT.MonoPInvokeCallback (typeof (LuaNativeFunction))] #endif private static int CType (LuaState luaState) { @@ -1029,8 +1029,8 @@ int CTypeInternal (LuaState luaState) return 1; } -#if MONOTOUCH - [MonoPInvokeCallback (typeof (LuaNativeFunction))] +#if MONOTOUCH || UNITY_3D + [AOT.MonoPInvokeCallback (typeof (LuaNativeFunction))] #endif private static int EnumFromInt (LuaState luaState) { diff --git a/Assets/NLua/ObjectTranslator.cs.meta b/src/NLua/ObjectTranslator.cs.meta similarity index 100% rename from Assets/NLua/ObjectTranslator.cs.meta rename to src/NLua/ObjectTranslator.cs.meta diff --git a/Assets/NLua/ObjectTranslatorPool.cs b/src/NLua/ObjectTranslatorPool.cs similarity index 100% rename from Assets/NLua/ObjectTranslatorPool.cs rename to src/NLua/ObjectTranslatorPool.cs diff --git a/Assets/NLua/ObjectTranslatorPool.cs.meta b/src/NLua/ObjectTranslatorPool.cs.meta similarity index 100% rename from Assets/NLua/ObjectTranslatorPool.cs.meta rename to src/NLua/ObjectTranslatorPool.cs.meta diff --git a/Assets/NLua/Platform.meta b/src/NLua/Platform.meta similarity index 100% rename from Assets/NLua/Platform.meta rename to src/NLua/Platform.meta diff --git a/Assets/NLua/Platform/BindFlags.cs b/src/NLua/Platform/BindFlags.cs similarity index 100% rename from Assets/NLua/Platform/BindFlags.cs rename to src/NLua/Platform/BindFlags.cs diff --git a/Assets/NLua/Platform/BindFlags.cs.meta b/src/NLua/Platform/BindFlags.cs.meta similarity index 100% rename from Assets/NLua/Platform/BindFlags.cs.meta rename to src/NLua/Platform/BindFlags.cs.meta diff --git a/Assets/NLua/Platform/CLSCompliantAttribute.cs b/src/NLua/Platform/CLSCompliantAttribute.cs similarity index 100% rename from Assets/NLua/Platform/CLSCompliantAttribute.cs rename to src/NLua/Platform/CLSCompliantAttribute.cs diff --git a/Assets/NLua/Platform/CLSCompliantAttribute.cs.meta b/src/NLua/Platform/CLSCompliantAttribute.cs.meta similarity index 100% rename from Assets/NLua/Platform/CLSCompliantAttribute.cs.meta rename to src/NLua/Platform/CLSCompliantAttribute.cs.meta diff --git a/Assets/NLua/ProxyType.cs b/src/NLua/ProxyType.cs similarity index 100% rename from Assets/NLua/ProxyType.cs rename to src/NLua/ProxyType.cs diff --git a/Assets/NLua/ProxyType.cs.meta b/src/NLua/ProxyType.cs.meta similarity index 100% rename from Assets/NLua/ProxyType.cs.meta rename to src/NLua/ProxyType.cs.meta