InfraredGuider.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class InfraredGuider : MonoBehaviour
  6. {
  7. public GameObject infraredLightGuider;
  8. public GameObject infraredResulutionGuider;
  9. public Button resulutionButton;
  10. public GameObject Title1ARTEMISPro;
  11. public GameObject Title1;
  12. public GameObject Title2;
  13. //相机感光部分
  14. [SerializeField]
  15. Slider slider;
  16. // Start is called before the first frame update
  17. void Start()
  18. {
  19. if (InfraredDemo._ins)
  20. {
  21. slider.onValueChanged.AddListener((value) =>
  22. {
  23. InfraredDemo._ins.onSliderEvent(value, "PU_BRIGHTNESS");
  24. });
  25. InfraredDemo._ins.onSetSliderValue(slider, "PU_BRIGHTNESS");
  26. }
  27. #if UNITY_STANDALONE_WIN || UNITY_EDITOR
  28. resulutionButton.gameObject.SetActive(false);
  29. #endif
  30. //枪暂时不显示
  31. if (BluetoothAim.ins.isMainConnectToGun()) {
  32. Title1ARTEMISPro.SetActive(false);
  33. Title1.SetActive(false);
  34. }
  35. else
  36. //切换ARTEMISPro
  37. if (BluetoothAim.ins.isMainConnectToARTEMISPRO()) {
  38. Title1ARTEMISPro.SetActive(true);
  39. Title1.SetActive(false);
  40. }
  41. }
  42. // Update is called once per frame
  43. //void Update()
  44. //{
  45. //}
  46. public void enterLightView() {
  47. Instantiate(infraredLightGuider);
  48. }
  49. public void enterInfraredResulutionGuider() {
  50. #if UNITY_ANDROID
  51. Instantiate(infraredResulutionGuider);
  52. #endif
  53. }
  54. public void ExitGuider() {
  55. //if (NewUserGuiderManager.ins)
  56. // NewUserGuiderManager.ins.OnEnd();
  57. GameAssistUI.ins.onBtnBack();
  58. //GameMgr.bNavBack = false;
  59. //Destroy(gameObject);
  60. }
  61. /// <summary>
  62. /// 校准后切换标题
  63. /// </summary>
  64. public void SetTitleAfterCalibration() {
  65. Title1ARTEMISPro.SetActive(false);
  66. Title1.SetActive(false);
  67. Title2.SetActive(true) ;
  68. }
  69. }