fix:1、添加arrow的游戏代码,和相关的周边功能
This commit is contained in:
@@ -55,7 +55,7 @@ namespace RedHotRoast
|
||||
{
|
||||
TrackKit.SendEvent(GameHelper.GetEventName(), ADEventTrack.Property.buy_one_show);
|
||||
if (args != null) need_call = (bool)args;
|
||||
// ad_cool_down = ConfigSystem.GetConfig<CommonModel>().exchangeCD;
|
||||
// ad_cool_down = ConfigSystem.GetCommonConf().exchangeCD;
|
||||
// btn_WatchAd = ui.btn_watch as btn_watchAd;
|
||||
if (GameHelper.IsAdModelOfPay())
|
||||
{
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4ad5fece43d34a4abe58ce53bcb2aacc
|
||||
timeCreated: 1783663847
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class MainTabCtrl : BaseCtrl
|
||||
public class ArrowGameCtrl : BaseCtrl
|
||||
{
|
||||
public static MainTabCtrl Instance { get; private set; }
|
||||
public static ArrowGameCtrl Instance { get; private set; }
|
||||
|
||||
private MainTabModel model;
|
||||
private ArrowGameModel model;
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0dfe8f46fa1e414b944056bbe769fa67
|
||||
timeCreated: 1781178068
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class ArrowGameModel : BaseModel
|
||||
{
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e6e908da0a114c6aab92325f6c42619d
|
||||
timeCreated: 1781178068
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1a4af5e7d0ee45ed84096f4ea23331c2
|
||||
timeCreated: 1781178068
|
||||
@@ -0,0 +1,91 @@
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class ArrowGameUICtrl : BaseUICtrl
|
||||
{
|
||||
private ArrowGameUI ui;
|
||||
private ArrowGameModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.ArrowGameUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.ArrowGameUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.ArrowGameModel) as ArrowGameModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new ArrowGameUI(this);
|
||||
ui.Open(args);
|
||||
}
|
||||
}
|
||||
|
||||
public override void CloseUI(object args = null)
|
||||
{
|
||||
if (ui != null && !ui.isClose)
|
||||
{
|
||||
ui.Close();
|
||||
}
|
||||
ui = 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);
|
||||
|
||||
GameDispatcher.Instance.AddListener(GameMsg.Update101, OnUpdate101);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.Update102, OnUpdate102);
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
uiCtrlDispatcher.RemoveListener(openUIMsg, OpenUI);
|
||||
uiCtrlDispatcher.RemoveListener(closeUIMsg, CloseUI);
|
||||
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.Update101, OnUpdate101);
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.Update102, OnUpdate102);
|
||||
|
||||
}
|
||||
|
||||
private void OnUpdate101(object obj)
|
||||
{
|
||||
ui?.OnUpdate101(obj);
|
||||
}
|
||||
|
||||
|
||||
private void OnUpdate102(object obj)
|
||||
{
|
||||
ui?.OnUpdate102(obj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected override void AddServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 74f557b8baf9421bb8cc5c01adcd09b3
|
||||
timeCreated: 1781178068
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2d45a99956a41ec4c9d004c296c6257c
|
||||
guid: 190b796dd1421454494f5be3c67c35d3
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
@@ -0,0 +1,50 @@
|
||||
|
||||
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class ArrowSettingCtrl : BaseCtrl
|
||||
{
|
||||
public static ArrowSettingCtrl Instance { get; private set; }
|
||||
|
||||
private ArrowSettingModel model;
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
|
||||
protected override void AddListener()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void AddServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void RemoveServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a719660d4b2e0254583b70941f0eede5
|
||||
timeCreated: 1676360266
|
||||
@@ -0,0 +1,69 @@
|
||||
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class ArrowSettingModel : BaseModel
|
||||
{
|
||||
public bool IsOpenMusic
|
||||
{
|
||||
get { return AudioManager.Instance.IsOpenBGM; }
|
||||
set { AudioManager.Instance.IsOpenBGM = value; }
|
||||
}
|
||||
|
||||
public bool IsOpenEffect
|
||||
{
|
||||
get { return AudioManager.Instance.IsOpenEffect; }
|
||||
set { AudioManager.Instance.IsOpenEffect = value; }
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
|
||||
|
||||
public string LangIdKey = "LangIdKey";
|
||||
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: 9bbfb75ed03e0fc43a081b175504f450
|
||||
timeCreated: 1676360266
|
||||
@@ -0,0 +1,256 @@
|
||||
using IgnoreOPS;
|
||||
using FairyGUI;
|
||||
using FGUI.ZM_Setting_07;
|
||||
using IgnoreOPS;
|
||||
using UnityEngine;
|
||||
using btn_head = FGUI.ZM_Common_01.btn_head;
|
||||
|
||||
// using FGUI.G006_menu;
|
||||
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class ArrowSettingUI : BaseUI
|
||||
{
|
||||
private ArrowSettingUICtrl ctrl;
|
||||
private ArrowSettingModel model;
|
||||
private int _selectIndex = -1;
|
||||
|
||||
private const int TotalItem = 8;
|
||||
|
||||
private com_arrow_setting ui;
|
||||
|
||||
public ArrowSettingUI(ArrowSettingUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.ArrowSettingUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "ZM_Setting_07";
|
||||
uiInfo.assetName = "com_arrow_setting";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
model = moduleManager.GetModel(ModelConst.ArrowSettingModel) as ArrowSettingModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
// WebviewManager.ShezhiACT(true);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, true);
|
||||
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as com_arrow_setting;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, false);
|
||||
|
||||
// if (Screen.safeArea.y != 0)
|
||||
// {
|
||||
// ui.title.y += Screen.safeArea.y;
|
||||
// }
|
||||
// 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);
|
||||
ui.show.Play();
|
||||
}
|
||||
|
||||
protected override void OnHide()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDisplay(object args)
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
|
||||
protected override void AddListener()
|
||||
{
|
||||
HallManager.Instance.AddChangeGiftSwitch(InitView);
|
||||
}
|
||||
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
HallManager.Instance.RemoveChangeGiftSwitch(InitView);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void InitView()
|
||||
{
|
||||
SetVersion();
|
||||
SetUID();
|
||||
|
||||
var namStr = GameHelper.GetUserName();
|
||||
ui.edit_name.input.text = namStr;
|
||||
|
||||
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_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 ? 0 : 1;
|
||||
ui.btn_sound.on_off.selectedIndex =
|
||||
GRoot.inst.soundVolume > 0 ? 0 : 1;
|
||||
|
||||
ui.btn_music.SetClick(SetMusic);
|
||||
ui.btn_sound.SetClick(SetSound);
|
||||
|
||||
ui.btn_close.SetClick(() =>
|
||||
{
|
||||
ui.hide.Play(UpdateUserInfo);
|
||||
|
||||
});
|
||||
if (GameHelper.IsGiftSwitch())
|
||||
{
|
||||
// ui.btn_restore.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.btn_us.visible = true;
|
||||
}
|
||||
ui.btn_restore.SetClick(() =>
|
||||
{
|
||||
// ApplePayManager.Instance.AppleRestore((success, message) =>
|
||||
// {
|
||||
// if (success)
|
||||
// {
|
||||
// GameHelper.ShowTips("Restore Purchases Success!");
|
||||
// // SaveData.GetSaveObject().is_get_packreward = success;
|
||||
// SaveData.GetSaveObject().have_slot = success;
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.noads_refresh);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // Debug.Log("[barry] restore failed: " + success);
|
||||
// GameHelper.ShowTips("There are no recoverable transactions");
|
||||
// }
|
||||
// });
|
||||
});
|
||||
}
|
||||
|
||||
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 SetMusic()
|
||||
{
|
||||
model.IsOpenMusic = !model.IsOpenMusic;
|
||||
|
||||
ui.btn_music.on_off.selectedIndex = model.IsOpenMusic
|
||||
? 0
|
||||
: 1;
|
||||
}
|
||||
|
||||
private void SetSound()
|
||||
{
|
||||
var sound = GRoot.inst.soundVolume;
|
||||
sound = sound > 0 ? 0 : 1;
|
||||
|
||||
GRoot.inst.soundVolume = sound;
|
||||
PlayerPrefs.SetFloat("soundVolume", sound);
|
||||
ui.btn_sound.on_off.selectedIndex = sound > 0
|
||||
? 0
|
||||
: 1;
|
||||
}
|
||||
private void SetVersion()
|
||||
{
|
||||
// Debug.Log($"SetVersion====== {Application.version}");
|
||||
ui.text_version.SetVar("count", Application.version).FlushVars();
|
||||
}
|
||||
|
||||
private void SetUID()
|
||||
{
|
||||
ui.text_uid.SetVar("UID", GameHelper.GetLoginModel().Uid.ToString()).FlushVars();
|
||||
}
|
||||
|
||||
private void SetAvatar()
|
||||
{
|
||||
if (_selectIndex != -1 && _selectIndex != DataMgr.PlayerAvatarId.Value)
|
||||
{
|
||||
DataMgr.PlayerAvatarId.Value = _selectIndex;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void UpdateUserInfo()
|
||||
{
|
||||
SaveName();
|
||||
|
||||
CtrlCloseUI();
|
||||
}
|
||||
|
||||
private void SaveName()
|
||||
{
|
||||
var name = ui.edit_name.input.text;
|
||||
|
||||
if (string.IsNullOrEmpty(name) || name.IsNullOrWhiteSpace())
|
||||
{
|
||||
GameHelper.ShowTips("The input cannot be null", true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (name.Equals(DataMgr.PlayerName)) return;
|
||||
|
||||
// GameHelper.ShowTips("Name changed successfully");
|
||||
DataMgr.PlayerName.Value = name;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f70e08a1fa35f7e4296d5b0f093cba6e
|
||||
timeCreated: 1676360265
|
||||
@@ -0,0 +1,82 @@
|
||||
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class ArrowSettingUICtrl : BaseUICtrl
|
||||
{
|
||||
private ArrowSettingUI ui;
|
||||
private ArrowSettingModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.ArrowSettingUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.ArrowSettingUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new ArrowSettingUI(this);
|
||||
ui.Open(args);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public override void CloseUI(object args = null)
|
||||
{
|
||||
|
||||
if (ui != null && !ui.isClose)
|
||||
{
|
||||
ui.Close();
|
||||
}
|
||||
ui = 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: c878a49cee89b2047b83b09db20d1c12
|
||||
timeCreated: 1676360266
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 397e677967c6452c9810742ba0f08b27
|
||||
timeCreated: 1783663847
|
||||
@@ -0,0 +1,41 @@
|
||||
namespace RedHotRoast
|
||||
{
|
||||
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 RedHotRoast
|
||||
{
|
||||
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,149 @@
|
||||
using System;
|
||||
using FGUI.Arrow_game;
|
||||
using FGUI.Arrow_Theme;
|
||||
|
||||
namespace RedHotRoast
|
||||
{
|
||||
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()
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, true);
|
||||
|
||||
}
|
||||
//
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as com_theme;
|
||||
}
|
||||
private SuccessData successData_;
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, false);
|
||||
|
||||
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;
|
||||
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.ThemeChange);
|
||||
|
||||
});
|
||||
|
||||
ui.btn_close.SetClick(() =>
|
||||
{
|
||||
CtrlCloseUI();
|
||||
});
|
||||
}
|
||||
|
||||
private void SetBtnClick(int index)
|
||||
{
|
||||
DataMgr.ArrowTheme.Value = index;
|
||||
SetBtnState();
|
||||
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.ThemeChange);
|
||||
}
|
||||
|
||||
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 = 0;
|
||||
((btn_green)ui.btn_worm).state.selectedIndex = 1;
|
||||
((btn_green)ui.btn_colours).state.selectedIndex = 1;
|
||||
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 = 1;
|
||||
((btn_green)ui.btn_worm).state.selectedIndex = 0;
|
||||
((btn_green)ui.btn_colours).state.selectedIndex = 1;
|
||||
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 = 1;
|
||||
((btn_green)ui.btn_worm).state.selectedIndex = 1;
|
||||
((btn_green)ui.btn_colours).state.selectedIndex = 0;
|
||||
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 RedHotRoast
|
||||
{
|
||||
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
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 62a730aa391641bf93ef2840dce2dcbc
|
||||
timeCreated: 1783663847
|
||||
@@ -0,0 +1,19 @@
|
||||
namespace RedHotRoast
|
||||
{
|
||||
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
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class MainTabModel : BaseModel
|
||||
public class ArrowTipsModel : BaseModel
|
||||
{
|
||||
protected override void OnInit()
|
||||
{
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4051b0d4995a4a1399d64e95c6c582f1
|
||||
timeCreated: 1781677288
|
||||
@@ -0,0 +1,127 @@
|
||||
using System;
|
||||
using FGUI.Arrow_game;
|
||||
using IgnoreOPS;
|
||||
using UnityEngine;
|
||||
|
||||
namespace RedHotRoast
|
||||
{
|
||||
|
||||
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.Popup;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
uiInfo.isNeedOpenAnim = true;
|
||||
uiInfo.isNeedCloseAnim = true;
|
||||
}
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, true);
|
||||
|
||||
CommonHelper.FadeOut(ui);
|
||||
|
||||
HallManager.Instance.UpdateSecondEvent -= UpdateCd;
|
||||
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as com_tips;
|
||||
}
|
||||
|
||||
private int state_;
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, false);
|
||||
|
||||
if (args != null)
|
||||
{
|
||||
InitView((int)args);
|
||||
state_ = (int)args + 5;
|
||||
}
|
||||
|
||||
HallManager.Instance.UpdateSecondEvent += UpdateCd;
|
||||
UpdateCd();
|
||||
|
||||
if (GameHelper.IsGiftSwitch() && ConfigSystem.GetCommonConf().PiggyBankSwitch == 1)
|
||||
{
|
||||
ui.btn_watch.img_saveingpot.visible = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
CommonHelper.FadeIn(ui);
|
||||
}
|
||||
|
||||
protected override void AddListener()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
}
|
||||
|
||||
private void InitView(int type)
|
||||
{
|
||||
int state = type;
|
||||
Debug.Log($"tips state = {state} ");
|
||||
// 0 提示 1 删除道具
|
||||
ui.state.selectedIndex = state;
|
||||
|
||||
ui.btn_watch.SetClick(() =>
|
||||
{
|
||||
string idStr = state == 1 ? "deletePop" : "HintPop";
|
||||
GameHelper.ShowVideoAd(idStr, isSuccess =>
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
Debug.Log($"isSuccess tips state = {state} ");
|
||||
GameHelper.SetWatchCd(state_);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.UseProps, state);
|
||||
CtrlCloseUI();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
ui.btn_close.SetClick(CtrlCloseUI);
|
||||
}
|
||||
|
||||
|
||||
private void UpdateCd()
|
||||
{
|
||||
var btnWatch = ui.btn_watch ;
|
||||
// Debug.Log($"DataMgr.NewWatchCd.Value[state_ + 2]==={DataMgr.NewWatchCd.Value[state_ + 2]}");
|
||||
if (DataMgr.NewWatchCd.Value[state_] > Convert.ToInt32(GameHelper.GetNowTime()))
|
||||
{
|
||||
btnWatch.enabled = false;
|
||||
btnWatch.can.selectedIndex = 1;
|
||||
btnWatch.text.text = CommonHelper.TimeFormat(DataMgr.NewWatchCd.Value[state_] - Convert.ToInt32(GameHelper.GetNowTime()), CountDownType.Hour);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.btn_watch.enabled = true;
|
||||
btnWatch.can.selectedIndex = 0;
|
||||
btnWatch.text.text = "Use Item";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4737faa4124f48fabc5ef35ef2ff9f2f
|
||||
timeCreated: 1781677288
|
||||
+6
-16
@@ -1,14 +1,12 @@
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class MainTabUICtrl : BaseUICtrl
|
||||
public class ArrowTipsUICtrl : BaseUICtrl
|
||||
{
|
||||
private MainTabUI ui;
|
||||
private MainTabModel model;
|
||||
private ArrowTipsUI ui;
|
||||
private ArrowTipsModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.MainTabUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.MainTabUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
private uint openUIMsg = UICtrlMsg.ArrowTipsUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.ArrowTipsUI_Close;
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
@@ -22,7 +20,7 @@ namespace RedHotRoast
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new MainTabUI(this);
|
||||
ui = new ArrowTipsUI(this);
|
||||
ui.Open(args);
|
||||
}
|
||||
}
|
||||
@@ -37,10 +35,6 @@ namespace RedHotRoast
|
||||
ui = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
|
||||
public override uint GetOpenUIMsg(string uiName)
|
||||
{
|
||||
return openUIMsg;
|
||||
@@ -62,9 +56,5 @@ namespace RedHotRoast
|
||||
uiCtrlDispatcher.RemoveListener(openUIMsg, OpenUI);
|
||||
uiCtrlDispatcher.RemoveListener(closeUIMsg, CloseUI);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5e1a6be77c1c462a86ed773072d923d3
|
||||
timeCreated: 1781677288
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4cb018e70f844a67a2dd33d04abf6318
|
||||
timeCreated: 1783672661
|
||||
@@ -0,0 +1,41 @@
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class GameAgainCtrl : BaseCtrl
|
||||
{
|
||||
public static GameAgainCtrl Instance { get; private set; }
|
||||
|
||||
private GameAgainModel 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: cee917424e204aeeb572fbd21d9a216a
|
||||
timeCreated: 1781331027
|
||||
@@ -0,0 +1,43 @@
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class GameAgainModel : 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: ba9f90a8f17245beb5fb93275fb663af
|
||||
timeCreated: 1781331027
|
||||
@@ -0,0 +1,110 @@
|
||||
using System;
|
||||
using DG.Tweening;
|
||||
using FGUI.GameResult_08;
|
||||
using UnityEngine;
|
||||
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class GameAgainUI : BaseUI
|
||||
{
|
||||
private GameAgainUICtrl ctrl;
|
||||
private GameAgainModel model;
|
||||
private com_arrow_end_again ui;
|
||||
|
||||
private Action closeCallback;
|
||||
|
||||
|
||||
public GameAgainUI(GameAgainUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.GameAgainUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "GameResult_08";
|
||||
uiInfo.assetName = "com_arrow_end_again";
|
||||
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_arrow_end_again;
|
||||
}
|
||||
private SuccessData successData_;
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
|
||||
ui.btn_revive.SetClick(() =>
|
||||
{
|
||||
float[] cash_array = GameHelper.GetRewardValue(2);
|
||||
|
||||
var temp = new SuccessData();
|
||||
temp.IsWin = false;
|
||||
temp.ch_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(() =>
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.reset_game, false);
|
||||
CtrlCloseUI();
|
||||
|
||||
});
|
||||
|
||||
ui.btn_back.SetClick(() =>
|
||||
{
|
||||
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.reset_game, false);
|
||||
CtrlCloseUI();
|
||||
});
|
||||
}
|
||||
|
||||
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: cb749d47d61d49feb70387124d69b69f
|
||||
timeCreated: 1781331027
|
||||
@@ -0,0 +1,87 @@
|
||||
using DG.Tweening;
|
||||
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class GameAgainUICtrl : BaseUICtrl
|
||||
{
|
||||
private GameAgainUI ui;
|
||||
private GameAgainModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.GameAgainUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.GameAgainUI_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 GameAgainUI(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: b83d7c197169420da4fb3e79d330a74d
|
||||
timeCreated: 1781331027
|
||||
@@ -1,152 +1,152 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class GoldRewardUI : BaseUI
|
||||
{
|
||||
private GoldRewardUICtrl ctrl;
|
||||
private GoldRewardModel model;
|
||||
private FGUI.ZM_AddCell_12.com_goldreward ui;
|
||||
|
||||
public GoldRewardUI(GoldRewardUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.GoldRewardUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "ZM_AddCell_12";
|
||||
uiInfo.assetName = "com_goldreward";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.GoldRewardModel) as GoldRewardModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.ZM_AddCell_12.com_goldreward;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
turn_list = ConfigSystem.GetConfig<TurnOffRewards>();
|
||||
InitView();
|
||||
ui.btn_close.SetClick(() =>
|
||||
{
|
||||
GameHelper.addInterAdnumber();
|
||||
CtrlCloseUI();
|
||||
});
|
||||
}
|
||||
private List<TurnOffRewards> turn_list;
|
||||
|
||||
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 void InitView()
|
||||
{
|
||||
int weight_all = 0;
|
||||
float max_gold = 0;
|
||||
for (int i = 0; i < turn_list.Count; i++)
|
||||
{
|
||||
weight_all += turn_list[i].weight;
|
||||
if (turn_list[i].quantity > max_gold)
|
||||
{
|
||||
max_gold = turn_list[i].quantity;
|
||||
}
|
||||
}
|
||||
int random_ = Random.Range(0, weight_all);
|
||||
int int_ = 0;
|
||||
|
||||
|
||||
TurnOffRewards reward = null;
|
||||
|
||||
for (int i = 0; i < turn_list.Count; i++)
|
||||
{
|
||||
int_ += turn_list[i].weight;
|
||||
if (random_ < int_)
|
||||
{
|
||||
reward = turn_list[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (reward == null) reward = turn_list[0];
|
||||
ui.text_goldnum.text = max_gold.ToString();
|
||||
// if (GameHelper.IsGiftSwitch() && ConfigSystem.GetConfig<CommonModel>().PiggyBankSwitch == 1)
|
||||
// {
|
||||
// (ui.btn_receive.GetChild("img_saveingpot") as GImage).visible = true;
|
||||
// }
|
||||
ui.btn_receive.SetClick(() =>
|
||||
{
|
||||
GameHelper.ShowVideoAd("TurnOffRewards", isSuccess =>
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
ui.btn_receive.SetClick(() => { });
|
||||
decimal gold = (decimal)reward.quantity;
|
||||
var start = GameHelper.GetUICenterPosition(ui.text_goldnum);
|
||||
var end = GameHelper.GetUICenterPosition(ui.end_point);
|
||||
|
||||
var rewardData = new RewardData();
|
||||
var rewardSingleData = new RewardSingleData(101, gold, RewardOrigin.AdTask)
|
||||
{
|
||||
startPosition = start,
|
||||
endPosition = new Vector2(end.x, end.y)
|
||||
};
|
||||
rewardData.AddReward(rewardSingleData);
|
||||
rewardData.displayType = RewardDisplayType.RewardFly | RewardDisplayType.ValueChange;
|
||||
rewardData.AddCompleted((isScu) =>
|
||||
{
|
||||
// DOVirtual.DelayedCall(0.5f, () =>
|
||||
// {
|
||||
// var startNum = PreferencesMgr.Instance.Currency101 - gold;
|
||||
// DOVirtual.Float((float)startNum, (float)GameHelper.GetGoldNumber(), 1f,
|
||||
// value => { ui.btn_gold.GetChild("text_gold").text = GameHelper.Get101Str((decimal)value); });
|
||||
// });
|
||||
CtrlCloseUI();
|
||||
});
|
||||
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.GetReward, rewardData);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class GoldRewardUI : BaseUI
|
||||
{
|
||||
private GoldRewardUICtrl ctrl;
|
||||
private GoldRewardModel model;
|
||||
private FGUI.ZM_AddCell_12.com_goldreward ui;
|
||||
|
||||
public GoldRewardUI(GoldRewardUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.GoldRewardUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "ZM_AddCell_12";
|
||||
uiInfo.assetName = "com_goldreward";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.GoldRewardModel) as GoldRewardModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.ZM_AddCell_12.com_goldreward;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
turn_list = ConfigSystem.GetConfig<TurnOffRewards>();
|
||||
InitView();
|
||||
ui.btn_close.SetClick(() =>
|
||||
{
|
||||
GameHelper.addInterAdnumber();
|
||||
CtrlCloseUI();
|
||||
});
|
||||
}
|
||||
private List<TurnOffRewards> turn_list;
|
||||
|
||||
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 void InitView()
|
||||
{
|
||||
int weight_all = 0;
|
||||
float max_gold = 0;
|
||||
for (int i = 0; i < turn_list.Count; i++)
|
||||
{
|
||||
weight_all += turn_list[i].weight;
|
||||
if (turn_list[i].quantity > max_gold)
|
||||
{
|
||||
max_gold = turn_list[i].quantity;
|
||||
}
|
||||
}
|
||||
int random_ = Random.Range(0, weight_all);
|
||||
int int_ = 0;
|
||||
|
||||
|
||||
TurnOffRewards reward = null;
|
||||
|
||||
for (int i = 0; i < turn_list.Count; i++)
|
||||
{
|
||||
int_ += turn_list[i].weight;
|
||||
if (random_ < int_)
|
||||
{
|
||||
reward = turn_list[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (reward == null) reward = turn_list[0];
|
||||
ui.text_goldnum.text = max_gold.ToString();
|
||||
// if (GameHelper.IsGiftSwitch() && ConfigSystem.GetCommonConf().PiggyBankSwitch == 1)
|
||||
// {
|
||||
// (ui.btn_receive.GetChild("img_saveingpot") as GImage).visible = true;
|
||||
// }
|
||||
ui.btn_receive.SetClick(() =>
|
||||
{
|
||||
GameHelper.ShowVideoAd("TurnOffRewards", isSuccess =>
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
ui.btn_receive.SetClick(() => { });
|
||||
decimal gold = (decimal)reward.quantity;
|
||||
var start = GameHelper.GetUICenterPosition(ui.text_goldnum);
|
||||
var end = GameHelper.GetUICenterPosition(ui.end_point);
|
||||
|
||||
var rewardData = new RewardData();
|
||||
var rewardSingleData = new RewardSingleData(101, gold, RewardOrigin.AdTask)
|
||||
{
|
||||
startPosition = start,
|
||||
endPosition = new Vector2(end.x, end.y)
|
||||
};
|
||||
rewardData.AddReward(rewardSingleData);
|
||||
rewardData.displayType = RewardDisplayType.RewardFly | RewardDisplayType.ValueChange;
|
||||
rewardData.AddCompleted((isScu) =>
|
||||
{
|
||||
// DOVirtual.DelayedCall(0.5f, () =>
|
||||
// {
|
||||
// var startNum = PreferencesMgr.Instance.Currency101 - gold;
|
||||
// DOVirtual.Float((float)startNum, (float)GameHelper.GetGoldNumber(), 1f,
|
||||
// value => { ui.btn_gold.GetChild("text_gold").text = GameHelper.Get101Str((decimal)value); });
|
||||
// });
|
||||
CtrlCloseUI();
|
||||
});
|
||||
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.GetReward, rewardData);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,13 +113,13 @@ namespace RedHotRoast
|
||||
private void OnClickFlyCash()
|
||||
{
|
||||
// PreferencesMgr.Instance.AdCashFlyShowTime =
|
||||
// GameHelper.GetNowTime() + ConfigSystem.GetConfig<CommonModel>().flyCD;
|
||||
// GameHelper.GetNowTime() + ConfigSystem.GetCommonConf().flyCD;
|
||||
// var rewardData = new RewardData();
|
||||
|
||||
// var singleValue =
|
||||
// (decimal)Math.Round(
|
||||
// UnityEngine.Random.Range(ConfigSystem.GetConfig<CommonModel>().flyReward[0],
|
||||
// ConfigSystem.GetConfig<CommonModel>().flyReward[1]), 2);
|
||||
// UnityEngine.Random.Range(ConfigSystem.GetCommonConf().flyReward[0],
|
||||
// ConfigSystem.GetCommonConf().flyReward[1]), 2);
|
||||
|
||||
|
||||
// decimal rewardValue;
|
||||
@@ -172,7 +172,7 @@ namespace RedHotRoast
|
||||
private void OnClickIcon()
|
||||
{
|
||||
// //WebThroughUtil.WebThroughClick(H5WebThroughType.OnlineH5, ui.btn_icon);
|
||||
// if (iconTime < ConfigSystem.GetConfig<CommonModel>().ThroughRewardCD)
|
||||
// if (iconTime < ConfigSystem.GetCommonConf().ThroughRewardCD)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
|
||||
@@ -566,7 +566,7 @@ namespace RedHotRoast
|
||||
//ui.broadcast.visible = GameHelper.IsGiftSwitch();
|
||||
|
||||
ui.btn_pass.SetClick(OnClickPass);
|
||||
// if (GameHelper.IsGiftSwitch() || (ConfigSystem.GetConfig<CommonModel>().WVswitch == 1))
|
||||
// if (GameHelper.IsGiftSwitch() || (ConfigSystem.GetCommonConf().WVswitch == 1))
|
||||
// {
|
||||
// ui.btn_h5.visible = false;
|
||||
// }
|
||||
@@ -578,10 +578,10 @@ namespace RedHotRoast
|
||||
ui.btn_head.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PersonViewUI_Open); });
|
||||
|
||||
|
||||
if (HallManager.Instance.enterHallTimes == 1)
|
||||
{
|
||||
reCreatPur();
|
||||
}
|
||||
// if (HallManager.Instance.enterHallTimes == 1)
|
||||
// {
|
||||
// reCreatPur();
|
||||
// }
|
||||
|
||||
|
||||
if (!GameHelper.IsGiftSwitch())
|
||||
|
||||
@@ -1,246 +0,0 @@
|
||||
namespace RedHotRoast
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using FGUI.ZM_Tab_19;
|
||||
using Newtonsoft.Json;
|
||||
using UnityEngine;
|
||||
|
||||
public class MainTabUI : BaseUI
|
||||
{
|
||||
private MainTabUICtrl ctrl;
|
||||
private MainTabModel model;
|
||||
private FGUI.ZM_Tab_19.com_main_tab ui;
|
||||
|
||||
private Action closeCallBack;
|
||||
|
||||
private static int mTabIndex = 1;
|
||||
|
||||
public static int mLastIndex = 1;
|
||||
|
||||
private bool exitH5Task;
|
||||
|
||||
|
||||
|
||||
public MainTabUI(MainTabUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.MainTabUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "ZM_Tab_19";
|
||||
uiInfo.assetName = "com_main_tab";
|
||||
uiInfo.layerType = UILayerType.Top;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = false;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
CommonHelper.FadeOut(ui);
|
||||
mLastIndex = 1;
|
||||
mTabIndex = 1;
|
||||
CloseAllTabView();
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.ZM_Tab_19.com_main_tab;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
if (args != null)
|
||||
{
|
||||
mTabIndex = (int)args;
|
||||
}
|
||||
|
||||
CheckH5Task();
|
||||
InitView();
|
||||
}
|
||||
|
||||
private void CloseAllTabView()
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.MenuUI_Close);
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.MainUI_Close);
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.MailUI_Close);
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.SignInUI_Close);
|
||||
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
CommonHelper.FadeIn(ui);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
|
||||
protected override void AddListener()
|
||||
{
|
||||
// GameDispatcher.Instance.AddListener(GameMsg.MainTab, OnGameTab);
|
||||
}
|
||||
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
// GameDispatcher.Instance.RemoveListener(GameMsg.MainTab, OnGameTab);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void CheckH5Task(object obj = null)
|
||||
{
|
||||
exitH5Task = false;
|
||||
}
|
||||
|
||||
private void InitView()
|
||||
{
|
||||
|
||||
ui.com_tab.btn_signin.SetClickDownEffect(0.8f, 1);
|
||||
ui.com_tab.btn_main.SetClickDownEffect(0.8f, 1);
|
||||
ui.com_tab.btn_mail.SetClickDownEffect(0.8f, 1);
|
||||
ui.com_tab.btn_options.SetClickDownEffect(0.8f, 1);
|
||||
|
||||
ui.com_tab.btn_signin.SetClick(OnClickSignInTab);
|
||||
ui.com_tab.btn_main.SetClick(OnClickMainTab);
|
||||
ui.com_tab.btn_mail.SetClick(OnClickMailTab);
|
||||
ui.com_tab.btn_options.SetClick(OnClickSettingTab);
|
||||
|
||||
OnGameTab(mTabIndex);
|
||||
}
|
||||
|
||||
private void OnClickSignInTab()
|
||||
{
|
||||
OnGameTab(1);
|
||||
}
|
||||
private void OnClickMainTab()
|
||||
{
|
||||
OnGameTab(2);
|
||||
}
|
||||
|
||||
private void OnClickMailTab()
|
||||
{
|
||||
OnGameTab(3);
|
||||
}
|
||||
|
||||
private void OnClickSettingTab()
|
||||
{
|
||||
OnGameTab(4);
|
||||
}
|
||||
|
||||
private void OnGameTab(object obj = null)
|
||||
{
|
||||
|
||||
if (obj != null)
|
||||
{
|
||||
mTabIndex = (int)obj;
|
||||
}
|
||||
|
||||
OnChangeTab(mTabIndex);
|
||||
OnClickTab(mTabIndex);
|
||||
}
|
||||
|
||||
private void OnChangeTab(int tabIndex)
|
||||
{
|
||||
// ui.com_tab.cont_show.selectedIndex = tabIndex == 0 ? com_bottom.Show_mian : com_bottom.Show_show;
|
||||
ui.com_tab.btn_signin.cont_tab.selectedIndex = tabIndex == 1 ? btn_sign.Tab_select : btn_sign.Tab_normal;
|
||||
ui.com_tab.btn_main.cont_tab.selectedIndex = tabIndex == 2 ? btn_main.Tab_select : btn_main.Tab_normal;
|
||||
ui.com_tab.btn_mail.cont_tab.selectedIndex = tabIndex == 3 ? btn_mail.Tab_select : btn_mail.Tab_normal;
|
||||
ui.com_tab.btn_options.cont_tab.selectedIndex = tabIndex == 4 ? btn_options.Tab_select : btn_options.Tab_normal;
|
||||
|
||||
|
||||
// ui.com_tab.btn_sign.cont_tab.selectedIndex = tabIndex == 2 ? btn_todos.Tab_select : btn_todos.Tab_normal;
|
||||
// // ui.com_tab.btn_spin.cont_tab.selectedIndex = tabIndex == 1 ? btn_todos.Tab_select : btn_todos.Tab_normal;
|
||||
// ui.com_tab.btn_setting.cont_tab.selectedIndex = tabIndex == 5 ? btn_todos.Tab_select : btn_todos.Tab_normal;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static void SwapElements<T>(List<T> list, int index1, int index2)
|
||||
{
|
||||
if (index1 >= 0 && index1 < list.Count && index2 >= 0 && index2 < list.Count)
|
||||
{
|
||||
(list[index2], list[index1]) = (list[index1], list[index2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("One or both of the provided indices are out of range.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void OnClickTab(int tabIndex)
|
||||
{
|
||||
if (mLastIndex == tabIndex)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var isH5Tab = tabIndex == 5;
|
||||
if (mLastIndex == 1)
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.SignInUI_Close, false);
|
||||
uiCtrlDispatcher.Dispatch(tabIndex == 2 ? UICtrlMsg.MainUI_Open : UICtrlMsg.MainUI_Close, tabIndex == 2 ? true : false);
|
||||
uiCtrlDispatcher.Dispatch(tabIndex == 3 ? UICtrlMsg.MailUI_Open : UICtrlMsg.MailUI_Close, tabIndex == 3 ? true : false);
|
||||
uiCtrlDispatcher.Dispatch(tabIndex == 4 ? UICtrlMsg.MenuUI_Open : UICtrlMsg.MenuUI_Close, tabIndex == 4 ? true : false);
|
||||
|
||||
|
||||
}
|
||||
else if (mLastIndex == 2)
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.MainUI_Close, tabIndex < 2 ? true : false);
|
||||
uiCtrlDispatcher.Dispatch(tabIndex == 1 ? UICtrlMsg.SignInUI_Open : UICtrlMsg.SignInUI_Close, false);
|
||||
uiCtrlDispatcher.Dispatch(tabIndex == 3 ? UICtrlMsg.MailUI_Open : UICtrlMsg.MailUI_Close, tabIndex == 3 ? true : false);
|
||||
uiCtrlDispatcher.Dispatch(tabIndex == 4 ? UICtrlMsg.MenuUI_Open : UICtrlMsg.MenuUI_Close, tabIndex == 4 ? true : false);
|
||||
}
|
||||
else if (mLastIndex == 3)
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.MailUI_Close, tabIndex < 3 ? true : false);
|
||||
uiCtrlDispatcher.Dispatch(tabIndex == 1 ? UICtrlMsg.SignInUI_Open : UICtrlMsg.SignInUI_Close, false);
|
||||
uiCtrlDispatcher.Dispatch(tabIndex == 2 ? UICtrlMsg.MainUI_Open : UICtrlMsg.MainUI_Close, tabIndex == 2 ? false : true);
|
||||
uiCtrlDispatcher.Dispatch(tabIndex == 4 ? UICtrlMsg.MenuUI_Open : UICtrlMsg.MenuUI_Close, tabIndex == 4 ? true : false);
|
||||
}
|
||||
else if (mLastIndex == 4)
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.MenuUI_Close, true);
|
||||
uiCtrlDispatcher.Dispatch(tabIndex == 1 ? UICtrlMsg.SignInUI_Open : UICtrlMsg.SignInUI_Close, false);
|
||||
uiCtrlDispatcher.Dispatch(tabIndex == 2 ? UICtrlMsg.MainUI_Open : UICtrlMsg.MainUI_Close, tabIndex == 2 ? false : true);
|
||||
uiCtrlDispatcher.Dispatch(tabIndex == 3 ? UICtrlMsg.MailUI_Open : UICtrlMsg.MailUI_Close, tabIndex == 3 ? false : true);
|
||||
|
||||
}
|
||||
|
||||
// uiCtrlDispatcher.Dispatch(tabIndex == 2 ? UICtrlMsg.MainUI_Open : UICtrlMsg.MainUI_Close, tabIndex < 2 ? true : false);
|
||||
|
||||
// uiCtrlDispatcher.Dispatch(isH5Tab ? UICtrlMsg.BackgroundUI_Close : UICtrlMsg.BackgroundUI_Open);
|
||||
|
||||
mLastIndex = tabIndex;
|
||||
|
||||
|
||||
if (isH5Tab)
|
||||
{
|
||||
// AudioManager.Instance.StopBGM();
|
||||
}
|
||||
else
|
||||
{
|
||||
//背景音乐
|
||||
AudioManager.Instance.PlayBGM("hall_bgm");
|
||||
}
|
||||
|
||||
if (DataMgr.IsLastH5Tab.Value != isH5Tab)
|
||||
{
|
||||
DataMgr.IsLastH5Tab.Value = isH5Tab;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9b3645dfb7e849938977e4724592a9dc
|
||||
timeCreated: 1783666276
|
||||
@@ -0,0 +1,19 @@
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class MakeupConfirmCtrl : BaseCtrl
|
||||
{
|
||||
public static MakeupConfirmCtrl Instance { get; private set; }
|
||||
|
||||
private MakeupConfirmModel model;
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5bda89c1f110f504d9e35769149d5994
|
||||
guid: 86c6a468456334464a52d60266162378
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class MakeupConfirmModel : BaseModel
|
||||
{
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 51a8455058a9919499be346dc1bfadb7
|
||||
guid: 1951296e9bf3242238f072254d2759b1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8d20c295f8867f54c837180dda6371e4
|
||||
guid: e6be431a6f2064440bad70eda1509499
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -0,0 +1,72 @@
|
||||
namespace RedHotRoast
|
||||
|
||||
{
|
||||
public class MakeupConfirmUICtrl : BaseUICtrl
|
||||
{
|
||||
private MakeupConfirmUI ui;
|
||||
private MakeupConfirmModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.MakeupConfirmUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.MakeupConfirmUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.MakeupConfirmModel) as MakeupConfirmModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new MakeupConfirmUI(this);
|
||||
ui.Open(args);
|
||||
}
|
||||
}
|
||||
|
||||
public override void CloseUI(object args = null)
|
||||
{
|
||||
if (ui != null && !ui.isClose)
|
||||
{
|
||||
ui.Close();
|
||||
}
|
||||
ui = 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
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5f8ad5a85bdfdab4cbe1c45ffb2ed34a
|
||||
guid: 53f46aa2e5a8b449cb58a52b8c97a086
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -47,25 +47,24 @@ namespace RedHotRoast
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
ui.state.selectedIndex = GameHelper.IsGiftSwitch() ? 1 : 0;
|
||||
|
||||
if (GameHelper.IsGiftSwitch())
|
||||
{
|
||||
((FGUI.ZM_Common_01.com_open_tips)ui.com_tips).t0.Play(() =>
|
||||
{
|
||||
DOVirtual.DelayedCall(0.2f, () =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.OpenGameUI_Close);
|
||||
});
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
DOVirtual.DelayedCall(0.7f, () => { GameDispatcher.Instance.Dispatch(GameMsg.reset_game, args); });
|
||||
InitView();
|
||||
// DOVirtual.DelayedCall(0.2f, () =>
|
||||
// {
|
||||
// if (GameHelper.GetLevel() - 1 < ConfigSystem.GetLevelUnlockConfig().Count&&GameHelper.IsGiftSwitch())
|
||||
// {
|
||||
// LevelUnlock levelUnlock_ = ConfigSystem.GetLevelUnlockConfig()[GameHelper.GetLevel() - 1];
|
||||
// if (levelUnlock_.LeveType != 0)
|
||||
// {
|
||||
// if (!DataMgr.LevelUnlockList.Value.Contains(GameHelper.GetLevel() - 1))
|
||||
// {
|
||||
// uiCtrlDispatcher.Dispatch(UICtrlMsg.UnlockLevelUI_Open, GameHelper.GetLevel() - 1);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
|
||||
|
||||
if (AudioManager.Instance.IsOpenEffect)
|
||||
{
|
||||
AudioManager.Instance.PlayDynamicEffect(AudioConst.game_open);
|
||||
@@ -107,19 +106,7 @@ namespace RedHotRoast
|
||||
|
||||
DOVirtual.DelayedCall(1.5f, () =>
|
||||
{
|
||||
// ui.tips_node1.visible = true;
|
||||
// var open_bg = FXManager.Instance.SetFx<SkeletonAnimation>(ui.tips_node1, Fx_Type.fx_open_bg, ref closeCallback);
|
||||
// open_bg.state.SetAnimation(0, "animation", true);
|
||||
// ui.tips_node1.SetScale(1.25f, 1.25f);
|
||||
//
|
||||
// ui.tips_node.visible = true;
|
||||
// var open_game = FXManager.Instance.SetFx<SkeletonAnimation>(ui.tips_node, Fx_Type.fx_open, ref closeCallback);
|
||||
// open_game.state.SetAnimation(0, "animation", false);
|
||||
// open_game.state.Complete += (a) =>
|
||||
// {
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.OpenGameUI_Close);
|
||||
// };
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ namespace RedHotRoast
|
||||
|
||||
}
|
||||
ui.text_allgold.text = GameHelper.Get101Str(gold);
|
||||
// ui.btn_buypass.GetChild("title").text = "$" + ConfigSystem.GetConfig<CommonModel>().Passportgift;
|
||||
// ui.btn_buypass.GetChild("title").text = "$" + ConfigSystem.GetCommonConf().Passportgift;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b89d7d8a78f842cda28df17d019716e6
|
||||
timeCreated: 1783665325
|
||||
@@ -0,0 +1,42 @@
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class PettyAwardCtrl : BaseCtrl
|
||||
{
|
||||
public static PettyAwardCtrl Instance { get; private set; }
|
||||
|
||||
private PettyAwardModel model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
//model = ModuleManager.Instance..GetModel(ModelConst.PettyAwardModel) as PettyAwardModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
protected override void AddListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void AddServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1261358ce7a049afb16f4553810bd5bf
|
||||
timeCreated: 1766046260
|
||||
@@ -0,0 +1,43 @@
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class PettyAwardModel : 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: 92b7e778079e4302b93e51da320ec76c
|
||||
timeCreated: 1766046260
|
||||
@@ -0,0 +1,341 @@
|
||||
using System;
|
||||
using IgnoreOPS;
|
||||
using UnityEngine;
|
||||
using Spine.Unity;
|
||||
using Newtonsoft.Json;
|
||||
using SGModule.NetKit;
|
||||
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class PettyAwardUI : BaseUI
|
||||
{
|
||||
private PettyAwardUICtrl ctrl;
|
||||
private PettyAwardModel model;
|
||||
private FGUI.ZM_Petty.com_petty_award ui;
|
||||
private Action closeCallback;
|
||||
private Action open_sign;
|
||||
private bool is_get = false;
|
||||
public PettyAwardUI(PettyAwardUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.PettyAwardUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "ZM_Petty";
|
||||
uiInfo.assetName = "com_petty_award";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = true;
|
||||
uiInfo.isNeedCloseAnim = true;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
model = ModuleManager.Instance.GetModel(ModelConst.PettyAwardModel) as PettyAwardModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
SaveData.SaveDataFunc();
|
||||
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, true);
|
||||
|
||||
closeCallback?.Invoke();
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.ZM_Petty.com_petty_award;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, false);
|
||||
|
||||
InitView();
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
//open_sign = (System.Action)args;
|
||||
}
|
||||
|
||||
protected override void OnHide()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDisplay(object args)
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
protected override void AddListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
private int _mLastState;
|
||||
//初始化页面逻辑
|
||||
private void InitView()
|
||||
{
|
||||
_mLastState = DataMgr.PettyState.Value;
|
||||
// Debug.Log($"PettyState============: {DataMgr.PettyState.Value}");
|
||||
var num = ConfigSystem.GetCommonConf().SmallReward;
|
||||
ui.com_get_panel.text_reward.text = $"{GameHelper.Get102Str(num)} USD";
|
||||
|
||||
|
||||
ui.com_get_panel.btn_get.SetClick(GotoEnterAccount);
|
||||
ui.btn_close.SetClick(()=>
|
||||
{
|
||||
if (ui.state.selectedIndex == 4)
|
||||
{
|
||||
GotoEnterAccount();
|
||||
}
|
||||
else
|
||||
{
|
||||
CtrlCloseUI();
|
||||
}
|
||||
});
|
||||
|
||||
if (_mLastState == 0)
|
||||
{
|
||||
// var sk = FXManager.Instance.SetFx<SkeletonAnimation>(ui.anim, Fx_Type.fx_petty_reward, ref closeCallback);
|
||||
// sk.state.SetAnimation(0, "newbie_reward_an01", false);
|
||||
// sk.state.Complete += (a) =>
|
||||
// {
|
||||
// sk.state.SetAnimation(0, "newbie_reward_an02", true);
|
||||
// ui.btn_gerAward.SetClick(() =>
|
||||
// {
|
||||
// ui.btn_gerAward.visible = false;
|
||||
// sk.state.SetAnimation(0, "newbie_reward_an03", false);
|
||||
// sk.state.Complete += (a) =>
|
||||
// {
|
||||
// ui.state.selectedIndex = 1;
|
||||
// DataMgr.PettyState.Value = 1;
|
||||
// ui.anim.visible = false;
|
||||
// };
|
||||
// });
|
||||
//
|
||||
// };
|
||||
ui.state.selectedIndex = 1;
|
||||
DataMgr.PettyState.Value = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
GotoPanel(_mLastState);
|
||||
}
|
||||
}
|
||||
|
||||
private void GotoPanel(int index)
|
||||
{
|
||||
switch (index)
|
||||
{
|
||||
case 1:
|
||||
ui.state.selectedIndex = 1;
|
||||
break;
|
||||
case 2:
|
||||
ui.state.selectedIndex = 2;
|
||||
GotoEnterAccount();
|
||||
break;
|
||||
case 3:
|
||||
ui.state.selectedIndex = 3;
|
||||
GotoDetail();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void GotoEnterAccount()
|
||||
{
|
||||
ui.state.selectedIndex = 2;
|
||||
DataMgr.PettyState.Value = 2;
|
||||
if (!DataMgr.PettyAccount.Value.IsNullOrWhiteSpace())
|
||||
{
|
||||
ui.com_account.com_email.enter_email.text = DataMgr.PettyAccount.Value;
|
||||
}
|
||||
if (!DataMgr.PettyFirstName.Value.IsNullOrWhiteSpace())
|
||||
{
|
||||
ui.com_account.com_first_name.enter_first_name.text = DataMgr.PettyFirstName.Value;
|
||||
}
|
||||
if (!DataMgr.PettyLastName.Value.IsNullOrWhiteSpace())
|
||||
{
|
||||
ui.com_account.com_last_name.enter_last_name.text = DataMgr.PettyLastName.Value;
|
||||
}
|
||||
|
||||
ui.com_account.btn_confirm.SetClick(ConfirmClick);
|
||||
}
|
||||
|
||||
private void ConfirmClick()
|
||||
{
|
||||
var account = ui.com_account.com_email.enter_email.text.Replace(" ", "");
|
||||
if (account == "")
|
||||
{
|
||||
GameHelper.ShowTips("Please enter the correct account information", true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!GameHelper.CheckAccountValidly(account))
|
||||
{
|
||||
GameHelper.ShowTips("Please enter the correct account information", true);
|
||||
return;
|
||||
}
|
||||
|
||||
var fname = ui.com_account.com_first_name.enter_first_name.text.Replace(" ", "");
|
||||
if (!GameHelper.CheckNameValidly(fname))
|
||||
{
|
||||
GameHelper.ShowTips("Please enter the correct account information", true);
|
||||
return;
|
||||
}
|
||||
|
||||
var lname = ui.com_account.com_last_name.enter_last_name.text.Replace(" ", "");
|
||||
if (!GameHelper.CheckNameValidly(lname) && !AppConst.isPt())
|
||||
{
|
||||
GameHelper.ShowTips("Please enter the correct account information", true);
|
||||
return;
|
||||
}
|
||||
|
||||
DataMgr.PettyAccount.Value = account;
|
||||
DataMgr.PettyFirstName.Value = fname;
|
||||
DataMgr.PettyLastName.Value = lname;
|
||||
|
||||
GotoSecondConfirm(account, fname, lname);
|
||||
|
||||
}
|
||||
|
||||
private void GotoSecondConfirm( string account, string fname, string lname)
|
||||
{
|
||||
ui.state.selectedIndex = 4;
|
||||
PaymentMsg info = new PaymentMsg
|
||||
{
|
||||
email = account,
|
||||
first_name = fname,
|
||||
last_name = lname
|
||||
};
|
||||
|
||||
ui.com_second_confirm.text_account.SetVar("account", account).FlushVars();
|
||||
ui.com_second_confirm.text_first_name.SetVar("name", fname).FlushVars();
|
||||
ui.com_second_confirm.text_last_name.SetVar("name", lname).FlushVars();
|
||||
|
||||
ui.com_second_confirm.btn_confirm.SetClick(() =>
|
||||
{
|
||||
ui.com_second_confirm.btn_confirm.enabled = false;
|
||||
|
||||
NetApi.PayOutUserInfo<OrderState>(account,
|
||||
fname, lname, (isSuccess, obj) =>
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
GotoDetail();
|
||||
}
|
||||
else
|
||||
{
|
||||
GameHelper.ShowTips("Failed to save information., please try again");
|
||||
ui.com_second_confirm.btn_confirm.enabled = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private void GotoDetail()
|
||||
{
|
||||
ui.state.selectedIndex = 3;
|
||||
DataMgr.PettyState.Value = 3;
|
||||
|
||||
var pettyAmount = DataMgr.PettyAmount.Value;
|
||||
if (pettyAmount != 0)
|
||||
{
|
||||
ui.com_detail.text_amount.SetVar("num", GameHelper.Get102Str(pettyAmount)).FlushVars();
|
||||
}
|
||||
else
|
||||
{
|
||||
var num = GameHelper.GetCommonModel().SmallReward;
|
||||
ui.com_detail.text_amount.SetVar("num", GameHelper.Get102Str(num)).FlushVars();
|
||||
DataMgr.PettyAmount.Value = num;
|
||||
}
|
||||
|
||||
var pettyDateTime = DataMgr.PettyDateTime.Value;
|
||||
if (!pettyDateTime.IsNullOrWhiteSpace())
|
||||
{
|
||||
ui.com_detail.text_data.SetVar("data", pettyDateTime).FlushVars();
|
||||
}
|
||||
else
|
||||
{
|
||||
var dateTime = DateTime.Now.ToString("yyyy.MM.dd");
|
||||
ui.com_detail.text_data.SetVar("data",dateTime).FlushVars();
|
||||
DataMgr.PettyDateTime.Value = dateTime;
|
||||
}
|
||||
|
||||
var pettyOrderID = DataMgr.PettyOrderID.Value;
|
||||
if (!pettyOrderID.IsNullOrWhiteSpace())
|
||||
{
|
||||
ui.com_detail.text_order.SetVar("order", pettyOrderID).FlushVars();
|
||||
}
|
||||
else
|
||||
{
|
||||
string datePart = DateTime.Now.ToString("yyyyMMdd");
|
||||
System.Random random = new System.Random();
|
||||
string randomPart = random.Next(1000, 9999).ToString(); // 生成1000-9999之间的四位数
|
||||
ui.com_detail.text_order.SetVar("order",datePart + randomPart).FlushVars();
|
||||
|
||||
DataMgr.PettyOrderID.Value = datePart + randomPart;
|
||||
}
|
||||
|
||||
|
||||
ui.com_detail.text_email.SetVar("email",DataMgr.PettyAccount.Value).FlushVars();
|
||||
|
||||
var pettyDataLimit = DataMgr.PettyDataLimit.Value;
|
||||
if (pettyDataLimit != 0)
|
||||
{
|
||||
ui.com_detail.text_limit.SetVar("day", pettyDataLimit.ToString()).FlushVars();
|
||||
}
|
||||
else
|
||||
{
|
||||
var day = ConfigSystem.GetCommonConf().ProcessingTime;
|
||||
ui.com_detail.text_limit.SetVar("day", day.ToString()).FlushVars();
|
||||
DataMgr.PettyDataLimit.Value = day;
|
||||
}
|
||||
|
||||
if (IsPettyDataExpired())
|
||||
{
|
||||
ui.com_detail.btn_redeem.visible = true;
|
||||
ui.com_detail.btn_redeem.SetClick(() =>
|
||||
{
|
||||
Debug.Log($"click redeem code view----------------------");
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.RedeemCodeUI_Open);
|
||||
CtrlCloseUI();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public bool IsPettyDataExpired()
|
||||
{
|
||||
// 1. 获取保存的过期天数限制
|
||||
var pettyDataLimit = DataMgr.PettyDataLimit.Value;
|
||||
|
||||
// 2. 获取当前日期(去掉时分秒,只保留日期部分,避免当天误判)
|
||||
DateTime currentDate = DateTime.Now.Date;
|
||||
|
||||
// 3. 获取数据保存时的日期
|
||||
DateTime saveDate = DateTime.ParseExact(DataMgr.PettyDateTime.Value, "yyyy.MM.dd", System.Globalization.CultureInfo.InvariantCulture);
|
||||
|
||||
// 4. 计算时间差
|
||||
TimeSpan timeSpan = currentDate - saveDate;
|
||||
|
||||
// 5. 判断是否超出限制天数
|
||||
bool isExpired = timeSpan.TotalDays >= pettyDataLimit;
|
||||
|
||||
return isExpired;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3976c01df34446138c677b09d9acbe64
|
||||
timeCreated: 1766046260
|
||||
@@ -0,0 +1,71 @@
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class PettyAwardUICtrl : BaseUICtrl
|
||||
{
|
||||
private PettyAwardUI ui;
|
||||
private PettyAwardModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.PettyAwardUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.PettyAwardUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.PettyAwardModel) as PettyAwardModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new PettyAwardUI(this);
|
||||
ui.Open(args);
|
||||
}
|
||||
}
|
||||
|
||||
public override void CloseUI(object args = null)
|
||||
{
|
||||
if (ui != null && !ui.isClose)
|
||||
{
|
||||
ui.Close();
|
||||
}
|
||||
ui = 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: 8acb71d41fef451383c9046c42ba7a9d
|
||||
timeCreated: 1766046260
|
||||
@@ -1669,7 +1669,7 @@ namespace RedHotRoast
|
||||
float complte_progress = showResurgence();
|
||||
if (GameHelper.GetLevelstate() != 0)
|
||||
{
|
||||
// if ((complte_progress > ((float)ConfigSystem.GetConfig<CommonModel>().FailedGiftProgress / 100)) && !is_resurgence)
|
||||
// if ((complte_progress > ((float)ConfigSystem.GetCommonConf().FailedGiftProgress / 100)) && !is_resurgence)
|
||||
// {
|
||||
//
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ResurgenceUI_Open, complte_progress);
|
||||
@@ -1689,7 +1689,7 @@ namespace RedHotRoast
|
||||
}
|
||||
else
|
||||
{
|
||||
// if ((complte_progress > ((float)ConfigSystem.GetConfig<CommonModel>().FailedGiftProgress / 100)) && !is_resurgence)
|
||||
// if ((complte_progress > ((float)ConfigSystem.GetCommonConf().FailedGiftProgress / 100)) && !is_resurgence)
|
||||
// {
|
||||
//
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ResurgenceUI_Open, complte_progress);
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 976a8c4cb1d64dc7a3a7a01b79859171
|
||||
timeCreated: 1783666276
|
||||
@@ -0,0 +1,19 @@
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class SaveingPotCtrl : BaseCtrl
|
||||
{
|
||||
public static SaveingPotCtrl Instance { get; private set; }
|
||||
|
||||
private SaveingPotModel model;
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9e59681e9218143e58eea10a87070d4a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class SaveingPotModel : BaseModel
|
||||
{
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ffa8bfa81fde34182899a4958a8aa4c1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4f92e47328a7945b6a75b1bead2ad203
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,72 @@
|
||||
namespace RedHotRoast
|
||||
|
||||
{
|
||||
public class SaveingPotUICtrl : BaseUICtrl
|
||||
{
|
||||
private SaveingPotUI ui;
|
||||
private SaveingPotModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.SaveingPotUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.SaveingPotUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.SaveingPotModel) as SaveingPotModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new SaveingPotUI(this);
|
||||
ui.Open(args);
|
||||
}
|
||||
}
|
||||
|
||||
public override void CloseUI(object args = null)
|
||||
{
|
||||
if (ui != null && !ui.isClose)
|
||||
{
|
||||
ui.Close();
|
||||
}
|
||||
ui = 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,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dd17eb44157da4774b1a9293490c2550
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 623816ac26c74e7d995b543f35c411cf
|
||||
timeCreated: 1783665325
|
||||
@@ -0,0 +1,42 @@
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class StatementViewCtrl : BaseCtrl
|
||||
{
|
||||
public static StatementViewCtrl Instance { get; private set; }
|
||||
|
||||
private StatementViewModel model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
//model = ModuleManager.Instance..GetModel(ModelConst.FirstRewardModel) as FirstRewardModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
protected override void AddListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void AddServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4632715ec0e54eeea0b7d484a9b85252
|
||||
timeCreated: 1780455331
|
||||
@@ -0,0 +1,43 @@
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class StatementViewModel : 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: faf951d22aea4319860cef683fcbed35
|
||||
timeCreated: 1780455331
|
||||
@@ -0,0 +1,114 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
// using FGUI.G002_main;
|
||||
using Spine.Unity;
|
||||
using DG.Tweening;
|
||||
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class StatementViewUI : BaseUI
|
||||
{
|
||||
private StatementViewUICtrl ctrl;
|
||||
private StatementViewModel model;
|
||||
private FGUI.ZM_Lobby_03.com_statement ui;
|
||||
private Action closeCallback;
|
||||
private Action open_sign;
|
||||
private bool is_get = false;
|
||||
public StatementViewUI(StatementViewUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.StatementViewUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "ZM_Lobby_03";
|
||||
uiInfo.assetName = "com_statement";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
model = ModuleManager.Instance.GetModel(ModelConst.StatementViewModel) as StatementViewModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, true);
|
||||
|
||||
//open_sign();
|
||||
|
||||
if (GameHelper.IsShowOpenGameUI() &&HallManager.Instance.openTipsTimes == 1)
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.OpenGameUI_Open);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.ZM_Lobby_03.com_statement;
|
||||
}
|
||||
|
||||
private bool need_show = false;
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
HallManager.Instance.openTipsTimes++;
|
||||
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, false);
|
||||
|
||||
InitView();
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
//open_sign = (System.Action)args;
|
||||
}
|
||||
|
||||
protected override void OnHide()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDisplay(object args)
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
protected override void AddListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
//初始化页面逻辑
|
||||
private void InitView()
|
||||
{
|
||||
ui.list.scrollPane.onScrollEnd.Add(OnListScroll);
|
||||
ui.btn_back.SetClick(CtrlCloseUI);
|
||||
}
|
||||
|
||||
private void OnListScroll()
|
||||
{
|
||||
var pageIndex = ui.list.scrollPane.currentPageX;
|
||||
|
||||
if (pageIndex == 0)
|
||||
{
|
||||
ui.state1.state.selectedIndex = 1;
|
||||
ui.state2.state.selectedIndex = 0;
|
||||
}else if (pageIndex == 1)
|
||||
{
|
||||
ui.state1.state.selectedIndex = 0;
|
||||
ui.state2.state.selectedIndex = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 65fe960a02344337a6c757d93ecf0e2e
|
||||
timeCreated: 1780455331
|
||||
@@ -0,0 +1,71 @@
|
||||
namespace RedHotRoast
|
||||
{
|
||||
public class StatementViewUICtrl : BaseUICtrl
|
||||
{
|
||||
private StatementViewUI ui;
|
||||
private StatementViewModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.StatementViewUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.StatementViewUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.FirstRewardModel) as FirstRewardModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new StatementViewUI(this);
|
||||
ui.Open(args);
|
||||
}
|
||||
}
|
||||
|
||||
public override void CloseUI(object args = null)
|
||||
{
|
||||
if (ui != null && !ui.isClose)
|
||||
{
|
||||
ui.Close();
|
||||
}
|
||||
ui = 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: 8b350591ec8f41db9c3dda52f01b53c7
|
||||
timeCreated: 1780455331
|
||||
Reference in New Issue
Block a user