BLE9AxisHolder.cs 801 B

1234567891011121314151617181920212223242526272829
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.SceneManagement;
  5. public class BLE9AxisHolder : MonoBehaviour
  6. {
  7. static BLE9AxisHolder ins;
  8. public static void Init()
  9. {
  10. if (ins) return;
  11. ins = new GameObject(typeof(BLE9AxisHolder).Name).AddComponent<BLE9AxisHolder>();
  12. DontDestroyOnLoad(ins);
  13. ins.gameObject.AddComponent<BluetoothAim>();
  14. ins.gameObject.AddComponent<AimHandler>();
  15. ins.gameObject.AddComponent<ShootCheck>();
  16. }
  17. void Awake()
  18. {
  19. SceneManager.sceneLoaded += (scene, mode) =>
  20. {
  21. if (scene.name.Equals("Start"))
  22. {
  23. PinBallUIManager.instance.ShowUI(new object[] { "BluetoothView" });
  24. }
  25. };
  26. }
  27. }