fix:1、添加兑换code界面。2、更改单双指的禁用和开启(打开其他界面时)

This commit is contained in:
2026-06-24 11:22:55 +08:00
parent f0f102fe4c
commit 65a797d384
36 changed files with 341 additions and 28 deletions
@@ -172,8 +172,59 @@ namespace ChillConnect
return new Vector2(x, y);
}
#region
// 全局开关(true: 恢复输入 false:禁用输入)
private void OpenOrStopGameInput(object obj = null)
{
if (obj != null && !(bool)obj)
{
// 禁用输入
DisableGameInput();
}
else
{
// 恢复输入
EnableGameInput();
}
}
private int _inputDisableCount = 0;
// 禁用输入
private void DisableGameInput()
{
_inputDisableCount++;
// 只有第一次禁用时执行清理
if (_inputDisableCount == 1)
{
if (_viewContainer != null)
_viewContainer.touchable = false;
_isDraging = false;
_isTwoFingerTouch = false;
_lastTouchPos = Vector2.zero;
}
}
// 恢复输入
private void EnableGameInput(object obj = null)
{
_inputDisableCount = Mathf.Max(0, _inputDisableCount - 1);
// 计数归0时才真正恢复
if (_inputDisableCount == 0)
{
if (_viewContainer != null)
_viewContainer.touchable = true;
}
}
#endregion
public override void OnUpdate()
{
// Update 里判断改为:
if (_inputDisableCount > 0)
return;
// 初始化未完成,直接跳过拖拽
if (!_initComplete)
return;
@@ -333,6 +384,7 @@ namespace ChillConnect
GameDispatcher.Instance.AddListener(GameMsg.ThemeChange, SetModel);
GameDispatcher.Instance.AddListener(GameMsg.UpdateSpeed, SetSpeed);
GameDispatcher.Instance.AddListener(GameMsg.UseProps, SetUserPorp);
GameDispatcher.Instance.AddListener(GameMsg.StopArrowTouch,OpenOrStopGameInput);
}
@@ -344,6 +396,7 @@ namespace ChillConnect
GameDispatcher.Instance.RemoveListener(GameMsg.ThemeChange, SetModel);
GameDispatcher.Instance.RemoveListener(GameMsg.UpdateSpeed, SetSpeed);
GameDispatcher.Instance.RemoveListener(GameMsg.UseProps, SetUserPorp);
GameDispatcher.Instance.RemoveListener(GameMsg.StopArrowTouch, OpenOrStopGameInput);
@@ -38,6 +38,7 @@ namespace ChillConnect
protected override void OnClose()
{
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, true);
}
//
@@ -49,6 +50,8 @@ namespace ChillConnect
protected override void OnOpenBefore(object args)
{
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, false);
ui.btn_switch.state.selectedIndex = DataMgr.ArrowDarkTheme.Value;
SetBtnState();
@@ -33,6 +33,8 @@ namespace ChillConnect
protected override void OnClose()
{
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, true);
CommonHelper.FadeOut(ui);
}
@@ -43,6 +45,8 @@ namespace ChillConnect
protected override void OnOpenBefore(object args)
{
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, false);
if (args != null)
InitView((int)args);
}
+3
View File
@@ -37,6 +37,8 @@ namespace ChillConnect
protected override void OnClose()
{
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, true);
GameDispatcher.Instance.Dispatch(GameMsg.showBroadCast);
}
@@ -49,6 +51,7 @@ namespace ChillConnect
protected override void OnOpenBefore(object args)
{
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, false);
GameDispatcher.Instance.Dispatch(GameMsg.hideBroadCast);
// delayedCall = DOVirtual.DelayedCall(0.3f, () =>
@@ -224,7 +224,8 @@ namespace ChillConnect
{
ui.btn_check_level.SetClick(() =>
{
GameDispatcher.Instance.Dispatch(GameMsg.OpenGame);
//跳转游戏,本来就在游戏中
// GameDispatcher.Instance.Dispatch(GameMsg.OpenGame);
CtrlCloseUI();
});
}
@@ -46,6 +46,8 @@ namespace ChillConnect
protected override void OnClose()
{
// WebviewManager.ShezhiACT(true);
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, true);
}
protected override void OnBind()
@@ -55,6 +57,7 @@ namespace ChillConnect
protected override void OnOpenBefore(object args)
{
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, false);
// if (Screen.safeArea.y != 0)
// {
@@ -39,6 +39,8 @@ namespace ChillConnect
protected override void OnClose()
{
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, true);
closeCallback?.Invoke();
}
@@ -49,6 +51,7 @@ namespace ChillConnect
protected override void OnOpenBefore(object args)
{
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, false);
InitView();
}
+3
View File
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 625f78d565b44a3b92054107c980d93c
timeCreated: 1782269723
@@ -0,0 +1,19 @@
namespace ChillConnect
{
public class RedeemCodeCtrl : BaseCtrl
{
public static RedeemCodeCtrl Instance { get; private set; }
private RedeemCodeModel model;
protected override void OnInit()
{
Instance = this;
}
protected override void OnDispose()
{
Instance = null;
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: a93167d1dab140d2917cf72e64e89770
timeCreated: 1782269723
@@ -0,0 +1,15 @@
namespace ChillConnect
{
public class RedeemCodeModel : BaseModel
{
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 20b6c254390a48eabb165d883f54bf67
timeCreated: 1782269723
@@ -0,0 +1,75 @@
using System.Collections;
using System.Globalization;
using DG.Tweening;
using FairyGUI;
using FGUI.Loading_25;
using FGUI.tixian;
using UnityEngine;
namespace ChillConnect
{
public class RedeemCodeUI : BaseUI
{
private RedeemCodeUICtrl ctrl;
private RedeemCodeModel model;
private com_redeem_code ui;
public RedeemCodeUI(RedeemCodeUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.RedeemCodeUI;
this.ctrl = ctrl;
}
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "tixian";
uiInfo.assetName = "com_redeem_code";
uiInfo.layerType = UILayerType.Loading;
uiInfo.isNeedOpenAnim = false;
uiInfo.isNeedCloseAnim = false;
uiInfo.isNeedUIMask = false;
}
#region
protected override void OnInit()
{
}
protected override void OnClose()
{
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, true);
}
protected override void OnBind()
{
ui = baseUI as com_redeem_code;
}
protected override void OnOpenBefore(object args)
{
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, false);
}
protected override void OnOpen(object args)
{
}
#endregion
#region
protected override void AddListener()
{
}
protected override void RemoveListener()
{
}
#endregion
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 02aaefad43c146b18cb726f31814007e
timeCreated: 1782269723
@@ -0,0 +1,64 @@
namespace ChillConnect
{
public class RedeemCodeUICtrl : BaseUICtrl
{
private RedeemCodeUI ui;
private RedeemCodeModel model;
private uint openUIMsg = UICtrlMsg.RedeemCodeUI_Open;
private uint closeUIMsg = UICtrlMsg.RedeemCodeUI_Close;
#region
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
public override void OpenUI(object args = null)
{
if (ui == null)
{
ui = new RedeemCodeUI(this);
ui.Open(args);
}
}
public override void CloseUI(object args = null)
{
if (ui is { isClose: false })
{
ui.Close();
}
ui = null;
}
#endregion
public override uint GetOpenUIMsg(string uiName)
{
return openUIMsg;
}
public override uint GetCloseUIMsg(string uiName)
{
return closeUIMsg;
}
protected override void AddListener()
{
AppDispatcher.Instance.AddListener(AppMsg.UI_DisplayLoadingUI, OpenUI);
}
protected override void RemoveListener()
{
AppDispatcher.Instance.RemoveListener(AppMsg.UI_DisplayLoadingUI, OpenUI);
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: db2d94c85bfc42988faab968658f117e
timeCreated: 1782269723
@@ -50,6 +50,8 @@ namespace ChillConnect
protected override void OnClose()
{
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, true);
AdRedeemManager.Instance.Destroy();
HallManager.Instance.UpdateSecondEvent -= updateSpeedCD;
HallManager.Instance.UpdateSecondEvent -= Update;
@@ -71,6 +73,8 @@ namespace ChillConnect
protected override void OnOpenBefore(object args)
{
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, false);
if (Screen.safeArea.y != 0)
{//刘海屏
ui.group_.y += Screen.safeArea.y;
@@ -46,6 +46,8 @@ namespace ChillConnect
protected override void OnClose()
{
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, true);
GameHelper.showGameUI = true;
}
@@ -56,6 +58,9 @@ namespace ChillConnect
protected override void OnOpenBefore(object args)
{
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, false);
if (Screen.safeArea.y != 0)
{
ui.com_gold.y += 68;
@@ -38,6 +38,8 @@ namespace ChillConnect
protected override void OnClose()
{
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, false);
//open_sign();
}
@@ -48,6 +50,7 @@ namespace ChillConnect
protected override void OnOpenBefore(object args)
{
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, false);
InitView();
}