Пример #1
0
    private void OnGUI()
    {
        if (GUILayout.Button("CreateCustomWindow"))
        {
            int a = CreateCustomWindow();
            //Debug.Log("a=" + a);
        }

        if (GUILayout.Button("DestroyCustomWindow"))
        {
            int a = DestroyCustomWindow();
            //Debug.Log("a=" + a);
        }


        if (GUILayout.Button("SetLogoutFunction"))
        {
            UnityDebugLog = (string str) => { Debug.Log(str); };
            SetUnityDebugLog(UnityDebugLog);
            TestLog();
            //Debug.Log("a=" + a);
        }

        if (GUILayout.Button("TestLog"))
        {
            TestLog();
            //Debug.Log("a=" + a);
        }


        // Profiler
        if (GUILayout.Button("SetUnityProfilerFunctions"))
        {
            UnityProfilerBeginSample          = (string str) => { Profiler.BeginSample(str); };
            UnityProfilerEndSample            = () => { Profiler.EndSample(); };
            UnityProfilerBeginThreadProfiling = (string groupName, string threadName) => { Profiler.BeginThreadProfiling(groupName, threadName); };
            UnityProfilerEndThreadProfiling   = () => { Profiler.EndThreadProfiling(); };
            SetUnityProfilerFunctions(UnityProfilerBeginSample, UnityProfilerEndSample, UnityProfilerBeginThreadProfiling, UnityProfilerEndThreadProfiling);
        }

        if (GUILayout.Button("StartTestUnityProfiler"))
        {
            StartTestUnityProfiler();
        }

        if (GUILayout.Button("EndTestUnityProfiler"))
        {
            EndTestUnityProfiler();
        }
    }
Пример #2
0
 private static extern int SetUnityProfilerFunctions(FunUnityProfilerBeginSample logfun_begin_samplefun,
                                                     FunUnityProfilerEndSample fun_end_sample,
                                                     FunUnityProfilerBeginThreadProfiling fun_begin_thread_profiler,
                                                     FunUnityProfilerEndThreadProfiling fun_end_thread_profiler);