diff --git a/LuaProfiler/LuaProfilerClient/Core/Driver/LuaProfiler.cs b/LuaProfiler/LuaProfilerClient/Core/Driver/LuaProfiler.cs index f5799def..b127a835 100644 --- a/LuaProfiler/LuaProfilerClient/Core/Driver/LuaProfiler.cs +++ b/LuaProfiler/LuaProfilerClient/Core/Driver/LuaProfiler.cs @@ -123,7 +123,9 @@ public static void BeginSample(IntPtr luaState, string name) long memoryCount = LuaLib.GetLuaMemory(luaState); Sample sample = Sample.Create(getcurrentTime, (int)memoryCount, name); beginSampleMemoryStack.Push(sample); + #if UNITY_5_5_OR_NEWER Profiler.BeginSample(name); + #endif } catch { @@ -214,7 +216,9 @@ public static void EndSample(IntPtr luaState) { byte[] luagc = new byte[Math.Max(0, selfLuaGC - 32)]; } + #if UNITY_5_5_OR_NEWER Profiler.EndSample(); + #endif if (!sample.CheckSampleValid()) { diff --git a/LuaProfiler/LuaProfilerClient/Core/Setting/LuaDeepProfilerAssetSetting.cs b/LuaProfiler/LuaProfilerClient/Core/Setting/LuaDeepProfilerAssetSetting.cs index c89ef495..f87c69d8 100644 --- a/LuaProfiler/LuaProfilerClient/Core/Setting/LuaDeepProfilerAssetSetting.cs +++ b/LuaProfiler/LuaProfilerClient/Core/Setting/LuaDeepProfilerAssetSetting.cs @@ -18,7 +18,12 @@ public static LuaDeepProfilerAssetSetting Instance { if (instance == null) { + #if (UNITY_5 || UNITY_2017_1_OR_NEWER) instance = AssetDatabase.LoadAssetAtPath("Assets/LuaDeepProfilerAssetSetting.asset"); + #else + instance = AssetDatabase.LoadAssetAtPath("Assets/LuaDeepProfilerAssetSetting.asset", typeof(LuaDeepProfilerAssetSetting)) as LuaDeepProfilerAssetSetting; + #endif + if (instance == null) { UnityEngine.Debug.Log("Lua Profiler: cannot find integration settings, creating default settings"); diff --git a/LuaProfiler/LuaProfilerClient/Editor/StartUp.cs b/LuaProfiler/LuaProfilerClient/Editor/StartUp.cs index 7cdd3339..52848481 100644 --- a/LuaProfiler/LuaProfilerClient/Editor/StartUp.cs +++ b/LuaProfiler/LuaProfilerClient/Editor/StartUp.cs @@ -464,9 +464,15 @@ public static void Recompile() case BuildTarget.Android: bg = BuildTargetGroup.Android; break; + #if (UNITY_5 || UNITY_2017_1_OR_NEWER) case BuildTarget.iOS: bg = BuildTargetGroup.iOS; break; + #else + case BuildTarget.iPhone: + bg = BuildTargetGroup.iPhone; + break; + #endif } string path = PlayerSettings.GetScriptingDefineSymbolsForGroup(bg); bool hasRecompile = false; diff --git a/LuaProfiler/LuaProfilerClient/Editor/Window/LuaProfilerWindow.cs b/LuaProfiler/LuaProfilerClient/Editor/Window/LuaProfilerWindow.cs index 7020b806..70624876 100644 --- a/LuaProfiler/LuaProfilerClient/Editor/Window/LuaProfilerWindow.cs +++ b/LuaProfiler/LuaProfilerClient/Editor/Window/LuaProfilerWindow.cs @@ -182,6 +182,10 @@ void DoToolbar() } + #if !(UNITY_5 || UNITY_2017_1_OR_NEWER) + public GUIContent titleContent { get; set; } + #endif + // Add menu named "My Window" to the Window menu [MenuItem("Window/Lua Profiler Window")] static public void ShowWindow()