2024-10-25 18:09:59 +08:00
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Diagnostics;
|
|
|
|
using System.Reflection;
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
using System.Xml;
|
|
|
|
using UnityEngine;
|
|
|
|
using UnityEngine.Scripting;
|
|
|
|
|
|
|
|
#if PLATFORM_WEIXINMINIGAME || PLATFORM_WEBGL || UNITY_EDITOR
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLE_WX_PERF_FEATURE
|
|
|
|
namespace WXSDKPerf
|
|
|
|
{
|
|
|
|
[Preserve]
|
|
|
|
[ComVisible(false)]
|
|
|
|
public class WXPerfEngine
|
|
|
|
{
|
|
|
|
static WXPerfEngine_Implementation m_PerfEngineImplementation = null;
|
|
|
|
|
|
|
|
[RuntimeInitializeOnLoadMethod]
|
|
|
|
public static void StartWXPerfEngine()
|
|
|
|
{
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
return;
|
2024-12-07 22:30:19 +08:00
|
|
|
#else
|
2024-10-25 18:09:59 +08:00
|
|
|
m_PerfEngineImplementation = new WXPerfEngine_Implementation();
|
|
|
|
m_PerfEngineImplementation.StartPerfEngine();
|
2024-12-07 22:30:19 +08:00
|
|
|
#endif
|
2024-10-25 18:09:59 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static void Annotation(string InAnnotationString)
|
|
|
|
{
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
return;
|
2024-12-07 22:30:19 +08:00
|
|
|
#else
|
2024-10-25 18:09:59 +08:00
|
|
|
if (m_PerfEngineImplementation == null)
|
|
|
|
{
|
|
|
|
UnityEngine.Debug.LogError("Annotation: Invalid m_PerfEngineImplementation! ");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
m_PerfEngineImplementation.Annotation(InAnnotationString);
|
2024-12-07 22:30:19 +08:00
|
|
|
#endif
|
2024-10-25 18:09:59 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // ENABLE_WX_PERF_FEATURE
|