Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

兼容unity4.7 #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions LuaProfiler/LuaProfilerClient/Core/Driver/LuaProfiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ public static LuaDeepProfilerAssetSetting Instance
{
if (instance == null)
{
#if (UNITY_5 || UNITY_2017_1_OR_NEWER)
instance = AssetDatabase.LoadAssetAtPath<LuaDeepProfilerAssetSetting>("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");
Expand Down
6 changes: 6 additions & 0 deletions LuaProfiler/LuaProfilerClient/Editor/StartUp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down