diff --git a/Assets/Fungus/Narrative/Scripts/SayDialog.cs b/Assets/Fungus/Narrative/Scripts/SayDialog.cs index ff4e0b1b..a9cddf72 100644 --- a/Assets/Fungus/Narrative/Scripts/SayDialog.cs +++ b/Assets/Fungus/Narrative/Scripts/SayDialog.cs @@ -161,7 +161,7 @@ namespace Fungus soundEffectClip = speakingCharacter.soundEffect; } - yield return writer.Write(text, clearPrevious, waitForInput, stopVoiceover, soundEffectClip, onComplete); + yield return StartCoroutine(writer.Write(text, clearPrevious, waitForInput, stopVoiceover, soundEffectClip, onComplete)); } protected virtual void LateUpdate() diff --git a/Assets/Fungus/Thirdparty/FungusLua/Scripts/Editor/MenuItems.cs b/Assets/Fungus/Thirdparty/FungusLua/Scripts/Editor/MenuItems.cs index 285bbe24..550c2f71 100644 --- a/Assets/Fungus/Thirdparty/FungusLua/Scripts/Editor/MenuItems.cs +++ b/Assets/Fungus/Thirdparty/FungusLua/Scripts/Editor/MenuItems.cs @@ -44,8 +44,12 @@ namespace Fungus File.WriteAllText(path, ""); AssetDatabase.Refresh(); +#if UNITY_5_3_OR_NEWER Object asset = AssetDatabase.LoadAssetAtPath(path); - if (asset != null) +#else + Object asset = AssetDatabase.LoadAssetAtPath(path, typeof(Object)); +#endif + if (asset != null) { EditorUtility.FocusProjectWindow(); EditorGUIUtility.PingObject(asset); diff --git a/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaScript.cs b/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaScript.cs index 1e83e30e..6fa0f3d9 100644 --- a/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaScript.cs +++ b/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaScript.cs @@ -138,7 +138,7 @@ namespace Fungus } else { - luaEnvironment.RunLuaCoroutine(luaFunction, friendlyName); + luaEnvironment.RunLuaCoroutine(luaFunction, luaScript); } } } diff --git a/Assets/Tests/StringSubstitution/StringSubstitutionTests.unity b/Assets/Tests/StringSubstitution/StringSubstitutionTests.unity index cf200eec..74f78fa6 100644 --- a/Assets/Tests/StringSubstitution/StringSubstitutionTests.unity +++ b/Assets/Tests/StringSubstitution/StringSubstitutionTests.unity @@ -8,25 +8,25 @@ SceneSettings: m_PVSPortalsArray: [] m_OcclusionBakeSettings: smallestOccluder: 5 - smallestHole: 0.25 + smallestHole: .25 backfaceThreshold: 100 --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 serializedVersion: 6 m_Fog: 0 - m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogColor: {r: .5, g: .5, b: .5, a: 1} m_FogMode: 3 - m_FogDensity: 0.01 + m_FogDensity: .00999999978 m_LinearFogStart: 0 m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} - m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} - m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientSkyColor: {r: .211999997, g: .226999998, b: .259000003, a: 1} + m_AmbientEquatorColor: {r: .114, g: .125, b: .133000001, a: 1} + m_AmbientGroundColor: {r: .0469999984, g: .0430000015, b: .0350000001, a: 1} m_AmbientIntensity: 1 m_AmbientMode: 3 m_SkyboxMaterial: {fileID: 0} - m_HaloStrength: 0.5 + m_HaloStrength: .5 m_FlareStrength: 1 m_FlareFadeSpeed: 3 m_HaloTexture: {fileID: 0} @@ -40,7 +40,7 @@ RenderSettings: --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 6 + serializedVersion: 5 m_GIWorkflowMode: 1 m_LightmapsMode: 1 m_GISettings: @@ -65,8 +65,7 @@ LightmapSettings: m_TextureCompression: 1 m_FinalGather: 0 m_FinalGatherRayCount: 1024 - m_ReflectionCompression: 2 - m_LightingDataAsset: {fileID: 0} + m_LightmapSnapshot: {fileID: 0} m_RuntimeCPUUsage: 25 --- !u!196 &4 NavMeshSettings: @@ -74,77 +73,76 @@ NavMeshSettings: m_ObjectHideFlags: 0 m_BuildSettings: serializedVersion: 2 - agentRadius: 0.5 + agentRadius: .5 agentHeight: 2 agentSlope: 45 - agentClimb: 0.4 + agentClimb: .400000006 ledgeDropHeight: 0 maxJumpAcrossDistance: 0 accuratePlacement: 0 minRegionArea: 2 - cellSize: 0.16666667 + cellSize: .166666672 manualCellSize: 0 m_NavMeshData: {fileID: 0} ---- !u!1 &32012239 -GameObject: +--- !u!127 &5 +LevelGameManager: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 100640, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 32012240} - - 114: {fileID: 32012242} - - 114: {fileID: 32012241} - m_Layer: 0 - m_Name: LuaEnvironment - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 +--- !u!1001 &30477053 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 982964957} + m_Modifications: + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 11486636, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: stringTable + value: + objectReference: {fileID: 4900000, guid: 9900570d789fa4b29957e4b897af9e3b, type: 3} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + m_IsPrefabParent: 0 --- !u!4 &32012240 Transform: - m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 32012239} - 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: 982964957} - m_RootOrder: 0 ---- !u!114 &32012241 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 11486636, guid: 49031c561e16d4fcf91c12153f8e0b25, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 32012239} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c10f0b861365b42b0928858f7b086ff3, type: 3} - m_Name: - m_EditorClassIdentifier: - fungusModule: 0 - stringTable: {fileID: 4900000, guid: 9900570d789fa4b29957e4b897af9e3b, type: 3} - activeLanguage: en - timeScale: -1 - registerTypes: - - {fileID: 4900000, guid: 9c3ab7a98d51241bbb499643399fa761, type: 3} + m_PrefabInternal: {fileID: 30477053} --- !u!114 &32012242 MonoBehaviour: - m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 11493126, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 32012239} - m_Enabled: 1 - m_EditorHideFlags: 0 + m_PrefabInternal: {fileID: 30477053} m_Script: {fileID: 11500000, guid: ba19c26c1ba7243d2b57ebc4329cc7c6, type: 3} - m_Name: - m_EditorClassIdentifier: - remoteDebugger: 0 --- !u!1 &35396879 GameObject: m_ObjectHideFlags: 0 @@ -226,7 +224,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 3 + m_RootOrder: 1 --- !u!1 &167744853 GameObject: m_ObjectHideFlags: 1 @@ -254,7 +252,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 61dddfdc5e0e44ca298d8f46f7f5a915, type: 3} m_Name: m_EditorClassIdentifier: - selectedFlowchart: {fileID: 875535388} + selectedFlowchart: {fileID: 1563984266} --- !u!4 &167744855 Transform: m_ObjectHideFlags: 1 @@ -266,16 +264,17 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 1 ---- !u!1 &530598961 + m_RootOrder: 0 +--- !u!1 &436484125 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 139298, guid: c356764ac08ce4af2806a601a4f1e6e9, type: 2} m_PrefabInternal: {fileID: 0} serializedVersion: 4 m_Component: - - 4: {fileID: 530598962} - - 114: {fileID: 530598963} + - 4: {fileID: 436484126} + - 114: {fileID: 436484128} + - 114: {fileID: 436484127} m_Layer: 0 m_Name: LuaScript m_TagString: Untagged @@ -283,38 +282,30 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &530598962 +--- !u!4 &436484126 Transform: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 449874, guid: c356764ac08ce4af2806a601a4f1e6e9, type: 2} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 530598961} + m_GameObject: {fileID: 436484125} 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: 1627631718} m_RootOrder: 1 ---- !u!114 &530598963 +--- !u!114 &436484127 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 11472914, guid: c356764ac08ce4af2806a601a4f1e6e9, type: 2} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 530598961} + m_GameObject: {fileID: 436484125} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 446caeace65234baaacd52095d24f101, type: 3} m_Name: m_EditorClassIdentifier: - executeAfterTime: 1 - repeatExecuteTime: 1 - repeatEveryTime: 1 - executeAfterFrames: 1 - repeatExecuteFrame: 1 - repeatEveryFrame: 1 - hasFailed: 0 - executeMethods: 2 luaEnvironment: {fileID: 0} luaFile: {fileID: 0} luaScript: 'local subbed = "" @@ -330,6 +321,69 @@ MonoBehaviour: ' runAsCoroutine: 1 +--- !u!114 &436484128 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11446228, guid: c356764ac08ce4af2806a601a4f1e6e9, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 436484125} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6ee79785811ba49399c1b56d7309e3df, type: 3} + m_Name: + m_EditorClassIdentifier: + executeAfterTime: 1 + repeatExecuteTime: 1 + repeatEveryTime: 1 + executeAfterFrames: 1 + repeatExecuteFrame: 1 + repeatEveryFrame: 1 + hasFailed: 0 + executeMethods: 2 + executeMethodName: OnExecute +--- !u!1001 &529362524 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 545923889} + m_Modifications: + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_RootOrder + value: 4 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + m_IsPrefabParent: 0 --- !u!1 &545923887 GameObject: m_ObjectHideFlags: 0 @@ -345,7 +399,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!114 &545923888 MonoBehaviour: m_ObjectHideFlags: 0 @@ -384,7 +438,7 @@ Transform: - {fileID: 1373360854} - {fileID: 701857887} m_Father: {fileID: 0} - m_RootOrder: 7 + m_RootOrder: 6 --- !u!1 &567521726 GameObject: m_ObjectHideFlags: 0 @@ -414,7 +468,7 @@ MonoBehaviour: m_Script: {fileID: 1997211142, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_ForceModuleActive: 0 + m_AllowActivationOnStandalone: 0 --- !u!114 &567521728 MonoBehaviour: m_ObjectHideFlags: 0 @@ -431,8 +485,7 @@ MonoBehaviour: m_SubmitButton: Submit m_CancelButton: Cancel m_InputActionsPerSecond: 10 - m_RepeatDelay: 0.5 - m_ForceModuleActive: 0 + m_AllowActivationOnMobileDevice: 0 --- !u!114 &567521729 MonoBehaviour: m_ObjectHideFlags: 0 @@ -458,7 +511,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 6 + m_RootOrder: 2 --- !u!1 &684307462 GameObject: m_ObjectHideFlags: 0 @@ -474,7 +527,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!114 &684307463 MonoBehaviour: m_ObjectHideFlags: 0 @@ -509,69 +562,13 @@ Transform: - {fileID: 951347108} - {fileID: 1563984263} - {fileID: 1633325651} - - {fileID: 1380821995} + - {fileID: 1249712163} m_Father: {fileID: 0} m_RootOrder: 5 ---- !u!1 &695468074 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 100640, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 695468075} - - 114: {fileID: 695468077} - - 114: {fileID: 695468076} - m_Layer: 0 - m_Name: LuaEnvironment - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 --- !u!4 &695468075 Transform: - m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 695468074} - 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: 1627631718} - m_RootOrder: 2 ---- !u!114 &695468076 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 11486636, guid: 49031c561e16d4fcf91c12153f8e0b25, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 695468074} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c10f0b861365b42b0928858f7b086ff3, type: 3} - m_Name: - m_EditorClassIdentifier: - fungusModule: 0 - stringTable: {fileID: 0} - activeLanguage: en - timeScale: -1 - registerTypes: - - {fileID: 4900000, guid: 9c3ab7a98d51241bbb499643399fa761, type: 3} ---- !u!114 &695468077 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 11493126, guid: 49031c561e16d4fcf91c12153f8e0b25, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 695468074} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: ba19c26c1ba7243d2b57ebc4329cc7c6, type: 3} - m_Name: - m_EditorClassIdentifier: - remoteDebugger: 0 + m_PrefabInternal: {fileID: 1967693978} --- !u!1 &701857886 GameObject: m_ObjectHideFlags: 0 @@ -623,12 +620,11 @@ MonoBehaviour: - System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - UnityEngine.SendMessageOptions, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - UnityEngine.SceneManagement.Scene, UnityEngine, Version=0.0.0.0, Culture=neutral, - PublicKeyToken=null - UnityEngine.Object, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - System.Single, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - UnityEngine.UI.Text, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - UnityEngine.TextGenerator, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + - UnityEngine.Material, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - UnityEngine.Texture, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - UnityEngine.Font, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - UnityEngine.TextAnchor, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null @@ -643,6 +639,76 @@ MonoBehaviour: - key: text obj: {fileID: 1532141878} component: {fileID: 1532141880} +--- !u!1 &791892755 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 139298, guid: c356764ac08ce4af2806a601a4f1e6e9, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 791892758} + - 114: {fileID: 791892757} + - 114: {fileID: 791892756} + m_Layer: 0 + m_Name: LuaScript + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &791892756 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11472914, guid: c356764ac08ce4af2806a601a4f1e6e9, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 791892755} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 446caeace65234baaacd52095d24f101, type: 3} + m_Name: + m_EditorClassIdentifier: + luaEnvironment: {fileID: 32012242} + luaFile: {fileID: 0} + luaScript: "local subbed = \"\"\n\n-- Test global variable subsitution\nglobalname + = \"Fred\"\nsubbed = sub(\"{$globalname}\")\ncheck (subbed == \"Fred\")\n\n-- + Test English string table entry\nsubbed = sub(\"{$hello}\")\ncheck(subbed == \"Hi + there\")\n\n-- Test French string table entry\nsetlanguage(\"fr\")\nsubbed = sub(\"{$hello}\")\ncheck(subbed + == \"Bonjour\")\n\n-- Global \n\npass()\n" + runAsCoroutine: 1 +--- !u!114 &791892757 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11446228, guid: c356764ac08ce4af2806a601a4f1e6e9, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 791892755} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6ee79785811ba49399c1b56d7309e3df, type: 3} + m_Name: + m_EditorClassIdentifier: + executeAfterTime: 1 + repeatExecuteTime: 1 + repeatEveryTime: 1 + executeAfterFrames: 1 + repeatExecuteFrame: 1 + repeatEveryFrame: 1 + hasFailed: 0 + executeMethods: 2 + executeMethodName: OnExecute +--- !u!4 &791892758 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 449874, guid: c356764ac08ce4af2806a601a4f1e6e9, type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 791892755} + 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: 982964957} + m_RootOrder: 1 --- !u!1 &875535382 GameObject: m_ObjectHideFlags: 0 @@ -818,7 +884,7 @@ MonoBehaviour: indentLevel: 0 _duration: floatRef: {fileID: 0} - floatVal: 0.1 + floatVal: .100000001 durationOLD: 0 --- !u!114 &875535390 MonoBehaviour: @@ -963,9 +1029,9 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 32012240} - - {fileID: 1546173554} + - {fileID: 791892758} m_Father: {fileID: 0} - m_RootOrder: 2 + m_RootOrder: 3 --- !u!1 &1106846132 GameObject: m_ObjectHideFlags: 0 @@ -1054,79 +1120,18 @@ Canvas: m_ReceivesEvents: 1 m_OverrideSorting: 0 m_OverridePixelPerfect: 0 - m_SortingBucketNormalizedSize: 0 m_SortingLayerID: 0 m_SortingOrder: 0 - m_TargetDisplay: 0 ---- !u!1 &1373360853 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 100640, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 1373360854} - - 114: {fileID: 1373360856} - - 114: {fileID: 1373360855} - m_Layer: 0 - m_Name: LuaEnvironment - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1373360854 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1373360853} - 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: 545923889} - m_RootOrder: 4 ---- !u!114 &1373360855 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 11486636, guid: 49031c561e16d4fcf91c12153f8e0b25, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1373360853} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c10f0b861365b42b0928858f7b086ff3, type: 3} - m_Name: - m_EditorClassIdentifier: - fungusModule: 0 - stringTable: {fileID: 0} - activeLanguage: en - timeScale: -1 - registerTypes: - - {fileID: 4900000, guid: 9c3ab7a98d51241bbb499643399fa761, type: 3} ---- !u!114 &1373360856 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 11493126, guid: 49031c561e16d4fcf91c12153f8e0b25, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1373360853} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: ba19c26c1ba7243d2b57ebc4329cc7c6, type: 3} - m_Name: - m_EditorClassIdentifier: - remoteDebugger: 0 ---- !u!1 &1380821994 +--- !u!1 &1249712160 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 139298, guid: c356764ac08ce4af2806a601a4f1e6e9, type: 2} m_PrefabInternal: {fileID: 0} serializedVersion: 4 m_Component: - - 4: {fileID: 1380821995} - - 114: {fileID: 1380821996} + - 4: {fileID: 1249712163} + - 114: {fileID: 1249712162} + - 114: {fileID: 1249712161} m_Layer: 0 m_Name: LuaScript m_TagString: Untagged @@ -1134,39 +1139,19 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &1380821995 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 449874, guid: c356764ac08ce4af2806a601a4f1e6e9, type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1380821994} - 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: 684307464} - m_RootOrder: 3 ---- !u!114 &1380821996 +--- !u!114 &1249712161 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 11472914, guid: c356764ac08ce4af2806a601a4f1e6e9, type: 2} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1380821994} + m_GameObject: {fileID: 1249712160} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 446caeace65234baaacd52095d24f101, type: 3} m_Name: m_EditorClassIdentifier: - executeAfterTime: 1 - repeatExecuteTime: 1 - repeatEveryTime: 1 - executeAfterFrames: 1 - repeatExecuteFrame: 1 - repeatEveryFrame: 1 - hasFailed: 0 - executeMethods: 2 - luaEnvironment: {fileID: 0} + luaEnvironment: {fileID: 1633325653} luaFile: {fileID: 0} luaScript: 'local subbed = "" @@ -1187,6 +1172,43 @@ MonoBehaviour: pass()' runAsCoroutine: 1 +--- !u!114 &1249712162 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11446228, guid: c356764ac08ce4af2806a601a4f1e6e9, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1249712160} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6ee79785811ba49399c1b56d7309e3df, type: 3} + m_Name: + m_EditorClassIdentifier: + executeAfterTime: 1 + repeatExecuteTime: 1 + repeatEveryTime: 1 + executeAfterFrames: 1 + repeatExecuteFrame: 1 + repeatEveryFrame: 1 + hasFailed: 0 + executeMethods: 2 + executeMethodName: OnExecute +--- !u!4 &1249712163 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 449874, guid: c356764ac08ce4af2806a601a4f1e6e9, type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1249712160} + 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: 684307464} + m_RootOrder: 3 +--- !u!4 &1373360854 +Transform: + m_PrefabParentObject: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + m_PrefabInternal: {fileID: 529362524} --- !u!1 &1532141878 GameObject: m_ObjectHideFlags: 0 @@ -1216,11 +1238,11 @@ RectTransform: m_Children: [] m_Father: {fileID: 1106846133} m_RootOrder: 0 - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchorMin: {x: .5, y: .5} + m_AnchorMax: {x: .5, y: .5} m_AnchoredPosition: {x: 30, y: 0} m_SizeDelta: {x: 199, y: 63} - m_Pivot: {x: 0.5, y: 0.5} + m_Pivot: {x: .5, y: .5} --- !u!114 &1532141880 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1234,12 +1256,6 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_FontData: m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} m_FontSize: 30 @@ -1248,7 +1264,6 @@ MonoBehaviour: m_MinSize: 3 m_MaxSize: 40 m_Alignment: 0 - m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -1260,62 +1275,6 @@ CanvasRenderer: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1532141878} ---- !u!1 &1546173553 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 139298, guid: c356764ac08ce4af2806a601a4f1e6e9, type: 2} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 1546173554} - - 114: {fileID: 1546173555} - m_Layer: 0 - m_Name: LuaScript - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1546173554 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 449874, guid: c356764ac08ce4af2806a601a4f1e6e9, type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1546173553} - 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: 982964957} - m_RootOrder: 1 ---- !u!114 &1546173555 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 11472914, guid: c356764ac08ce4af2806a601a4f1e6e9, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1546173553} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 446caeace65234baaacd52095d24f101, type: 3} - m_Name: - m_EditorClassIdentifier: - executeAfterTime: 1 - repeatExecuteTime: 1 - repeatEveryTime: 1 - executeAfterFrames: 1 - repeatExecuteFrame: 1 - repeatEveryFrame: 1 - hasFailed: 0 - executeMethods: 2 - luaEnvironment: {fileID: 0} - luaFile: {fileID: 0} - luaScript: "local subbed = \"\"\n\n-- Test global variable subsitution\nglobalname - = \"Fred\"\nsubbed = sub(\"{$globalname}\")\ncheck (subbed == \"Fred\")\n\n-- - Test English string table entry\nsubbed = sub(\"{$hello}\")\ncheck(subbed == \"Hi - there\")\n\n-- Test French string table entry\nsetlanguage(\"fr\")\nsubbed = sub(\"{$hello}\")\ncheck(subbed - == \"Bonjour\")\n\n-- Global \n\npass()\n" - runAsCoroutine: 1 --- !u!1 &1563984262 GameObject: m_ObjectHideFlags: 0 @@ -1443,70 +1402,62 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 35396880} - - {fileID: 530598962} + - {fileID: 436484126} - {fileID: 695468075} m_Father: {fileID: 0} m_RootOrder: 4 ---- !u!1 &1633325650 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 100640, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 1633325651} - - 114: {fileID: 1633325653} - - 114: {fileID: 1633325652} - m_Layer: 0 - m_Name: LuaEnvironment - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 --- !u!4 &1633325651 Transform: - m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1633325650} - 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: 684307464} - m_RootOrder: 2 ---- !u!114 &1633325652 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 11486636, guid: 49031c561e16d4fcf91c12153f8e0b25, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1633325650} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c10f0b861365b42b0928858f7b086ff3, type: 3} - m_Name: - m_EditorClassIdentifier: - fungusModule: 0 - stringTable: {fileID: 0} - activeLanguage: en - timeScale: -1 - registerTypes: - - {fileID: 4900000, guid: 9c3ab7a98d51241bbb499643399fa761, type: 3} + m_PrefabInternal: {fileID: 1755607537} --- !u!114 &1633325653 MonoBehaviour: - m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 11493126, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1633325650} - m_Enabled: 1 - m_EditorHideFlags: 0 + m_PrefabInternal: {fileID: 1755607537} m_Script: {fileID: 11500000, guid: ba19c26c1ba7243d2b57ebc4329cc7c6, type: 3} - m_Name: - m_EditorClassIdentifier: - remoteDebugger: 0 +--- !u!1001 &1755607537 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 684307464} + m_Modifications: + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + m_IsPrefabParent: 0 --- !u!1 &1818190873 GameObject: m_ObjectHideFlags: 0 @@ -1590,6 +1541,48 @@ MonoBehaviour: localizationId: showLineNumbers: 0 hideCommands: [] +--- !u!1001 &1967693978 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1627631718} + m_Modifications: + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + m_IsPrefabParent: 0 --- !u!1 &2035584478 GameObject: m_ObjectHideFlags: 0 @@ -1598,6 +1591,7 @@ GameObject: serializedVersion: 4 m_Component: - 4: {fileID: 2035584479} + - 114: {fileID: 2035584481} - 114: {fileID: 2035584480} m_Layer: 0 m_Name: LuaScript @@ -1630,14 +1624,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 446caeace65234baaacd52095d24f101, type: 3} m_Name: m_EditorClassIdentifier: - executeAfterTime: 1 - repeatExecuteTime: 1 - repeatEveryTime: 1 - executeAfterFrames: 1 - repeatExecuteFrame: 1 - repeatEveryFrame: 1 - hasFailed: 0 - executeMethods: 2 luaEnvironment: {fileID: 0} luaFile: {fileID: 0} luaScript: 'globalvar="C" @@ -1653,6 +1639,26 @@ MonoBehaviour: pass()' runAsCoroutine: 1 +--- !u!114 &2035584481 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2035584478} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6ee79785811ba49399c1b56d7309e3df, type: 3} + m_Name: + m_EditorClassIdentifier: + executeAfterTime: 1 + repeatExecuteTime: 1 + repeatEveryTime: 1 + executeAfterFrames: 1 + repeatExecuteFrame: 1 + repeatEveryFrame: 1 + hasFailed: 0 + executeMethods: 2 + executeMethodName: OnExecute --- !u!1 &2135590527 GameObject: m_ObjectHideFlags: 0 @@ -1702,14 +1708,14 @@ Camera: m_Enabled: 1 serializedVersion: 2 m_ClearFlags: 1 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844} + m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438} m_NormalizedViewPortRect: serializedVersion: 2 x: 0 y: 0 width: 1 height: 1 - near clip plane: 0.3 + near clip plane: .300000012 far clip plane: 1000 field of view: 60 orthographic: 1 @@ -1721,12 +1727,10 @@ 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: 0.022 - m_StereoMirrorMode: 0 + m_StereoSeparation: .0219999999 --- !u!4 &2135590532 Transform: m_ObjectHideFlags: 0 diff --git a/Assets/Tests/UI/Editor/TextTagParserTests.cs b/Assets/Tests/UI/Editor/TextTagParserTests.cs index cdcd13b6..e9ad375d 100644 --- a/Assets/Tests/UI/Editor/TextTagParserTests.cs +++ b/Assets/Tests/UI/Editor/TextTagParserTests.cs @@ -1,10 +1,13 @@ using System; using System.Collections.Generic; -using NUnit.Framework; using UnityEngine; - using Fungus; +#if UNITY_5_3_OR_NEWER + +using NUnit.Framework; + + [TestFixture] public class TextTagParserTests { @@ -217,3 +220,5 @@ public class TextTagParserTests } } + +#endif diff --git a/Assets/UnityTestTools/Assertions/Editor/AssertionComponentEditor.cs b/Assets/UnityTestTools/Assertions/Editor/AssertionComponentEditor.cs index a2736a72..d4a1dc35 100644 --- a/Assets/UnityTestTools/Assertions/Editor/AssertionComponentEditor.cs +++ b/Assets/UnityTestTools/Assertions/Editor/AssertionComponentEditor.cs @@ -4,7 +4,9 @@ using System.Linq; using System.Reflection; using UnityEditor; using UnityEngine; +#if UNITY_5_3_OR_NEWER using UnityEditor.SceneManagement; +#endif namespace UnityTest { @@ -83,7 +85,13 @@ namespace UnityTest } } if(GUI.changed) + { +#if UNITY_5_3_OR_NEWER EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene()); +#else + EditorApplication.MarkSceneDirty(); +#endif + } } private void DrawOptionsForAfterPeriodOfTime(AssertionComponent script) diff --git a/Assets/UnityTestTools/Assertions/Editor/AssertionExplorerWindow.cs b/Assets/UnityTestTools/Assertions/Editor/AssertionExplorerWindow.cs index ecd7fdaf..831f808b 100644 --- a/Assets/UnityTestTools/Assertions/Editor/AssertionExplorerWindow.cs +++ b/Assets/UnityTestTools/Assertions/Editor/AssertionExplorerWindow.cs @@ -32,7 +32,11 @@ namespace UnityTest public AssertionExplorerWindow() { +#if UNITY_5_3_OR_NEWER titleContent = new GUIContent("Assertion Explorer"); +#else + title = "Assertion Explorer"; +#endif } public void OnDidOpenScene() diff --git a/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Batch.cs b/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Batch.cs index 27a9418f..6d850f2b 100644 --- a/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Batch.cs +++ b/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/Batch.cs @@ -6,7 +6,10 @@ using UnityEditor; using UnityEditorInternal; using UnityEngine; using UnityTest.IntegrationTests; + +#if UNITY_5_3_OR_NEWER using UnityEditor.SceneManagement; +#endif namespace UnityTest { @@ -99,7 +102,12 @@ namespace UnityTest } EditorBuildSettings.scenes = (testScenes.Concat(otherBuildScenes).ToList()).Select(s => new EditorBuildSettingsScene(s, true)).ToArray(); + +#if UNITY_5_3_OR_NEWER EditorSceneManager.OpenScene(testScenes.First()); +#else + EditorApplication.LoadLevelInPlayMode(testScenes.First()); +#endif GuiHelper.SetConsoleErrorPause(false); var config = new PlatformRunnerConfiguration diff --git a/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/IntegrationTestsRunnerWindow.cs b/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/IntegrationTestsRunnerWindow.cs index 2a5ed8d1..1ced5dd6 100644 --- a/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/IntegrationTestsRunnerWindow.cs +++ b/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/IntegrationTestsRunnerWindow.cs @@ -6,7 +6,9 @@ using System.Text.RegularExpressions; using UnityEditor; using UnityEngine; using UnityTest.IntegrationTestRunner; +#if UNITY_5_3_OR_NEWER using UnityEngine.SceneManagement; +#endif namespace UnityTest { @@ -84,7 +86,11 @@ namespace UnityTest private static void BackgroundSceneChangeWatch() { if (!s_Instance) return; +#if UNITY_5_3_OR_NEWER var currentScene = SceneManager.GetActiveScene().path; +#else + var currentScene = Application.loadedLevelName; +#endif if (s_Instance.m_CurrectSceneName != null && s_Instance.m_CurrectSceneName == currentScene) return; if (EditorApplication.isPlayingOrWillChangePlaymode) return; TestComponent.DestroyAllDynamicTests(); @@ -95,7 +101,11 @@ namespace UnityTest public void OnEnable() { - titleContent = new GUIContent("Integration Tests"); +#if UNITY_5_3_OR_NEWER + titleContent = new GUIContent("Integration Tests"); +#else + title = "Integration Tests"; +#endif s_Instance = this; m_Settings = ProjectSettingsBase.Load(); @@ -241,7 +251,11 @@ namespace UnityTest if (!EditorApplication.isPlayingOrWillChangePlaymode) { var dynamicTestsOnScene = TestComponent.FindAllDynamicTestsOnScene(); +#if UNITY_5_3_OR_NEWER var dynamicTestTypes = TestComponent.GetTypesWithHelpAttribute(SceneManager.GetActiveScene().path); +#else + var dynamicTestTypes = TestComponent.GetTypesWithHelpAttribute(Application.loadedLevelName); +#endif foreach (var dynamicTestType in dynamicTestTypes) { diff --git a/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/NetworkResultsReceiver.cs b/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/NetworkResultsReceiver.cs index f3be3380..c2994c48 100644 --- a/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/NetworkResultsReceiver.cs +++ b/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/NetworkResultsReceiver.cs @@ -177,7 +177,11 @@ namespace UnityTest public void OnEnable() { minSize = new Vector2(300, 100); +#if UNITY_5_3_OR_NEWER titleContent = new GUIContent("Test run monitor"); +#else + title = "Test run monitor"; +#endif Instance = this; m_StatusLabel = "Initializing..."; if (EditorApplication.isCompiling) return; diff --git a/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunnerConfiguration.cs b/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunnerConfiguration.cs index 1c0a7856..c8a54971 100644 --- a/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunnerConfiguration.cs +++ b/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunnerConfiguration.cs @@ -6,7 +6,10 @@ using System.Net; using System.Net.Sockets; using UnityEditor; using UnityEngine; + +#if UNITY_5_3_OR_NEWER using UnityEngine.SceneManagement; +#endif [Serializable] public class PlatformRunnerConfiguration @@ -15,7 +18,11 @@ public class PlatformRunnerConfiguration public List testScenes; public BuildTarget buildTarget; public bool runInEditor; +#if UNITY_5_3_OR_NEWER public string projectName = SceneManager.GetActiveScene().path; +#else + public string projectName = Application.loadedLevelName; +#endif public string resultsDir = null; public bool sendResultsOverNetwork; @@ -25,7 +32,11 @@ public class PlatformRunnerConfiguration public PlatformRunnerConfiguration(BuildTarget buildTarget) { this.buildTarget = buildTarget; +#if UNITY_5_3_OR_NEWER projectName = SceneManager.GetActiveScene().path; +#else + projectName = Application.loadedLevelName; +#endif } public PlatformRunnerConfiguration() diff --git a/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunnerSettingsWindow.cs b/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunnerSettingsWindow.cs index 5ae9d077..71145de1 100644 --- a/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunnerSettingsWindow.cs +++ b/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunnerSettingsWindow.cs @@ -6,7 +6,9 @@ using System.Net; using UnityEditor; using UnityEngine; using Object = UnityEngine.Object; +#if UNITY_5_3_OR_NEWER using UnityEngine.SceneManagement; +#endif namespace UnityTest.IntegrationTests { @@ -43,12 +45,21 @@ namespace UnityTest.IntegrationTests if (m_IntegrationTestScenes == null) m_IntegrationTestScenes = new List (); - titleContent = new GUIContent("Platform runner"); +#if UNITY_5_3_OR_NEWER + titleContent = new GUIContent("Platform runner"); +#else + title = "Platform runner"; +#endif m_BuildTarget = PlatformRunner.defaultBuildTarget; position.Set(position.xMin, position.yMin, 200, position.height); m_AllScenesInProject = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.unity", SearchOption.AllDirectories).ToList(); m_AllScenesInProject.Sort(); - var currentScene = (Directory.GetCurrentDirectory() + SceneManager.GetActiveScene().path).Replace("\\", "").Replace("/", ""); + +#if UNITY_5_3_OR_NEWER + var currentScene = (Directory.GetCurrentDirectory() + SceneManager.GetActiveScene().path).Replace("\\", "").Replace("/", ""); +#else + var currentScene = (Directory.GetCurrentDirectory() + Application.loadedLevelName).Replace("\\", "").Replace("/", ""); +#endif var currentScenePath = m_AllScenesInProject.Where(s => s.Replace("\\", "").Replace("/", "") == currentScene); m_SelectedScenes.AddRange(currentScenePath); @@ -267,7 +278,11 @@ namespace UnityTest.IntegrationTests buildTarget = m_BuildTarget, buildScenes = m_OtherScenesToBuild, testScenes = m_IntegrationTestScenes, +#if UNITY_5_3_OR_NEWER projectName = m_IntegrationTestScenes.Count > 1 ? "IntegrationTests" : Path.GetFileNameWithoutExtension(SceneManager.GetActiveScene().path), +#else + projectName = m_IntegrationTestScenes.Count > 1 ? "IntegrationTests" : Path.GetFileNameWithoutExtension(Application.loadedLevelName), +#endif resultsDir = m_Settings.resultsPath, sendResultsOverNetwork = m_Settings.sendResultsOverNetwork, ipList = m_Interfaces.Skip(1).ToList(), diff --git a/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/TestComponentEditor.cs b/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/TestComponentEditor.cs index 1b30f558..3e72b184 100644 --- a/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/TestComponentEditor.cs +++ b/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/TestComponentEditor.cs @@ -4,7 +4,9 @@ using System.Linq; using UnityEditor; using UnityEngine; using Object = UnityEngine.Object; +#if UNITY_5_3_OR_NEWER using UnityEditor.SceneManagement; +#endif namespace UnityTest { @@ -103,7 +105,11 @@ namespace UnityTest if (!component.dynamic) serializedObject.ApplyModifiedProperties(); if (GUI.changed) +#if UNITY_5_3_OR_NEWER EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene()); +#else + EditorApplication.MarkSceneDirty(); +#endif } private string[] GetListOfIgnoredPlatforms(string[] enumList, int flags) diff --git a/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/ResultDTO.cs b/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/ResultDTO.cs index e8a8e4e8..59dea472 100644 --- a/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/ResultDTO.cs +++ b/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/ResultDTO.cs @@ -1,7 +1,9 @@ using System; using System.Collections.Generic; using UnityEngine; +#if UNITY_5_3_OR_NEWER using UnityEngine.SceneManagement; +#endif namespace UnityTest { @@ -19,9 +21,15 @@ namespace UnityTest private ResultDTO(MessageType messageType) { this.messageType = messageType; - levelCount = UnityEngine.SceneManagement.SceneManager.sceneCount; +#if UNITY_5_3_OR_NEWER + levelCount = UnityEngine.SceneManagement.SceneManager.sceneCount; loadedLevel = UnityEngine.SceneManagement.SceneManager.GetActiveScene().buildIndex; loadedLevelName = UnityEngine.SceneManagement.SceneManager.GetActiveScene().name; +#else + levelCount = Application.levelCount; + loadedLevel = Application.loadedLevel; + loadedLevelName = Application.loadedLevelName; +#endif } public enum MessageType : byte diff --git a/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestComponent.cs b/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestComponent.cs index d8d91646..9f3012c6 100644 --- a/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestComponent.cs +++ b/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestComponent.cs @@ -3,7 +3,9 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; using UnityEngine; +#if UNITY_5_3_OR_NEWER using UnityEngine.SceneManagement; +#endif #if UNITY_EDITOR using UnityEditor; @@ -308,10 +310,10 @@ namespace UnityTest public static bool AnyDynamicTestForCurrentScene() { -#if UNITY_EDITOR +#if UNITY_5_3_OR_NEWER return TestComponent.GetTypesWithHelpAttribute(SceneManager.GetActiveScene().name).Any(); #else - return TestComponent.GetTypesWithHelpAttribute(SceneManager.GetActiveScene().name).Any(); + return TestComponent.GetTypesWithHelpAttribute(Application.loadedLevelName).Any(); #endif } diff --git a/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestRunner.cs b/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestRunner.cs index 9c64a2f8..b502ee50 100644 --- a/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestRunner.cs +++ b/Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/TestRunner.cs @@ -8,7 +8,9 @@ using System.Reflection; using UnityEngine; using UnityTest.IntegrationTestRunner; using System.IO; +#if UNITY_5_3_OR_NEWER using UnityEngine.SceneManagement; +#endif namespace UnityTest { @@ -75,7 +77,11 @@ namespace UnityTest } TestComponent.DestroyAllDynamicTests(); +#if UNITY_5_3_OR_NEWER var dynamicTestTypes = TestComponent.GetTypesWithHelpAttribute(SceneManager.GetActiveScene().name); +#else + var dynamicTestTypes = TestComponent.GetTypesWithHelpAttribute(""); +#endif foreach (var dynamicTestType in dynamicTestTypes) TestComponent.CreateDynamicTest(dynamicTestType); @@ -310,7 +316,11 @@ namespace UnityTest string testScene = m_Configurator.GetIntegrationTestScenes(TestSceneNumber); if (testScene != null) + { +#if UNITY_5_3_OR_NEWER SceneManager.LoadScene(Path.GetFileNameWithoutExtension(testScene)); +#endif + } else { TestRunnerCallback.AllScenesFinished(); @@ -373,7 +383,14 @@ namespace UnityTest currentTest = null; if (!testResult.IsSuccess && testResult.Executed - && !testResult.IsIgnored) k_ResultRenderer.AddResults(SceneManager.GetActiveScene().name, testResult); + && !testResult.IsIgnored) + { +#if UNITY_5_3_OR_NEWER + k_ResultRenderer.AddResults(SceneManager.GetActiveScene().name, testResult); +#else + k_ResultRenderer.AddResults(Application.loadedLevelName, testResult); +#endif + } } #region Test Runner Helpers