From efa5f8d07fc3321f6ac5f5d97fb422db28d0886f Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期二, 05 三月 2019 10:55:31 +0800
Subject: [PATCH] Merge branch 'master' into Equip
---
System/Dungeon/DungeonIntegralRankBehaviour.cs | 155 ++++++++++++++++++++++++++-------------------------
1 files changed, 80 insertions(+), 75 deletions(-)
diff --git a/System/Dungeon/DungeonIntegralRankBehaviour.cs b/System/Dungeon/DungeonIntegralRankBehaviour.cs
index bdc7ddb..b6fb964 100644
--- a/System/Dungeon/DungeonIntegralRankBehaviour.cs
+++ b/System/Dungeon/DungeonIntegralRankBehaviour.cs
@@ -1,76 +1,81 @@
-锘縰sing System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-using UnityEngine.UI;
-using System;
-using TableConfig;
-
-namespace Snxxz.UI
-{
- public class DungeonIntegralRankBehaviour : MonoBehaviour
- {
- [SerializeField] ScrollerController scrollerController;
- [SerializeField] Text m_SelfRankTxt;
- [SerializeField] Text m_SelfNameTxt;
- [SerializeField] Text m_SelfIntegralTxt;
- [SerializeField] AwardItemUI m_AwardItem;
- FairyLeagueModel m_FairyLeagueModel;
- FairyLeagueModel fairyLeagueModel
- {
- get
- {
- return m_FairyLeagueModel ?? (m_FairyLeagueModel = ModelCenter.Instance.GetModel<FairyLeagueModel>());
- }
- }
-
- private void OnEnable()
- {
- fairyLeagueModel.UpdateWarRankEvent += RefreshRank;
- RefreshRank();
- }
-
- private void RefreshRank()
- {
- scrollerController.Refresh();
- for (int i = 0; i < fairyLeagueModel.fairyLeagueResults.Count; i++)
- {
- scrollerController.AddCell(ScrollerDataType.Header, i);
- }
- scrollerController.Restart();
- RefreshSelf();
- }
-
- private void RefreshSelf()
- {
- var _index = fairyLeagueModel.fairyLeagueResults.FindIndex((x) =>
- {
- return x.PlayerId == PlayerDatas.Instance.PlayerId;
- });
- if (_index != -1)
- {
- m_SelfRankTxt.text = (_index + 1).ToString();
- m_SelfIntegralTxt.text = fairyLeagueModel.fairyLeagueResults[_index].Integral.ToString();
- m_SelfNameTxt.text = fairyLeagueModel.fairyLeagueResults[_index].PlayerName;
- }
- else
- {
- m_SelfRankTxt.text = Language.Get("FamilyMatchUnBeOnList");
- m_SelfIntegralTxt.text = "0";
- m_SelfNameTxt.text = PlayerDatas.Instance.baseData.PlayerName;
- }
- var rankKey = UIHelper.GetIntervalAward(fairyLeagueModel.integralRankAwardDict.Keys, _index + 1);
- if (rankKey != -1)
- {
- var _awardItem = fairyLeagueModel.integralRankAwardDict[rankKey][0];
- var _per = fairyLeagueModel.integralRankAwardPer[fairyLeagueModel.fairyLeagueGroupId - 1];
- var _count = (int)Mathf.Max(_awardItem.item.count * ((float)_per / 100), 1);
- m_AwardItem.Init(_awardItem.item.id, _count, _awardItem.isBind);
- }
- }
-
- private void OnDisable()
- {
- fairyLeagueModel.UpdateWarRankEvent -= RefreshRank;
- }
- }
+锘縰sing System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+using System;
+
+
+namespace Snxxz.UI
+{
+ public class DungeonIntegralRankBehaviour : MonoBehaviour
+ {
+ [SerializeField] ScrollerController scrollerController;
+ [SerializeField] Text m_SelfRankTxt;
+ [SerializeField] Text m_SelfNameTxt;
+ [SerializeField] Text m_SelfIntegralTxt;
+ [SerializeField] AwardItemUI m_AwardItem;
+ FairyLeagueModel m_FairyLeagueModel;
+ FairyLeagueModel fairyLeagueModel
+ {
+ get
+ {
+ return m_FairyLeagueModel ?? (m_FairyLeagueModel = ModelCenter.Instance.GetModel<FairyLeagueModel>());
+ }
+ }
+
+ private void OnEnable()
+ {
+ fairyLeagueModel.UpdateWarRankEvent += RefreshRank;
+ RefreshRank();
+ }
+
+ private void RefreshRank()
+ {
+ scrollerController.Refresh();
+ for (int i = 0; i < fairyLeagueModel.fairyLeagueResults.Count; i++)
+ {
+ scrollerController.AddCell(ScrollerDataType.Header, i);
+ }
+ scrollerController.Restart();
+ RefreshSelf();
+ }
+
+ private void RefreshSelf()
+ {
+ var _index = fairyLeagueModel.fairyLeagueResults.FindIndex((x) =>
+ {
+ return x.PlayerId == PlayerDatas.Instance.PlayerId;
+ });
+ if (_index != -1)
+ {
+ m_SelfRankTxt.text = (_index + 1).ToString();
+ m_SelfIntegralTxt.text = fairyLeagueModel.fairyLeagueResults[_index].Integral.ToString();
+ m_SelfNameTxt.text = fairyLeagueModel.fairyLeagueResults[_index].PlayerName;
+ }
+ else
+ {
+ m_SelfRankTxt.text = Language.Get("FamilyMatchUnBeOnList");
+ m_SelfIntegralTxt.text = "0";
+ m_SelfNameTxt.text = PlayerDatas.Instance.baseData.PlayerName;
+ }
+ var rankKey = UIHelper.GetIntervalAward(fairyLeagueModel.integralRankAwardDict.Keys, _index + 1);
+ if (rankKey != -1)
+ {
+ var _item = fairyLeagueModel.integralRankAwardDict[rankKey][0];
+ var _per = 100;
+ if ((fairyLeagueModel.fairyLeagueGroupId - 1) >= 0
+ && (fairyLeagueModel.fairyLeagueGroupId - 1) < fairyLeagueModel.integralRankAwardPer.Length)
+ {
+ _per = fairyLeagueModel.integralRankAwardPer[fairyLeagueModel.fairyLeagueGroupId - 1];
+ }
+ var _count = (int)Mathf.Max(_item.count * (_item.isPer == 1 ? ((float)_per / 100) : 1), 1);
+ m_AwardItem.Init(_item.id, _count, _item.bind);
+ }
+ }
+
+ private void OnDisable()
+ {
+ fairyLeagueModel.UpdateWarRankEvent -= RefreshRank;
+ }
+ }
}
\ No newline at end of file
--
Gitblit v1.8.0