|
@@ -553,6 +553,9 @@ public class AimDeviceInfos
|
|
|
/// </summary>
|
|
/// </summary>
|
|
|
private void CrossBtnEvent()
|
|
private void CrossBtnEvent()
|
|
|
{
|
|
{
|
|
|
|
|
+ //b端不处理准心
|
|
|
|
|
+ if (CommonConfig.StandaloneModeOrPlatformB) return;
|
|
|
|
|
+
|
|
|
Debug.Log("CrossBtnEvent");
|
|
Debug.Log("CrossBtnEvent");
|
|
|
//准心开关
|
|
//准心开关
|
|
|
InvokeOnCrossBtnEvent();
|
|
InvokeOnCrossBtnEvent();
|
|
@@ -563,8 +566,19 @@ public class AimDeviceInfos
|
|
|
if (infraredGuider == null)
|
|
if (infraredGuider == null)
|
|
|
{
|
|
{
|
|
|
//显示控制准心按钮
|
|
//显示控制准心按钮
|
|
|
- Button crossHairBtn = GameAssistUI.ins.transform.Find("Button5").GetComponent<Button>();
|
|
|
|
|
- crossHairBtn.onClick.Invoke();
|
|
|
|
|
|
|
+ Transform _button5 = GameAssistUI.ins.transform.Find("Button5");
|
|
|
|
|
+ if (_button5.gameObject.activeSelf)
|
|
|
|
|
+ {
|
|
|
|
|
+ Button crossHairBtn = _button5.GetComponent<Button>();
|
|
|
|
|
+ crossHairBtn.onClick.Invoke();
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ bool onlyShow = !CrossHair.ins.GetOnlyShow();
|
|
|
|
|
+ CrossHair.ins.SetOnlyShow(onlyShow);
|
|
|
|
|
+ //保存准心状态
|
|
|
|
|
+ if (InfraredDemo._ins) InfraredDemo._ins.setCrosshairValue(onlyShow);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
|
|
|
|
@@ -587,20 +601,53 @@ public class AimDeviceInfos
|
|
|
else if (DuckHunter.GameUI.Instance)
|
|
else if (DuckHunter.GameUI.Instance)
|
|
|
{
|
|
{
|
|
|
//显示控制准心按钮
|
|
//显示控制准心按钮
|
|
|
- Button crossHairBtn = DuckHunter.GameUI.Instance.transform.Find("BtnCrosshair").GetComponent<Button>();
|
|
|
|
|
- crossHairBtn.onClick.Invoke();
|
|
|
|
|
|
|
+ Transform _btnCrosshair = DuckHunter.GameUI.Instance.transform.Find("BtnCrosshair");
|
|
|
|
|
+ if (_btnCrosshair.gameObject.activeSelf)
|
|
|
|
|
+ {
|
|
|
|
|
+ Button crossHairBtn = _btnCrosshair.GetComponent<Button>();
|
|
|
|
|
+ crossHairBtn.onClick.Invoke();
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ bool onlyShow = !DuckHunter.CrossHair.Instance.GetOnlyShow();
|
|
|
|
|
+ DuckHunter.CrossHair.Instance.SetOnlyShow(onlyShow);
|
|
|
|
|
+ //记录准心值
|
|
|
|
|
+ if (InfraredDemo._ins) InfraredDemo._ins.setCrosshairValue(onlyShow);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
else if (HyperspaceGame.UIManager._ins) {
|
|
else if (HyperspaceGame.UIManager._ins) {
|
|
|
//打枪
|
|
//打枪
|
|
|
- Button crossHairBtn = HyperspaceGame.UIManager._ins.transform.Find("BtnCrosshair").GetComponent<Button>();
|
|
|
|
|
- crossHairBtn.onClick.Invoke();
|
|
|
|
|
|
|
+ Transform _btnCrosshair = HyperspaceGame.UIManager._ins.transform.Find("BtnCrosshair");
|
|
|
|
|
+ if (_btnCrosshair.gameObject.activeSelf)
|
|
|
|
|
+ {
|
|
|
|
|
+ Button crossHairBtn = _btnCrosshair.GetComponent<Button>();
|
|
|
|
|
+ crossHairBtn.onClick.Invoke();
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ bool onlyShow = !HyperspaceGame.UIManager._ins.GetOnlyShow();
|
|
|
|
|
+ HyperspaceGame.UIManager._ins.SetOnlyShow(onlyShow);
|
|
|
|
|
+ //记录准心值
|
|
|
|
|
+ if (InfraredDemo._ins) InfraredDemo._ins.setCrosshairValue(onlyShow);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name.StartsWith("FruitMaster")){
|
|
if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name.StartsWith("FruitMaster")){
|
|
|
//水果
|
|
//水果
|
|
|
- Button crossHairBtn = GameObject.Find("PermanentCanvas/CrossHair_Btn").GetComponent<Button>();
|
|
|
|
|
- crossHairBtn.onClick.Invoke();
|
|
|
|
|
|
|
+ GameObject _crosshairBtn = GameObject.Find("PermanentCanvas/CrossHair_Btn");
|
|
|
|
|
+ if (_crosshairBtn.gameObject.activeSelf)
|
|
|
|
|
+ {
|
|
|
|
|
+ Button crossHairBtn = _crosshairBtn.GetComponent<Button>();
|
|
|
|
|
+ crossHairBtn.onClick.Invoke();
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ bool onlyShow = !JCFruitMaster.ins.GetOnlyShow();
|
|
|
|
|
+ JCFruitMaster.ins.SetOnlyShow(onlyShow);
|
|
|
|
|
+ //记录准心值
|
|
|
|
|
+ if (InfraredDemo._ins) InfraredDemo._ins.setCrosshairValue(onlyShow);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|