Runner.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*******************************************************************************
  2. Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
  3. NOTICE:All information contained herein is, and remains the property of
  4. PICO Technology Co., Ltd. The intellectual and technical concepts
  5. contained herein are proprietary to PICO Technology Co., Ltd. and may be
  6. covered by patents, patents in process, and are protected by trade secret or
  7. copyright law. Dissemination of this information or reproduction of this
  8. material is strictly forbidden unless prior written permission is obtained from
  9. PICO Technology Co., Ltd.
  10. *******************************************************************************/
  11. using UnityEngine;
  12. namespace Pico.Platform.Framework
  13. {
  14. public class Runner : MonoBehaviour
  15. {
  16. public static void RegisterGameObject()
  17. {
  18. var name = "Pico.Platform.Runner";
  19. GameObject g = GameObject.Find(name);
  20. if (g == null)
  21. {
  22. g = new GameObject(name);
  23. }
  24. if (g.GetComponent<Runner>() == null)
  25. {
  26. g.AddComponent<Runner>();
  27. }
  28. }
  29. void Awake()
  30. {
  31. DontDestroyOnLoad(gameObject);
  32. }
  33. void Update()
  34. {
  35. Looper.ProcessMessages();
  36. }
  37. void OnApplicationQuit()
  38. {
  39. Looper.Clear();
  40. if (Application.isEditor || Application.platform == RuntimePlatform.WindowsPlayer || Application.platform == RuntimePlatform.WindowsEditor)
  41. {
  42. CLIB.ppf_PcUnInitialize();
  43. }
  44. }
  45. }
  46. }
粤ICP备19079148号