RUPlatform-ios.mm 630 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. //
  2. // Platform-ios.cpp
  3. //
  4. // Created by 杜家兑macbook on 17/2/11.
  5. //
  6. #import <Foundation/Foundation.h>
  7. #include "RUPlatform.h"
  8. USING_NS_CC;
  9. NS_RU_BEGIN
  10. static Platform *g_Platform = nullptr;
  11. Platform* Platform::getInstance()
  12. {
  13. if (g_Platform == nullptr)
  14. {
  15. g_Platform = new (std::nothrow) Platform;
  16. }
  17. return g_Platform;
  18. }
  19. void Platform::reportLog(string log){
  20. }
  21. void Platform::vibrate(int duration, int strength) {
  22. }
  23. double Platform::getSystemUpTime(){
  24. //返回用户开机了多少秒
  25. double second = [[NSProcessInfo processInfo] systemUptime];
  26. return second;
  27. }
  28. NS_RU_END