fix:1、删除sdk相关。2、添加tips界面,修复bug
This commit is contained in:
@@ -74,6 +74,21 @@ namespace ChillConnect
|
||||
// 所有网格圆点实例列表,用于批量改色/清理
|
||||
private List<ArrorPoint> _gridDotList = new List<ArrorPoint>();
|
||||
|
||||
#region 箭头颜色配置
|
||||
// 8种预设彩色,可按需调整色值
|
||||
private readonly Color[] _colorfulPalette = new Color[]
|
||||
{
|
||||
new Color(1f, 0.3f, 0.3f), // 红
|
||||
new Color(1f, 0.6f, 0.2f), // 橙
|
||||
new Color(1f, 0.9f, 0.2f), // 黄
|
||||
new Color(0.3f, 0.8f, 0.4f), // 绿
|
||||
new Color(0.2f, 0.8f, 0.9f), // 青
|
||||
new Color(0.3f, 0.5f, 1f), // 蓝
|
||||
new Color(0.7f, 0.4f, 1f), // 紫
|
||||
new Color(1f, 0.5f, 0.8f) // 粉
|
||||
};
|
||||
#endregion
|
||||
|
||||
#region 缩放、拖拽、滑动条 全局变量
|
||||
// 缩放阈值(滑动条左右边界对应这两个值)
|
||||
private readonly float _minScale = 0.6f;
|
||||
@@ -257,7 +272,8 @@ namespace ChillConnect
|
||||
else if (InputHelper.Instance.TouchCount == 1)
|
||||
{
|
||||
Touch touch = InputHelper.Instance.GetTouch(0);
|
||||
Vector2 curTouchPos = touch.position;
|
||||
// 触摸坐标和鼠标同属Unity屏幕坐标系,统一转成FGUI坐标系
|
||||
Vector2 curTouchPos = UnityMouseToFGUIPos(touch.position);
|
||||
|
||||
if (touch.phase == TouchPhase.Began)
|
||||
{
|
||||
@@ -327,6 +343,10 @@ namespace ChillConnect
|
||||
GameDispatcher.Instance.AddListener(GameMsg.reset_game, OnRestartGame);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.Update102, SetTopCurr);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.Update101, SetTopCurr);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.ThemeChange, SetModel);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.UpdateSpeed, SetSpeed);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.SetDelete, SetDeleteMode);
|
||||
|
||||
}
|
||||
|
||||
protected override void RemoveListener()
|
||||
@@ -334,6 +354,12 @@ namespace ChillConnect
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.reset_game, OnRestartGame);
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.Update102, SetTopCurr);
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.Update101, SetTopCurr);
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.ThemeChange, SetModel);
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.UpdateSpeed, SetSpeed);
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.SetDelete, SetDeleteMode);
|
||||
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -345,13 +371,18 @@ namespace ChillConnect
|
||||
_isTwoFingerTouch = false;
|
||||
_isDraging = false;
|
||||
|
||||
SetModel();
|
||||
|
||||
ui.text_level.SetVar("lv", GameHelper.GetLevel().ToString()).FlushVars();
|
||||
|
||||
// 按钮点击事件绑定
|
||||
OnBtnClickBindEvent();
|
||||
|
||||
//爱心重新更新显示
|
||||
for (int i = _heartCount; i > 0; i--)
|
||||
{
|
||||
ui.HeartsPanel.GetChild($"xin_{i}").visible = true;
|
||||
}
|
||||
|
||||
|
||||
_fingerTipObj = com_finger.CreateInstance();
|
||||
_viewContainer.AddChild(_fingerTipObj);
|
||||
@@ -401,6 +432,7 @@ namespace ChillConnect
|
||||
|
||||
_initComplete = true;
|
||||
|
||||
SetModel();
|
||||
|
||||
SetTopCurr();
|
||||
|
||||
@@ -437,6 +469,11 @@ namespace ChillConnect
|
||||
ui.com_bottom.btn_clear.SetClick(OnClickDeleteItem);
|
||||
ui.com_bottom.btn_hint.SetClick(OnClickHint);
|
||||
|
||||
ui.com_bottom.btn_setting.SetClick(() =>
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.PersonViewUI_Open, _moveSpeed);
|
||||
});
|
||||
|
||||
ui.com_bottom.btn_skin.SetClick(() => { uiCtrlDispatcher.Dispatch(UICtrlMsg.ArrowThemeUI_Open); });
|
||||
|
||||
ui.btn_petty.SetClick(() => { uiCtrlDispatcher.Dispatch(UICtrlMsg.PettyAwardUI_Open); });
|
||||
@@ -448,35 +485,51 @@ namespace ChillConnect
|
||||
ui.btn_saveingpot.SetClick(() => { uiCtrlDispatcher.Dispatch(UICtrlMsg.SaveingPotUI_Open); });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 切换模式 默认黑夜模式
|
||||
/// </summary>
|
||||
/// <param name="mod">true:白天 false:黑夜</param>
|
||||
private void SetModel(object mod = null)
|
||||
{
|
||||
int idx = 0;
|
||||
if (mod != null)
|
||||
{
|
||||
idx = (bool)mod? 1 : 0;
|
||||
}
|
||||
|
||||
ui.mode.selectedIndex = idx;
|
||||
|
||||
// 同步更新网格圆点颜色
|
||||
bool isDayMode = idx == 1;
|
||||
UpdateGridDotColor(isDayMode);
|
||||
// 缓存上一次箭头主题,用于判断是否需要重新随机彩色
|
||||
private int _lastArrowTheme = -1;
|
||||
/// <summary>
|
||||
/// 主题变更统一回调(昼夜/箭头主题切换都会触发)
|
||||
/// </summary>
|
||||
private void SetModel(object a = null)
|
||||
{
|
||||
int darkThemeIdx = DataMgr.ArrowDarkTheme.Value;
|
||||
int currentArrowTheme = DataMgr.ArrowTheme.Value;
|
||||
|
||||
ui.mode.selectedIndex = darkThemeIdx;
|
||||
|
||||
// 1. 更新网格圆点昼夜配色
|
||||
bool isDarkMode = darkThemeIdx == 0; // 0=黑夜
|
||||
Debug.Log($"ArrowDarkTheme==={darkThemeIdx}");
|
||||
UpdateGridDotColor(isDarkMode);
|
||||
|
||||
// 2. 判断是否需要重新随机彩色:只有从非彩色切到彩色时才刷新
|
||||
bool forceRandomColorful = currentArrowTheme == 2 && _lastArrowTheme != currentArrowTheme;
|
||||
|
||||
// 3. 更新所有箭头颜色
|
||||
UpdateAllArrowsColor(forceRandomColorful);
|
||||
|
||||
// 4. 更新缓存,用于下次对比
|
||||
_lastArrowTheme = currentArrowTheme;
|
||||
|
||||
Debug.Log($"主题刷新完成:昼夜={darkThemeIdx},箭头主题={currentArrowTheme}");
|
||||
}
|
||||
/// <summary>
|
||||
/// 批量设置网格圆点颜色(随昼夜模式切换)
|
||||
/// // 色值映射:白天#2c3a62,黑夜#d4e3f2
|
||||
/// </summary>
|
||||
/// <param name="isDay">true=白天模式,false=黑夜模式</param>
|
||||
/// <param name="isDay">true=黑夜模式,false=白天模式</param>
|
||||
|
||||
private string DarkColor = "#d4e3f2";
|
||||
private string LightColor = "#2c3a62";
|
||||
private void UpdateGridDotColor(bool isDay)
|
||||
{
|
||||
if (_gridDotList == null || _gridDotList.Count == 0)
|
||||
return;
|
||||
|
||||
// 色值映射:白天#2c3a62,黑夜#d4e3f2
|
||||
string colorHex = isDay ? "#2c3a62" : "#d4e3f2";
|
||||
|
||||
Debug.Log($"isDay=========={isDay}");
|
||||
string colorHex = isDay ? DarkColor : LightColor;
|
||||
ColorUtility.TryParseHtmlString(colorHex, out Color targetColor);
|
||||
|
||||
foreach (var dot in _gridDotList)
|
||||
@@ -486,6 +539,77 @@ namespace ChillConnect
|
||||
dot.point.color = targetColor;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据当前主题,为单个箭头生成对应颜色
|
||||
/// </summary>
|
||||
/// <param name="arrow">箭头配置对象</param>
|
||||
/// <param name="isRandomNew">彩色模式下是否重新随机颜色</param>
|
||||
private Color GetArrowRuntimeColor(ArrowConfig arrow, bool isRandomNew = false)
|
||||
{
|
||||
int themeType = DataMgr.ArrowTheme.Value;
|
||||
|
||||
// 0 = 纯色模式(黑色按钮):白天黑、黑夜白
|
||||
if (themeType == 0)
|
||||
{
|
||||
bool isDark = DataMgr.ArrowDarkTheme.Value == 0; // 0=黑夜
|
||||
return isDark ? Color.white : Color.black;
|
||||
}
|
||||
// 2 = 彩色随机模式
|
||||
else if (themeType == 2)
|
||||
{
|
||||
if (isRandomNew || arrow.runtimeColor == default)
|
||||
{
|
||||
int randomIndex = Random.Range(0, _colorfulPalette.Length);
|
||||
arrow.runtimeColor = _colorfulPalette[randomIndex];
|
||||
}
|
||||
return arrow.runtimeColor;
|
||||
}
|
||||
|
||||
// 兜底默认黑色
|
||||
return Color.black;
|
||||
}
|
||||
|
||||
/// 批量更新场上所有箭头的颜色(线条+单箭头)
|
||||
/// </summary>
|
||||
/// <param name="forceRandomColorful">彩色模式下是否强制重新随机</param>
|
||||
private void UpdateAllArrowsColor(bool forceRandomColorful = false)
|
||||
{
|
||||
if (_levelConfig == null || _levelConfig.arrows == null)
|
||||
return;
|
||||
|
||||
int themeType = DataMgr.ArrowTheme.Value;
|
||||
bool isColorfulMode = themeType == 2;
|
||||
|
||||
foreach (var arrow in _levelConfig.arrows)
|
||||
{
|
||||
// 只有强制刷新时,彩色模式才重新随机颜色
|
||||
bool isRandomNew = isColorfulMode && forceRandomColorful;
|
||||
Color targetColor = GetArrowRuntimeColor(arrow, isRandomNew);
|
||||
|
||||
// 更新线条颜色
|
||||
if (arrow.lineUnits != null)
|
||||
{
|
||||
foreach (var line in arrow.lineUnits)
|
||||
{
|
||||
if (line != null)
|
||||
{
|
||||
line.GetChild("line").asGraph.color = targetColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 更新单箭头颜色
|
||||
if (arrow.arrowObj != null)
|
||||
{
|
||||
GImage icon = arrow.arrowObj.GetChild("icon").asImage;
|
||||
if (icon != null)
|
||||
{
|
||||
icon.color = targetColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -583,8 +707,29 @@ namespace ChillConnect
|
||||
public static void InitAllLevelData()
|
||||
{
|
||||
string path = Path.Combine(Application.streamingAssetsPath, "all_levels.json");
|
||||
#if UNITY_ANDROID && !UNITY_EDITOR
|
||||
// Android 平台需要使用 UnityWebRequest 读取 StreamingAssets
|
||||
using (UnityEngine.Networking.UnityWebRequest www = UnityEngine.Networking.UnityWebRequest.Get(path))
|
||||
{
|
||||
www.SendWebRequest();
|
||||
while (!www.isDone) { }
|
||||
|
||||
if (www.result == UnityEngine.Networking.UnityWebRequest.Result.Success)
|
||||
{
|
||||
string json = www.downloadHandler.text;
|
||||
_allLevelData = JsonUtility.FromJson<AllLevelRoot>(json);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError($"Failed to load all_levels.json: {www.error}");
|
||||
}
|
||||
}
|
||||
#else
|
||||
// Editor 和其他平台直接读取
|
||||
string json = File.ReadAllText(path);
|
||||
_allLevelData = JsonUtility.FromJson<AllLevelRoot>(json);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
public static LevelConfig LoadLevelById(int targetLevelId)
|
||||
@@ -835,12 +980,13 @@ namespace ChillConnect
|
||||
if (tilePositions.Count > 0)
|
||||
tilePositions.RemoveAt(tilePositions.Count - 1);
|
||||
|
||||
ColorUtility.TryParseHtmlString(arrow.color, out Color lineColor);
|
||||
for (int i = 0; i < tilePositions.Count; i++)
|
||||
{
|
||||
Vector2 pos = tilePositions[i];
|
||||
LineTile unit = LineTile.CreateInstance();
|
||||
unit.SetPosition(pos.x, pos.y, 0);
|
||||
// 运行时主题取色
|
||||
Color lineColor = GetArrowRuntimeColor(arrow);
|
||||
unit.GetChild("line").asGraph.color = lineColor;
|
||||
unit.visible = true;
|
||||
unit.touchable = true;
|
||||
@@ -859,8 +1005,7 @@ namespace ChillConnect
|
||||
|
||||
|
||||
|
||||
// 在 CreateArrowAndLines 方法最后,补充这段初始化代码
|
||||
// ========== 新增:初始化距离偏移 ==========
|
||||
// ========== 初始化距离偏移 ==========
|
||||
arrow.movedDistance = 0f;
|
||||
// 轨迹总长度 = (点数-1) * 点间距
|
||||
arrow.trackTotalLength = (arrow.totalTrack.Count - 1) * 10f;
|
||||
@@ -878,21 +1023,27 @@ namespace ChillConnect
|
||||
|
||||
|
||||
#region 道具(删除和提示)
|
||||
private void SetDeleteMode(object a)
|
||||
{
|
||||
_isDeleteMode = !_isDeleteMode;
|
||||
}
|
||||
/// <summary>点击删除道具,开启/关闭删除模式</summary>
|
||||
private void OnClickDeleteItem()
|
||||
{
|
||||
_isDeleteMode = !_isDeleteMode;
|
||||
// _isDeleteMode = !_isDeleteMode;
|
||||
|
||||
// 可选:加提示,区分状态
|
||||
if (_isDeleteMode)
|
||||
{
|
||||
Debug.Log("已开启删除模式,点击箭头即可删除");
|
||||
// 可加UI提示:如图标高亮、文字提示
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("已关闭删除模式");
|
||||
}
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ArrowTipsUI_Open);
|
||||
|
||||
// // 可选:加提示,区分状态
|
||||
// if (_isDeleteMode)
|
||||
// {
|
||||
// Debug.Log("已开启删除模式,点击箭头即可删除");
|
||||
// // 可加UI提示:如图标高亮、文字提示
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Debug.Log("已关闭删除模式");
|
||||
// }
|
||||
}
|
||||
|
||||
private void OnClickHint()
|
||||
@@ -1219,7 +1370,8 @@ namespace ChillConnect
|
||||
arrowIns.rotation = DirToRotation(arrow.defaultDir);
|
||||
}
|
||||
|
||||
ColorUtility.TryParseHtmlString(arrow.color, out Color arrowColor);
|
||||
// 运行时主题取色
|
||||
Color arrowColor = GetArrowRuntimeColor(arrow);
|
||||
GImage icon = arrowIns.GetChild("icon").asImage;
|
||||
if (icon != null) icon.color = arrowColor;
|
||||
|
||||
@@ -1302,8 +1454,17 @@ namespace ChillConnect
|
||||
RunCoroutine(MoveAndDisappearCoroutine(arrow));
|
||||
}
|
||||
|
||||
|
||||
private void SetSpeed(object a = null)
|
||||
{
|
||||
if (a != null)
|
||||
{
|
||||
_moveSpeed = (float)a;
|
||||
}
|
||||
}
|
||||
|
||||
// 新增:统一移动速度(像素/秒),数值越大移动越快,可自由修改
|
||||
[SerializeField] private float _moveSpeed = 800f;
|
||||
[SerializeField] private float _moveSpeed = 1500f;
|
||||
|
||||
private IEnumerator MoveAndDisappearCoroutine(ArrowConfig arrow)
|
||||
{
|
||||
@@ -1467,7 +1628,7 @@ namespace ChillConnect
|
||||
temp.IsLevelSuccess = false;
|
||||
temp.IsH5Reward = false;
|
||||
temp.boost_array = GameHelper.GetRewardBoost(1);
|
||||
DOVirtual.DelayedCall(0.55f, () =>
|
||||
DOVirtual.DelayedCall(0.25f, () =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.LevelSuccessUI_Open, temp);
|
||||
});
|
||||
@@ -1575,7 +1736,7 @@ namespace ChillConnect
|
||||
temp.IsLevelSuccess = true;
|
||||
temp.IsH5Reward = false;
|
||||
temp.boost_array = GameHelper.GetRewardBoost(2);
|
||||
DOVirtual.DelayedCall(0.5f, () =>
|
||||
DOVirtual.DelayedCall(0.2f, () =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.LevelSuccessUI_Open, temp);
|
||||
});
|
||||
@@ -1591,7 +1752,7 @@ namespace ChillConnect
|
||||
temp.IsLevelSuccess = true;
|
||||
temp.IsH5Reward = false;
|
||||
temp.boost_array = GameHelper.GetRewardBoost(2);
|
||||
DOVirtual.DelayedCall(0.5f, () =>
|
||||
DOVirtual.DelayedCall(0.2f, () =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.LevelSuccessUI_Open, temp);
|
||||
});
|
||||
@@ -1677,11 +1838,13 @@ namespace ChillConnect
|
||||
public int arrowTrackIndex;
|
||||
public string finalMoveDir;
|
||||
|
||||
// ========== 新增:距离驱动移动所需字段 ==========
|
||||
// ========== 距离驱动移动所需字段 ==========
|
||||
public float movedDistance; // 当前整体累计移动距离
|
||||
public float trackTotalLength; // 整条轨迹的总像素长度
|
||||
public List<float> lineInitOffsets; // 每个线条单元的初始距离偏移
|
||||
public float arrowInitOffset; // 箭头的初始距离偏移
|
||||
// ========== 运行时颜色缓存 ==========
|
||||
public Color runtimeColor;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace ChillConnect
|
||||
SetBtnState();
|
||||
|
||||
ui.btn_dark.SetClick(() => { SetBtnClick(0); });
|
||||
ui.btn_worm.SetClick(() => { SetBtnClick(1); });
|
||||
// ui.btn_worm.SetClick(() => { SetBtnClick(1); });
|
||||
ui.btn_colours.SetClick(() => { SetBtnClick(2); });
|
||||
|
||||
|
||||
@@ -69,6 +69,9 @@ namespace ChillConnect
|
||||
}
|
||||
|
||||
ui.btn_switch.state.selectedIndex = DataMgr.ArrowDarkTheme.Value;
|
||||
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.ThemeChange);
|
||||
|
||||
});
|
||||
|
||||
ui.btn_close.SetClick(() =>
|
||||
@@ -81,6 +84,8 @@ namespace ChillConnect
|
||||
{
|
||||
DataMgr.ArrowTheme.Value = index;
|
||||
SetBtnState();
|
||||
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.ThemeChange);
|
||||
}
|
||||
|
||||
private void SetBtnState()
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 43952a38995845739a7519afd4bb7d1c
|
||||
timeCreated: 1781677288
|
||||
@@ -0,0 +1,19 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class ArrowTipsCtrl : BaseCtrl
|
||||
{
|
||||
public static ArrowTipsCtrl Instance { get; private set; }
|
||||
|
||||
private ArrowTipsModel model;
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d070658caacf42a79ba55d6ac90d78a6
|
||||
timeCreated: 1781677288
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class ArrowTipsModel : BaseModel
|
||||
{
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4051b0d4995a4a1399d64e95c6c582f1
|
||||
timeCreated: 1781677288
|
||||
@@ -0,0 +1,76 @@
|
||||
using System;
|
||||
using FGUI.Arrow_game;
|
||||
|
||||
namespace ChillConnect
|
||||
{
|
||||
|
||||
public class ArrowTipsUI : BaseUI
|
||||
{
|
||||
private ArrowTipsUICtrl ctrl;
|
||||
private ArrowTipsModel model;
|
||||
private com_tips ui;
|
||||
|
||||
public ArrowTipsUI(ArrowTipsUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.ArrowTipsUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "Arrow_game";
|
||||
uiInfo.assetName = "com_tips";
|
||||
uiInfo.layerType = UILayerType.Loading;
|
||||
}
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
CommonHelper.FadeOut(ui);
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as com_tips;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
InitView();
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
CommonHelper.FadeIn(ui);
|
||||
}
|
||||
|
||||
protected override void AddListener()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
}
|
||||
|
||||
private void InitView()
|
||||
{
|
||||
|
||||
ui.btn_watch.SetClick(() =>
|
||||
{
|
||||
GameHelper.ShowVideoAd("deletePop", isSuccess =>
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.SetDelete);
|
||||
CtrlCloseUI();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
ui.btn_close.SetClick(CtrlCloseUI);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4737faa4124f48fabc5ef35ef2ff9f2f
|
||||
timeCreated: 1781677288
|
||||
@@ -0,0 +1,60 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class ArrowTipsUICtrl : BaseUICtrl
|
||||
{
|
||||
private ArrowTipsUI ui;
|
||||
private ArrowTipsModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.ArrowTipsUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.ArrowTipsUI_Close;
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new ArrowTipsUI(this);
|
||||
ui.Open(args);
|
||||
}
|
||||
}
|
||||
|
||||
public override void CloseUI(object args = null)
|
||||
{
|
||||
if (ui != null && !ui.isClose)
|
||||
{
|
||||
ui.Close();
|
||||
}
|
||||
|
||||
ui = null;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5e1a6be77c1c462a86ed773072d923d3
|
||||
timeCreated: 1781677288
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using DG.Tweening;
|
||||
using FGUI.GameResult_08;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -49,9 +50,27 @@ namespace ChillConnect
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
|
||||
ui.btn_revive.SetClick(() =>
|
||||
{
|
||||
float[] cash_array = GameHelper.GetRewardValue(2);
|
||||
|
||||
var temp = new SuccessData();
|
||||
temp.IsWin = false;
|
||||
temp.cash_number = cash_array[0];
|
||||
temp.IsLevelSuccess = true;
|
||||
temp.IsH5Reward = false;
|
||||
temp.boost_array = GameHelper.GetRewardBoost(2);
|
||||
DOVirtual.DelayedCall(0.1f, () =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.LevelSuccessUI_Open, temp);
|
||||
});
|
||||
CtrlCloseUI();
|
||||
});
|
||||
|
||||
ui.btn_restart.SetClick(() =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.LevelSuccessUI_Open, args);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.reset_game, false);
|
||||
CtrlCloseUI();
|
||||
|
||||
});
|
||||
|
||||
@@ -323,7 +323,10 @@ namespace ChillConnect
|
||||
|
||||
DOVirtual.DelayedCall(0.7f, () =>
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.reset_game, false);
|
||||
if (IsLevelSuccess)
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.reset_game, false);
|
||||
}
|
||||
|
||||
CtrlCloseUI();
|
||||
// if (IsLevelSuccess) UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.OpenGameUI_Open, true);
|
||||
|
||||
@@ -38,8 +38,7 @@ namespace ChillConnect
|
||||
protected override void OnClose()
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.showBroadCast);
|
||||
WebviewManager.Instance.setInH5View(false);
|
||||
WebviewManager.Instance.ShowH5View(false);
|
||||
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
@@ -50,11 +49,11 @@ namespace ChillConnect
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
|
||||
WebviewManager.Instance.setInH5View(true);
|
||||
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.hideBroadCast);
|
||||
// delayedCall = DOVirtual.DelayedCall(0.3f, () =>
|
||||
// {
|
||||
WebviewManager.Instance.ShowH5View(true);
|
||||
|
||||
|
||||
ui.btn_close.SetClick(() =>
|
||||
{
|
||||
|
||||
@@ -55,7 +55,6 @@ namespace ChillConnect
|
||||
|
||||
GameHelper.showGameUI = true;
|
||||
// WebviewManager.ShezhiACT(true);
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
|
||||
gameDispatcher.Dispatch(GameMsg.MakeUpConfirmUIClosed);
|
||||
|
||||
@@ -88,7 +87,6 @@ namespace ChillConnect
|
||||
DataMgr.MakeupTaskH5Time.Value = 999999999;
|
||||
// DataMgr.Ticket.Value = 999999999; //zhushi
|
||||
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
// WebviewManager.ShezhiACT(false);
|
||||
|
||||
makeupTaskData = args as MakeupTaskData;
|
||||
|
||||
@@ -45,7 +45,6 @@ namespace ChillConnect
|
||||
protected override void OnClose()
|
||||
{
|
||||
CommonHelper.FadeOut(ui);
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
@@ -67,7 +66,6 @@ namespace ChillConnect
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
CommonHelper.FadeIn(ui);
|
||||
|
||||
// if (args != null)
|
||||
|
||||
@@ -45,7 +45,6 @@ namespace ChillConnect
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
GameHelper.showGameUI = true;
|
||||
HallManager.Instance.UpdateSecondEvent -= upData;
|
||||
|
||||
@@ -58,7 +57,6 @@ namespace ChillConnect
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
if (Screen.safeArea.y != 0)
|
||||
{
|
||||
// ui.bg.y += 68;
|
||||
|
||||
@@ -46,7 +46,6 @@ namespace ChillConnect
|
||||
protected override void OnClose()
|
||||
{
|
||||
// WebviewManager.ShezhiACT(true);
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
@@ -64,13 +63,23 @@ namespace ChillConnect
|
||||
// WebviewManager.ShezhiACT(false);
|
||||
_selectIndex = DataMgr.PlayerAvatarId.Value;
|
||||
|
||||
GetSliderValueByScale((float)args);
|
||||
|
||||
InitView();
|
||||
}
|
||||
|
||||
private void GetSliderValueByScale(float speed)
|
||||
{
|
||||
float validScale = Mathf.Clamp(speed, 1200f, 1700f);
|
||||
float ratio = (validScale - 1200f) / (1700f - 1200f);
|
||||
float sliderVal = ratio * 100f;
|
||||
|
||||
ui.speed_slide.value = Mathf.Clamp(sliderVal, 0f, 100f);
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
// CommonHelper.FadeIn(ui);
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
ui.show.Play();
|
||||
}
|
||||
|
||||
@@ -109,14 +118,24 @@ namespace ChillConnect
|
||||
|
||||
ui.btn_privacy.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PrivacyUI_Open, 0); });
|
||||
ui.btn_terms.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PrivacyUI_Open, 1); });
|
||||
ui.btn_official.SetClick(() => { OpenBrowser.OpenURL("http://captainsroll.com/"); });
|
||||
ui.btn_official.SetClick(() => { Application.OpenURL("http://captainsroll.com/"); });
|
||||
|
||||
ui.btn_us.SetClick(() => { GameHelper.OpenEmail(); });
|
||||
|
||||
ui.btn_revive.SetClick(() =>
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.reset_game, false);
|
||||
CtrlCloseUI();
|
||||
});
|
||||
|
||||
ui.level_text.SetVar("lv",GameHelper.GetLevel().ToString()).FlushVars();
|
||||
|
||||
ui.speed_slide.onChanged.Add(SetSlideValue);
|
||||
|
||||
ui.btn_music.on_off.selectedIndex =
|
||||
model.IsOpenMusic ? btn_music_on_off.On_off_off : btn_music_on_off.On_off_on;
|
||||
model.IsOpenMusic ? 0 : 1;
|
||||
ui.btn_sound.on_off.selectedIndex =
|
||||
GRoot.inst.soundVolume > 0 ? btn_music_on_off.On_off_off : btn_music_on_off.On_off_on;
|
||||
GRoot.inst.soundVolume > 0 ? 0 : 1;
|
||||
|
||||
ui.btn_music.SetClick(SetMusic);
|
||||
ui.btn_sound.SetClick(SetSound);
|
||||
@@ -155,6 +174,22 @@ namespace ChillConnect
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private void SetSlideValue()
|
||||
{
|
||||
var sliderValue = (float)ui.speed_slide.value;
|
||||
// 先把滑块值钳位在 0~100 内
|
||||
float val = Mathf.Clamp(sliderValue, 0f, 100f);
|
||||
|
||||
// 线性映射:0→0.6,100→1.5
|
||||
float ratio = val / 100f;
|
||||
float speed = 1200f + ratio * (1700f - 1200f);
|
||||
|
||||
|
||||
speed = Mathf.Clamp(speed, 1200f, 1700f);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.UpdateSpeed, speed);
|
||||
}
|
||||
|
||||
|
||||
private void UpdateItem(int index, GObject items)
|
||||
{
|
||||
@@ -191,8 +226,8 @@ namespace ChillConnect
|
||||
model.IsOpenMusic = !model.IsOpenMusic;
|
||||
|
||||
ui.btn_music.on_off.selectedIndex = model.IsOpenMusic
|
||||
? btn_music_on_off.On_off_off
|
||||
: btn_music_on_off.On_off_on;
|
||||
? 0
|
||||
: 1;
|
||||
|
||||
|
||||
}
|
||||
@@ -205,8 +240,8 @@ namespace ChillConnect
|
||||
GRoot.inst.soundVolume = sound;
|
||||
PlayerPrefs.SetFloat("soundVolume", sound);
|
||||
ui.btn_sound.on_off.selectedIndex = sound > 0
|
||||
? btn_music_on_off.On_off_off
|
||||
: btn_music_on_off.On_off_on;
|
||||
? 0
|
||||
: 1;
|
||||
}
|
||||
private void SetVersion()
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using AppsFlyerSDK;
|
||||
// using AppsFlyerSDK;
|
||||
using IgnoreOPS;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -230,17 +230,17 @@ namespace ChillConnect
|
||||
|
||||
if (!GameHelper.IsAdModelOfPay() && !string.IsNullOrEmpty(purch_number) && decimal.TryParse(purch_number, out decimal revenue))
|
||||
{
|
||||
Debug.Log("付费收益上报AF----------- " + revenue);
|
||||
adCallbackInfo.Clear();
|
||||
adCallbackInfo.Add("appsflyer_id", AppsFlyer.getAppsFlyerId());
|
||||
adCallbackInfo.Add("customer_user_id", GameHelper.GetLoginModel().Uid.ToString());
|
||||
adCallbackInfo.Add("af_currency", "USD");
|
||||
adCallbackInfo.Add("af_revenue", revenue.ToString(CultureInfo.InvariantCulture));
|
||||
AppsFlyer.sendEvent("af_purchase", adCallbackInfo);
|
||||
|
||||
GameHelper.SendRevenueToServer(Property.Af_purchase, "af_revenue", (int)(revenue * 10000));
|
||||
|
||||
RankSystemMgr.Instance.addGameExp(addPointType.buy, revenue);
|
||||
// Debug.Log("付费收益上报AF----------- " + revenue);
|
||||
// adCallbackInfo.Clear();
|
||||
// adCallbackInfo.Add("appsflyer_id", AppsFlyer.getAppsFlyerId());
|
||||
// adCallbackInfo.Add("customer_user_id", GameHelper.GetLoginModel().Uid.ToString());
|
||||
// adCallbackInfo.Add("af_currency", "USD");
|
||||
// adCallbackInfo.Add("af_revenue", revenue.ToString(CultureInfo.InvariantCulture));
|
||||
// AppsFlyer.sendEvent("af_purchase", adCallbackInfo);
|
||||
//
|
||||
// GameHelper.SendRevenueToServer(Property.Af_purchase, "af_revenue", (int)(revenue * 10000));
|
||||
//
|
||||
// RankSystemMgr.Instance.addGameExp(addPointType.buy, revenue);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,6 @@ namespace ChillConnect
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
HallManager.Instance.UpdateSecondEvent -= upTime;
|
||||
|
||||
RankSystemMgr.Instance.upRewardAndRank();
|
||||
@@ -72,7 +71,6 @@ namespace ChillConnect
|
||||
{
|
||||
ui.group_top.y += 68;
|
||||
}
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
TrackKit.SendEvent(Property.rank_Event,Property.RankShow);
|
||||
|
||||
HallManager.Instance.UpdateSecondEvent += upTime;
|
||||
|
||||
@@ -47,7 +47,6 @@ namespace ChillConnect
|
||||
protected override void OnClose()
|
||||
{
|
||||
AdRedeemManager.Instance.Destroy();
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
@@ -61,7 +60,6 @@ namespace ChillConnect
|
||||
{
|
||||
ui.group_top.y += 68;
|
||||
}
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
rewardList = SaveData.GetRankData().rankRewardData;
|
||||
InitView();
|
||||
|
||||
|
||||
@@ -55,7 +55,6 @@ namespace ChillConnect
|
||||
HallManager.Instance.UpdateSecondEvent -= Update;
|
||||
closeCallback?.Invoke();
|
||||
// WebviewManager.ShezhiACT(true);
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.RefreshSaveingPot);
|
||||
|
||||
@@ -78,7 +77,6 @@ namespace ChillConnect
|
||||
}
|
||||
|
||||
// WebviewManager.ShezhiACT(false);
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.BuygoldUI_Close);
|
||||
|
||||
|
||||
@@ -45,7 +45,6 @@ namespace ChillConnect
|
||||
protected override void OnClose()
|
||||
{
|
||||
AdRedeemManager.Instance.Destroy();
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
GameHelper.showGameUI = true;
|
||||
HallManager.Instance.UpdateSecondEvent -= initList;
|
||||
HallManager.Instance.UpdateSecondEvent -= upWatchAdsBtn;
|
||||
@@ -78,7 +77,6 @@ namespace ChillConnect
|
||||
{
|
||||
isAutoPop = (bool)args;
|
||||
}
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
// test
|
||||
// SaveData.GetSaveObject().remove_ad_time = Convert.ToInt32(GameHelper.GetNowTime()) + 5;
|
||||
// SaveData.GetSaveObject().is_get_removead = true;
|
||||
|
||||
Reference in New Issue
Block a user