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 Title1GunPro;
public GameObject Title1;
public GameObject Title2;
//准心
public GameObject TitleCrossHair; //HOUYIPro
public GameObject TitleCrossHair2;//ARTEMISProGun
public GameObject TitleCrossHairGun;//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();
}
///
/// 校准后到达最后一步射击退出
///
public void SetTitleAfterCalibration() {
SetTipState(TipStep.Finish);
}
///
/// 进入相机感光度的页面
///
public void enterInfraredLightGuider2()
{
#if UNITY_ANDROID
Instantiate(infraredLightGuider2);
#endif
}
///
/// 硬件按键按下
///
public void onClickDevice() {
//infraredGuider 待检测到用户操作了两次单击按键功能,进入下一步
if (mTipStep == TipStep.CrossHairTip)
{
Button crossHairBtn = GameAssistUI.ins.transform.Find("Button5").GetComponent