|
@@ -88,6 +88,7 @@ namespace GFGGame
|
|
|
_valueBarController.OnShown();
|
|
|
_dataManager.SetMineFightAttr();
|
|
|
|
|
|
+ if (_dataManager.DressupList.Count == 0) return;
|
|
|
InstanceZonesDataManager.FightScene = ConstInstanceZonesType.Arena;
|
|
|
if (_targetData == null)
|
|
|
{
|
|
@@ -116,7 +117,7 @@ namespace GFGGame
|
|
|
_copyDressUpObj.setSceneObj(sceneCopyObject, false, false);
|
|
|
}
|
|
|
sceneCopyObject.SetActive(true);
|
|
|
- for (int i = 0; i < ArenaDataManager.Instance.ThemeList.Count; i++)
|
|
|
+ for (int i = 0; i < _dataManager.ThemeList.Count; i++)
|
|
|
{
|
|
|
Timers.inst.StartCoroutine(ScreenShotTex(i));
|
|
|
}
|
|
@@ -176,7 +177,7 @@ namespace GFGGame
|
|
|
}
|
|
|
private void OnBtnAddFightCountClick()
|
|
|
{
|
|
|
- if (ArenaDataManager.Instance.IsArenaClearing)
|
|
|
+ if (_dataManager.IsArenaClearing)
|
|
|
{
|
|
|
PromptController.Instance.ShowFloatTextPrompt("结算中......");
|
|
|
return;
|
|
@@ -201,7 +202,7 @@ namespace GFGGame
|
|
|
}
|
|
|
private async void OnBtnRefreshClick()
|
|
|
{
|
|
|
- if (ArenaDataManager.Instance.IsArenaClearing)
|
|
|
+ if (_dataManager.IsArenaClearing)
|
|
|
{
|
|
|
PromptController.Instance.ShowFloatTextPrompt("结算中......");
|
|
|
return;
|
|
@@ -223,12 +224,12 @@ namespace GFGGame
|
|
|
}
|
|
|
private void OnBtnDressClick()
|
|
|
{
|
|
|
- if (ArenaDataManager.Instance.IsArenaClearing)
|
|
|
+ if (_dataManager.IsArenaClearing)
|
|
|
{
|
|
|
PromptController.Instance.ShowFloatTextPrompt("结算中......");
|
|
|
return;
|
|
|
}
|
|
|
- ViewManager.Show<ArenaDressInfoView>(new object[] { FightRoleType.MINE, 0, _dataManager.DressupList }, new object[] { typeof(ArenaView).FullName, _targetData }, true);
|
|
|
+ ViewManager.Show<ArenaDressInfoView>(new object[] { FightRoleType.MINE, 0, _dataManager.DressupList, "" }, new object[] { typeof(ArenaView).FullName, this.viewData }, true);
|
|
|
}
|
|
|
|
|
|
private void OnBtnQuickFightClick()
|
|
@@ -245,6 +246,11 @@ namespace GFGGame
|
|
|
|
|
|
private async void OnBtnFightClick()
|
|
|
{
|
|
|
+ if (_dataManager.IsArenaClearing)
|
|
|
+ {
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt("结算中......");
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (RoleDataManager.ArenaFightTimes <= 0)
|
|
|
{
|
|
|
PromptController.Instance.ShowFloatTextPrompt("挑战次数不足");
|
|
@@ -259,7 +265,8 @@ namespace GFGGame
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- await GetFightResult();
|
|
|
+ bool result = await GetFightResult();
|
|
|
+ if (!result) return;
|
|
|
if (_ui.m_btnQuickFight.selected)
|
|
|
{
|
|
|
ViewManager.Show<ArenaResultQuickView>();
|
|
@@ -269,7 +276,7 @@ namespace GFGGame
|
|
|
ViewManager.Show<StoryFightTargetView>(null, null, true);
|
|
|
}
|
|
|
}
|
|
|
- private async ETTask GetFightResult()
|
|
|
+ private async ETTask<bool> GetFightResult()
|
|
|
{
|
|
|
_dataManager.myScore.Clear();
|
|
|
_dataManager.targetScore.Clear();
|
|
@@ -277,14 +284,17 @@ namespace GFGGame
|
|
|
_dataManager.targetFightScore.Clear();
|
|
|
|
|
|
int winCount = 0;
|
|
|
-
|
|
|
+ if (_targetData.Type == FightTargetType.PLAYER)
|
|
|
+ {
|
|
|
+ await ArenaSproxy.ReqArenaFightAttr(_targetData.RoleInfo.roleId, _targetData.FightDatas);
|
|
|
+ }
|
|
|
for (int i = 0; i < _dataManager.ThemeList.Count; i++)
|
|
|
{
|
|
|
long score = 0;
|
|
|
long targetScore = 0;
|
|
|
|
|
|
|
|
|
- FightDataManager.Instance.GetQuickFightResult(i, ArenaDataManager.Instance.DressupList[i], _targetData.FightDatas[i], out score, out targetScore);
|
|
|
+ FightDataManager.Instance.GetQuickFightResult(i, _dataManager.DressupList[i], _targetData.FightDatas[i], out score, out targetScore);
|
|
|
|
|
|
_dataManager.myScore.Add(score);
|
|
|
_dataManager.targetScore.Add(targetScore);
|
|
@@ -293,7 +303,7 @@ namespace GFGGame
|
|
|
|
|
|
_dataManager.myFightScore = _dataManager.GetFightScoreList(_dataManager.DressupList);
|
|
|
_dataManager.targetFightScore = _dataManager.GetFightScoreList(_targetData.FightDatas);
|
|
|
- await ArenaSproxy.ReqArenaFight(winCount >= 2, _targetData, _dataManager.myFightScore, _dataManager.targetFightScore, _dataManager.myScore, _dataManager.targetScore);
|
|
|
+ return await ArenaSproxy.ReqArenaFight(winCount >= 2, _targetData, _dataManager.myFightScore, _dataManager.targetFightScore, _dataManager.myScore, _dataManager.targetScore);
|
|
|
}
|
|
|
private void UpdateView()
|
|
|
{
|
|
@@ -415,6 +425,7 @@ namespace GFGGame
|
|
|
{
|
|
|
int index = (int)(context.sender as GObject).data;
|
|
|
_targetData = _dataManager.Targets[index];
|
|
|
+ this.viewData = _targetData;
|
|
|
_dataManager.SelectTargetIndex = index;
|
|
|
|
|
|
_ui.m_c1.selectedIndex = 1;
|
|
@@ -429,7 +440,7 @@ namespace GFGGame
|
|
|
PromptController.Instance.ShowFloatTextPrompt("玩家不在线");
|
|
|
return;
|
|
|
}
|
|
|
- ViewManager.Show<ArenaDressInfoView>(new object[] { FightRoleType.TAEGET, 0, targetData.FightDatas }, new object[] { typeof(ArenaView).FullName, _targetData }, true);
|
|
|
+ ViewManager.Show<ArenaDressInfoView>(new object[] { FightRoleType.TAEGET, 0, targetData.FightDatas, "" }, new object[] { typeof(ArenaView).FullName, this.viewData }, true);
|
|
|
}
|
|
|
|
|
|
private IEnumerator ScreenShotTex(int index)
|
|
@@ -440,7 +451,7 @@ namespace GFGGame
|
|
|
|
|
|
GameObject gameObject = _sceneObject.transform.Find("FightCamera").gameObject;
|
|
|
Camera camera = gameObject.GetComponent<Camera>();
|
|
|
- ArenaDataManager.Instance.TextureDic[index] = FightDataManager.Instance.GetPrintscreenNTexture(camera);
|
|
|
+ _dataManager.TextureDic[index] = FightDataManager.Instance.GetPrintscreenNTexture(camera);
|
|
|
|
|
|
yield return new WaitForEndOfFrame();
|
|
|
}
|