| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265 | 
							- using System.Collections;
 
- using System.Collections.Generic;
 
- using UnityEngine;
 
- using UnityEngine.UI;
 
- public enum TipStep { 
 
-     None = 0,
 
-     //准心显示和隐藏
 
-     CrossHairTip = 1,
 
-     //校准偏移量
 
-     CalibrationOffset =2,
 
-     //完成
 
-     Finish = 3,
 
- }
 
- public class InfraredGuider : MonoBehaviour
 
- {
 
-     public GameObject infraredLightGuider;
 
-     public GameObject infraredLightGuider2;
 
-     public GameObject infraredResulutionGuider;
 
-     public Button resulutionButton;
 
-     public GameObject Title1ARTEMISPro;
 
-     public GameObject Title1;
 
-     public GameObject Title2;
 
-     //准心
 
-     public GameObject TitleCrossHair; //HOUYIPro
 
-     public GameObject TitleCrossHair2;//ARTEMISPro 和 Gun
 
-     public TipStep mTipStep { get; private set; } = TipStep.None;
 
-     public int collisionCount = 0;
 
-     bool bRemove = false;
 
-     //相机感光部分
 
-     [SerializeField]
 
-     Slider slider;
 
-     [Tooltip("异常校准时候步骤1")]
 
-     public GameObject Step1;
 
-     [Tooltip("正常游戏流程步骤2")]
 
-     public GameObject Step2;
 
-     [Tooltip("异常问题时候文字提示步骤1")]
 
-     public GameObject Step3;
 
-     // Start is called before the first frame update
 
-     void Start()
 
-     {
 
-         if (InfraredDemo._ins)
 
-         {
 
-             slider.onValueChanged.AddListener((value) =>
 
-             {
 
-                 InfraredDemo._ins.onSliderEvent(value, "PU_BRIGHTNESS");
 
-             });
 
-             InfraredDemo._ins.onSetSliderValue(slider, "PU_BRIGHTNESS");
 
-         }
 
- #if  UNITY_STANDALONE_WIN || UNITY_EDITOR
 
-         resulutionButton.gameObject.SetActive(false);
 
- #endif
 
-         ////枪暂时不显示
 
-         //if (BluetoothAim.ins.isMainConnectToGun()) {
 
-         //    SetTipState(TipStep.None);
 
-         //}
 
-         //else
 
-         ////切换ARTEMISPro
 
-         //if (BluetoothAim.ins.isMainConnectToARTEMISPRO()) {
 
-         //    SetTipState(TipStep.CrossHairTip);
 
-         //}
 
-     }
 
-     public void enterLightView() {
 
-          Instantiate(infraredLightGuider);
 
-     }
 
-     public void enterInfraredResulutionGuider() {
 
- #if UNITY_ANDROID
 
-         Instantiate(infraredResulutionGuider);
 
- #endif
 
-     }
 
-     public void ExitGuider() {
 
-         GameAssistUI.ins.onBtnBack();
 
-     }
 
-     /// <summary>
 
-     /// 校准后到达最后一步射击退出
 
-     /// </summary>
 
-     public void SetTitleAfterCalibration() {
 
-         SetTipState(TipStep.Finish);
 
-     }
 
-     /// <summary>
 
-     /// 进入相机感光度的页面
 
-     /// </summary>
 
-     public void enterInfraredLightGuider2()
 
-     {
 
- #if UNITY_ANDROID
 
-         Instantiate(infraredLightGuider2);
 
- #endif
 
-     }
 
-     /// <summary>
 
-     /// 硬件按键按下
 
-     /// </summary>
 
-     public void onClickDevice() {
 
-         //infraredGuider 待检测到用户操作了两次单击按键功能,进入下一步
 
-         if (mTipStep == TipStep.CrossHairTip)
 
-         {
 
-             Button crossHairBtn = GameAssistUI.ins.transform.Find("Button5").GetComponent<Button>();
 
-             crossHairBtn.onClick.Invoke();
 
-             if (GameMgr.ButtonCount == 1)
 
-             {
 
-                 GameMgr.ButtonCount = 0;
 
-                 //进入到偏移校准
 
-                 SetTipState(TipStep.CalibrationOffset);
 
-             }
 
-             else
 
-             {
 
-                 GameMgr.ButtonCount++;
 
-             }
 
-         }
 
-     }
 
-     /// <summary>
 
-     /// 长按或者栓剂触发
 
-     /// </summary>
 
-     public void onLongClickDevice()
 
-     {
 
-         if (Title1.activeSelf || Title1ARTEMISPro.activeSelf)
 
-         {
 
-             AutoResetView.onInfraredGuiderAutoResetView(); 
 
-         }
 
-     }
 
-     /// <summary>
 
-     /// 根据enum操作ui
 
-     /// </summary>
 
-     /// <param name="tipStep"></param>
 
-     public void SetTipState(TipStep tipStep = TipStep.None) {
 
-         mTipStep = tipStep;
 
-         switch (tipStep)
 
-         {
 
-             case TipStep.None://全部隐藏
 
-                 AllTipFalse();
 
-                 break;
 
-             case TipStep.CrossHairTip:
 
-                 AllTipFalse();
 
-                 if (BluetoothAim.ins.isMainConnectToHOUYIPRO())
 
-                 {
 
-                     TitleCrossHair.SetActive(true);
 
-                 }
 
-                 else if (BluetoothAim.ins.isMainConnectToARTEMISPRO() || BluetoothAim.ins.isMainConnectToGun())
 
-                 {
 
-                     TitleCrossHair2.SetActive(true);
 
-                 }
 
-                 break;
 
-             case TipStep.CalibrationOffset:
 
-                 AllTipFalse();
 
-                 //按照连接的类型来区分
 
-                 if (BluetoothAim.ins.isMainConnectToHOUYIPRO())
 
-                 {
 
-                     Title1.SetActive(true);
 
-                 }
 
-                 else if (BluetoothAim.ins.isMainConnectToARTEMISPRO() || BluetoothAim.ins.isMainConnectToGun())
 
-                 {
 
-                     Title1ARTEMISPro.SetActive(true);
 
-                 }
 
-                 break;
 
-             case TipStep.Finish:
 
-                 AllTipFalse();
 
-                 Title2.SetActive(true);
 
-                 break;
 
-         }
 
-     }
 
-     void AllTipFalse() {
 
-         TitleCrossHair.SetActive(false);
 
-         TitleCrossHair2.SetActive(false);
 
-         Title1.SetActive(false);
 
-         Title2.SetActive(false);
 
-         Title1ARTEMISPro.SetActive(false);
 
-     }
 
-     /// <summary>
 
-     /// 异常问题处理时候的文字提示步骤页面
 
-     /// </summary>
 
-     public void OnStep3TextTip()
 
-     {
 
-         if (Step1.activeSelf && !bRemove)
 
-         {
 
-             bRemove = true;
 
-             StartCoroutine(delaySet());
 
-         }
 
-         Step1.SetActive(false);
 
-         Step2.SetActive(false);
 
-         Step3.SetActive(true);
 
-         SetTipState(TipStep.CrossHairTip);
 
-     }
 
-     /// <summary>
 
-     /// 检测四个角跳转到准心开关界面
 
-     /// </summary>
 
-     public void OnStep2ShootTest()
 
-     {
 
-         Debug.Log("OnStep2ShootTest hui 1:" + Step1.activeSelf + " = " + bRemove);
 
-         if (Step1.activeSelf && !bRemove)
 
-         {
 
-             bRemove = true;
 
-             StartCoroutine(delaySet());
 
-             Debug.Log("OnStep2ShootTest delaySet:" + Step1.activeSelf + " = " + bRemove);
 
-         }
 
-         Step1.SetActive(false);
 
-         Step2.SetActive(true);
 
-         Step3.SetActive(false);
 
-         SetTipState(TipStep.CrossHairTip);
 
-     }
 
-     IEnumerator delaySet() {
 
-   
 
-         yield return new WaitForSeconds(0.5f);
 
-         SimulateMouseController.ins?.RemoveOpenLocker(this);
 
-     }
 
-     public void SetCollisionEvent() {
 
-         if (collisionCount < 3)
 
-         {
 
-             collisionCount++;
 
-         }
 
-         else {
 
-             //进入下一步
 
-             OnStep2ShootTest();
 
-         }
 
-         
 
-     }
 
-     void OnEnable()
 
-     {
 
-         SimulateMouseController.ins?.AddOpenLocker(this);
 
-     }
 
-     //void OnDisable()
 
-     //{
 
-        
 
-     //}
 
-     //private void Update()
 
-     //{
 
-     //    if (Input.GetKeyDown(KeyCode.Alpha5))
 
-     //    {
 
-     //        onLongClickDevice();
 
-     //    }
 
-     //}
 
- }
 
 
  |