NativeHelper.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. #########
  3. ############
  4. #############
  5. ## ###########
  6. ### ###### #####
  7. ### ####### ####
  8. ### ########## ####
  9. #### ########### ####
  10. #### ########### #####
  11. ##### ### ######## #####
  12. ##### ### ######## ######
  13. ###### ### ########### ######
  14. ###### #### ############## ######
  15. ####### ##################### ######
  16. ####### ###################### ######
  17. ####### ###### ################# ######
  18. ####### ###### ###### ######### ######
  19. ####### ## ###### ###### ######
  20. ####### ###### ##### #####
  21. ###### ##### ##### ####
  22. ##### #### ##### ###
  23. ##### ### ### #
  24. ### ### ###
  25. ## ### ###
  26. __________#_______####_______####______________
  27. 我们的未来没有BUG
  28. * ==============================================================================
  29. * Filename: NativeHelper
  30. * Created: 2018/7/13 14:29:22
  31. * Author: エル・プサイ・コングリィ
  32. * Purpose:
  33. * ==============================================================================
  34. */
  35. #if UNITY_EDITOR || USE_LUA_PROFILER
  36. namespace MikuLuaProfiler
  37. {
  38. using System;
  39. using System.Diagnostics;
  40. using System.Runtime.InteropServices;
  41. using UnityEngine;
  42. #if UNITY_5_5_OR_NEWER
  43. using UnityEngine.Profiling;
  44. #endif
  45. public static class NativeHelper
  46. {
  47. public static int GetPass()
  48. {
  49. #if UNITY_5_5_OR_NEWER
  50. return (int)Profiler.GetTotalAllocatedMemoryLong();
  51. #else
  52. return (int)Profiler.GetTotalAllocatedMemory();
  53. #endif
  54. }
  55. public static float GetBatteryLevel()
  56. {
  57. float result = 100;
  58. return result;
  59. }
  60. }
  61. }
  62. #endif