fix:1、添加主题更换。2、修复bug
This commit is contained in:
@@ -71,7 +71,8 @@ namespace ChillConnect
|
||||
private ArrowConfig _currentTipArrow;
|
||||
// 手指图标偏移(微调位置)
|
||||
private readonly Vector2 _fingerOffset = new Vector2(-60, -60);
|
||||
|
||||
// 所有网格圆点实例列表,用于批量改色/清理
|
||||
private List<ArrorPoint> _gridDotList = new List<ArrorPoint>();
|
||||
|
||||
#region 缩放、拖拽、滑动条 全局变量
|
||||
// 缩放阈值(滑动条左右边界对应这两个值)
|
||||
@@ -348,16 +349,16 @@ namespace ChillConnect
|
||||
|
||||
ui.text_level.SetVar("lv", GameHelper.GetLevel().ToString()).FlushVars();
|
||||
|
||||
// 关闭按钮
|
||||
ui.btn_close.SetClick(() => { CtrlCloseUI(); });
|
||||
ui.btn_clear.SetClick(OnClickDeleteItem);
|
||||
ui.btn_hint.SetClick(OnClickHint);
|
||||
// 按钮点击事件绑定
|
||||
OnBtnClickBindEvent();
|
||||
|
||||
|
||||
_fingerTipObj = com_finger.CreateInstance();
|
||||
_viewContainer.AddChild(_fingerTipObj);
|
||||
_fingerTipObj.visible = false;
|
||||
_currentTipArrow = null;
|
||||
|
||||
_zoomSlider = ui.zoomSlide;
|
||||
_zoomSlider = ui.com_bottom.zoomSlide;
|
||||
// 2. 绑定滑动条拖动回调
|
||||
_zoomSlider.onChanged.Add(OnZoomSliderChange);
|
||||
// 3. 容器初始缩放、位置
|
||||
@@ -429,6 +430,24 @@ namespace ChillConnect
|
||||
#endregion
|
||||
|
||||
#region UI相关
|
||||
|
||||
private void OnBtnClickBindEvent()
|
||||
{
|
||||
ui.btn_close.SetClick(CtrlCloseUI);
|
||||
ui.com_bottom.btn_clear.SetClick(OnClickDeleteItem);
|
||||
ui.com_bottom.btn_hint.SetClick(OnClickHint);
|
||||
|
||||
ui.com_bottom.btn_skin.SetClick(() => { uiCtrlDispatcher.Dispatch(UICtrlMsg.ArrowThemeUI_Open); });
|
||||
|
||||
ui.btn_petty.SetClick(() => { uiCtrlDispatcher.Dispatch(UICtrlMsg.PettyAwardUI_Open); });
|
||||
|
||||
ui.btn_signin.SetClick(() => { uiCtrlDispatcher.Dispatch(UICtrlMsg.SignInUI_Open); });
|
||||
|
||||
ui.btn_statement.SetClick(() => { uiCtrlDispatcher.Dispatch(UICtrlMsg.StatementViewUI_Open); });
|
||||
|
||||
ui.btn_saveingpot.SetClick(() => { uiCtrlDispatcher.Dispatch(UICtrlMsg.SaveingPotUI_Open); });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 切换模式 默认黑夜模式
|
||||
/// </summary>
|
||||
@@ -442,8 +461,31 @@ namespace ChillConnect
|
||||
}
|
||||
|
||||
ui.mode.selectedIndex = idx;
|
||||
|
||||
// 同步更新网格圆点颜色
|
||||
bool isDayMode = idx == 1;
|
||||
UpdateGridDotColor(isDayMode);
|
||||
}
|
||||
/// <summary>
|
||||
/// 批量设置网格圆点颜色(随昼夜模式切换)
|
||||
/// </summary>
|
||||
/// <param name="isDay">true=白天模式,false=黑夜模式</param>
|
||||
private void UpdateGridDotColor(bool isDay)
|
||||
{
|
||||
if (_gridDotList == null || _gridDotList.Count == 0)
|
||||
return;
|
||||
|
||||
// 色值映射:白天#2c3a62,黑夜#d4e3f2
|
||||
string colorHex = isDay ? "#2c3a62" : "#d4e3f2";
|
||||
ColorUtility.TryParseHtmlString(colorHex, out Color targetColor);
|
||||
|
||||
foreach (var dot in _gridDotList)
|
||||
{
|
||||
if (dot == null) continue;
|
||||
|
||||
dot.point.color = targetColor;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -642,10 +684,13 @@ namespace ChillConnect
|
||||
var pos = RowColToPos(r, c);
|
||||
dot.SetPosition(pos.x, pos.y, 0);
|
||||
_viewContainer.AddChild(dot);
|
||||
// 加入列表统一管理
|
||||
_gridDotList.Add(dot);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// ========= 新增:网格绘制完成后,设置居中缩放轴心 =========
|
||||
// ========= 网格绘制完成后,设置居中缩放轴心 =========
|
||||
CalculateGridCenter(cfg);
|
||||
SetViewPivotToGridCenter();
|
||||
}
|
||||
@@ -1469,6 +1514,19 @@ namespace ChillConnect
|
||||
private void ClearAllDynamicObj()
|
||||
{
|
||||
if (_levelConfig == null || _viewContainer == null) return;
|
||||
|
||||
// 销毁网格圆点
|
||||
foreach (var dot in _gridDotList)
|
||||
{
|
||||
if (dot != null)
|
||||
{
|
||||
_viewContainer.RemoveChild(dot);
|
||||
dot.Dispose();
|
||||
}
|
||||
}
|
||||
_gridDotList.Clear();
|
||||
|
||||
|
||||
foreach (var arrow in _levelConfig.arrows)
|
||||
{
|
||||
if (arrow.arrowObj != null)
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 19deb03247c2420ea0ea24e4b9078852
|
||||
timeCreated: 1781573811
|
||||
@@ -0,0 +1,41 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class ArrowThemeCtrl : BaseCtrl
|
||||
{
|
||||
public static ArrowThemeCtrl Instance { get; private set; }
|
||||
|
||||
private ArrowThemeModel model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void AddServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void AddListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e50273fc8b5c4fd28617651e820de81c
|
||||
timeCreated: 1781573811
|
||||
@@ -0,0 +1,43 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class ArrowThemeModel : BaseModel
|
||||
{
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
// protected override void OnReset()
|
||||
// {
|
||||
// }
|
||||
// #endregion
|
||||
|
||||
// #region 读取数据
|
||||
// protected override void OnReadData()
|
||||
// {
|
||||
// }
|
||||
// #endregion
|
||||
|
||||
// #region 本地存储
|
||||
// protected override void WriteLocalStorage()
|
||||
// {
|
||||
|
||||
// }
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
protected override void AddListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cf2b28aa9d18433f9e27343cfcab577d
|
||||
timeCreated: 1781573811
|
||||
@@ -0,0 +1,141 @@
|
||||
using System;
|
||||
using FGUI.Arrow_game;
|
||||
using FGUI.Arrow_Theme;
|
||||
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class ArrowThemeUI : BaseUI
|
||||
{
|
||||
private ArrowThemeUICtrl ctrl;
|
||||
private ArrowThemeModel model;
|
||||
private com_theme ui;
|
||||
|
||||
private Action closeCallback;
|
||||
|
||||
|
||||
public ArrowThemeUI(ArrowThemeUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.ArrowThemeUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "Arrow_Theme";
|
||||
uiInfo.assetName = "com_theme";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = true;
|
||||
uiInfo.isNeedCloseAnim = true;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.GameResultModel) as GameResultModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
|
||||
}
|
||||
//
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as com_theme;
|
||||
}
|
||||
private SuccessData successData_;
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
ui.btn_switch.state.selectedIndex = DataMgr.ArrowDarkTheme.Value;
|
||||
SetBtnState();
|
||||
|
||||
ui.btn_dark.SetClick(() => { SetBtnClick(0); });
|
||||
ui.btn_worm.SetClick(() => { SetBtnClick(1); });
|
||||
ui.btn_colours.SetClick(() => { SetBtnClick(2); });
|
||||
|
||||
|
||||
ui.btn_switch.SetClick(() =>
|
||||
{
|
||||
if (DataMgr.ArrowDarkTheme.Value == 0)
|
||||
{
|
||||
DataMgr.ArrowDarkTheme.Value = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
DataMgr.ArrowDarkTheme.Value = 0;
|
||||
}
|
||||
|
||||
ui.btn_switch.state.selectedIndex = DataMgr.ArrowDarkTheme.Value;
|
||||
});
|
||||
|
||||
ui.btn_close.SetClick(() =>
|
||||
{
|
||||
CtrlCloseUI();
|
||||
});
|
||||
}
|
||||
|
||||
private void SetBtnClick(int index)
|
||||
{
|
||||
DataMgr.ArrowTheme.Value = index;
|
||||
SetBtnState();
|
||||
}
|
||||
|
||||
private void SetBtnState()
|
||||
{
|
||||
switch (DataMgr.ArrowTheme.Value)
|
||||
{
|
||||
case 0:
|
||||
((btn_green)ui.btn_dark).touchable = false;
|
||||
((btn_green)ui.btn_worm).touchable = true;
|
||||
((btn_green)ui.btn_colours).touchable = true;
|
||||
((btn_green)ui.btn_dark).state.selectedIndex = 1;
|
||||
((btn_green)ui.btn_worm).state.selectedIndex = 0;
|
||||
((btn_green)ui.btn_colours).state.selectedIndex = 0;
|
||||
break;
|
||||
case 1:
|
||||
((btn_green)ui.btn_dark).touchable = true;
|
||||
((btn_green)ui.btn_worm).touchable = false;
|
||||
((btn_green)ui.btn_colours).touchable = true;
|
||||
((btn_green)ui.btn_dark).state.selectedIndex = 0;
|
||||
((btn_green)ui.btn_worm).state.selectedIndex = 1;
|
||||
((btn_green)ui.btn_colours).state.selectedIndex = 0;
|
||||
break;
|
||||
case 2:
|
||||
((btn_green)ui.btn_dark).touchable = true;
|
||||
((btn_green)ui.btn_worm).touchable = true;
|
||||
((btn_green)ui.btn_colours).touchable = false;
|
||||
((btn_green)ui.btn_dark).state.selectedIndex = 0;
|
||||
((btn_green)ui.btn_worm).state.selectedIndex = 0;
|
||||
((btn_green)ui.btn_colours).state.selectedIndex = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnHide()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDisplay(object args)
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
protected override void AddListener()
|
||||
{
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
private int time_count;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 730d3bd4697242e9a28a7f9b2933bcbb
|
||||
timeCreated: 1781573811
|
||||
@@ -0,0 +1,87 @@
|
||||
using DG.Tweening;
|
||||
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class ArrowThemeUICtrl : BaseUICtrl
|
||||
{
|
||||
private ArrowThemeUI ui;
|
||||
private ArrowThemeModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.ArrowThemeUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.ArrowThemeUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.GameResultModel) as GameResultModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
private object m_data;
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new ArrowThemeUI(this);
|
||||
ui.Open(args);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_data ??= args;
|
||||
}
|
||||
}
|
||||
|
||||
public override void CloseUI(object args = null)
|
||||
{
|
||||
if (ui != null && !ui.isClose)
|
||||
{
|
||||
ui.Close();
|
||||
}
|
||||
ui = null;
|
||||
|
||||
if (m_data != null)
|
||||
{
|
||||
DOVirtual.DelayedCall(0.2f, () =>
|
||||
{
|
||||
OpenUI(m_data);
|
||||
m_data = null;
|
||||
});
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
public override uint GetOpenUIMsg(string uiName)
|
||||
{
|
||||
return openUIMsg;
|
||||
}
|
||||
public override uint GetCloseUIMsg(string uiName)
|
||||
{
|
||||
return closeUIMsg;
|
||||
}
|
||||
|
||||
protected override void AddListener()
|
||||
{
|
||||
uiCtrlDispatcher.AddListener(openUIMsg, OpenUI);
|
||||
uiCtrlDispatcher.AddListener(closeUIMsg, CloseUI);
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
uiCtrlDispatcher.RemoveListener(openUIMsg, OpenUI);
|
||||
uiCtrlDispatcher.RemoveListener(closeUIMsg, CloseUI);
|
||||
}
|
||||
|
||||
protected override void AddServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f49d5a3813264e589acb43f743d50d24
|
||||
timeCreated: 1781573811
|
||||
@@ -599,8 +599,7 @@ namespace ChillConnect
|
||||
});
|
||||
ui.btn_setting.SetClick(() =>
|
||||
{
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PersonViewUI_Open);
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ArrowGameUI_Open);
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PersonViewUI_Open);
|
||||
});
|
||||
}
|
||||
private void OnClickTask(bool isLevel)
|
||||
|
||||
Reference in New Issue
Block a user