fix:1、添加arrow的游戏代码,和相关的周边功能
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user