GlobalEventCenter.cs 682 B

12345678910111213141516171819202122
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class GlobalEventCenter : MonoBehaviour
  5. {
  6. public System.Action onGameSceneLoad;
  7. public System.Action onGameSceneDestroy;
  8. public System.Action<bool> onSimulateMouseAwakeChanged; //Param0:激活/熄灭
  9. public System.Action<bool> onDeviceCalibrateViewAwakeChanged;
  10. private static GlobalEventCenter _ins;
  11. public static GlobalEventCenter ins {
  12. get {
  13. if (!_ins) {
  14. _ins = new GameObject("GlobalEventCenter").AddComponent<GlobalEventCenter>();
  15. DontDestroyOnLoad(_ins);
  16. }
  17. return _ins;
  18. }
  19. }
  20. }