731 lines
31 KiB
C#
731 lines
31 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using GCGame.Table;
|
|
using Module.Log;
|
|
|
|
public class NewRankRoot : MonoBehaviour {
|
|
|
|
public static NewRankRoot Instance;
|
|
private void Awake()
|
|
{
|
|
Instance = this;
|
|
}
|
|
|
|
private void OnDisable()
|
|
{
|
|
_CurSelectPanelIndex = -1;
|
|
isShowType = -1;
|
|
}
|
|
|
|
private void OnDestroy()
|
|
{
|
|
Instance = null;
|
|
}
|
|
|
|
public static int _CurSelectPanelIndex = -1;
|
|
public void ShowPanel(int index)
|
|
{
|
|
if (_CurSelectPanelIndex == index)
|
|
return;
|
|
_CurSelectPanelIndex = index;
|
|
SortRankDic();
|
|
InitMenuItemContainer();
|
|
}
|
|
|
|
private Dictionary<int, Dictionary<int, List<int>>> _AllRankDic;
|
|
public void SortRankDic()
|
|
{
|
|
if (_AllRankDic != null)
|
|
{
|
|
return;
|
|
}
|
|
_AllRankDic = new Dictionary<int, Dictionary<int, List<int>>>();
|
|
foreach (var tab in TableManager.GetRankInfo().Values)
|
|
{
|
|
if(tab.Type == 0 || tab.Type == 1)
|
|
{
|
|
var _PageIndex = tab.Type;
|
|
var itemClass = tab.SubType;
|
|
if(_AllRankDic.ContainsKey(_PageIndex))
|
|
{
|
|
if(_AllRankDic[_PageIndex].ContainsKey(itemClass))
|
|
{
|
|
if(tab.IsFolded != -1)
|
|
{
|
|
_AllRankDic[_PageIndex][itemClass].Add(tab.GetId());
|
|
}
|
|
}else{
|
|
List<int> subClasslist = new List<int>();
|
|
if (tab.IsFolded != -1)
|
|
subClasslist.Add(tab.GetId());
|
|
_AllRankDic[_PageIndex].Add(itemClass, subClasslist);
|
|
}
|
|
}else
|
|
{
|
|
List<int> subClassList = new List<int>();
|
|
if (tab.IsFolded != -1)
|
|
subClassList.Add(tab.GetId());
|
|
Dictionary<int, List<int>> subClassDic = new Dictionary<int, List<int>>();
|
|
subClassDic.Add(itemClass, subClassList);
|
|
_AllRankDic.Add(_PageIndex, subClassDic);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public void InitMenuItemContainer()
|
|
{
|
|
_MenuItemContainer.Clear();
|
|
if (_AllRankDic[_CurSelectPanelIndex] == null)
|
|
return;
|
|
foreach(var tab in _AllRankDic[_CurSelectPanelIndex])
|
|
{
|
|
_MenuItemContainer.PushMenu(tab.Key, tab.Value.ToArray());
|
|
}
|
|
|
|
if(isShowType == -1)
|
|
ShowDefaultFirst();
|
|
}
|
|
|
|
public void ShowDefaultFirst()
|
|
{
|
|
_MenuItemContainer.ShowDefaultFirst();
|
|
}
|
|
|
|
#region
|
|
public UISubScollMenu _MenuItemContainer;
|
|
public UICameraTexture _ModelCamera;
|
|
public UICameraTexture _PetUICameraTexture;
|
|
public Text _SelectRoleGuildName;
|
|
public GameObject _CombatValObj;
|
|
public UIImgText _SelectRoleCombat;
|
|
public Image _FakeImage;
|
|
public Text _Prof;
|
|
public Text _Prop;
|
|
public Text _SelfRank;
|
|
public Text _SelfProp;
|
|
public Text _SlefPropVal;
|
|
|
|
public GameObject _GuildNameObj;
|
|
public Text _GuildName;
|
|
public ProfessionSortTips _ProfessionSortPanel;
|
|
public UIContainerBase _RankInfoItemContainer;
|
|
#endregion
|
|
|
|
public int _CurSelectTabId = -1;
|
|
public void OnMenuItemClick(object tabId)
|
|
{
|
|
_CurSelectTabId = (int)tabId;
|
|
|
|
_RankInfoItemContainer.InitContentItem(null);
|
|
|
|
InitSpecialPropDesc();
|
|
ResetSortInfo();
|
|
}
|
|
|
|
public int _CurSelectPreofession = -1; //默认全部
|
|
public void ResetSortInfo()
|
|
{
|
|
_CurSelectPreofession = -1;
|
|
InitProfDesc();
|
|
OnProfessionBtn(_CurSelectPreofession);
|
|
}
|
|
|
|
public void OnProfessionBtn(int param)
|
|
{
|
|
_CurSelectPreofession = param;
|
|
if (param == -1)
|
|
{
|
|
_Prof.text = StrDictionary.GetClientDictionaryString("#{3087}");
|
|
}else
|
|
{
|
|
_Prof.text = GCGame.Utils.GetProfession(param);
|
|
}
|
|
|
|
var rankTab = TableManager.GetRankInfoByID(_CurSelectTabId, 0);
|
|
if(rankTab == null /*|| rankTab.IsFolded != -1*/)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if(param == -1)
|
|
{
|
|
CG_REQ_RANK_LIST send = (CG_REQ_RANK_LIST)PacketDistributed.CreatePacket(MessageID.PACKET_CG_REQ_RANK_LIST);
|
|
send.Ranktype = _CurSelectTabId;
|
|
send.SendPacket();
|
|
}else
|
|
{
|
|
_RankInfoItemContainer.InitContentItem(null);
|
|
if (_AllProfSortDic.ContainsKey(param))
|
|
{
|
|
if (_AllProfSortDic[param].Count > 0)
|
|
{
|
|
var rank = _AllProfSortDic[param][0]._Rank; //标记点击
|
|
_RankInfoItemContainer.InitContentItem(_AllProfSortDic[param]);
|
|
_RankInfoItemContainer.ForeachActiveItem<NewRanlnfoItem>((item) => {
|
|
if(item._RankNum == rank)
|
|
{
|
|
item.OnItemClick();
|
|
}
|
|
});
|
|
}
|
|
else
|
|
ShowFakeImage();
|
|
}else
|
|
{
|
|
ShowFakeImage();
|
|
}
|
|
}
|
|
}
|
|
|
|
public void InitProfDesc()
|
|
{
|
|
if(_CurSelectPreofession == -1)
|
|
{
|
|
_Prof.text = StrDictionary.GetClientDictionaryString("#{3087}");
|
|
}
|
|
else
|
|
{
|
|
_Prof.text = GCGame.Utils.GetProfession(_CurSelectPreofession);
|
|
}
|
|
}
|
|
|
|
private int _CurClassSpecialPropId = -1;
|
|
public void InitSpecialPropDesc()
|
|
{
|
|
var tab = TableManager.GetRankInfoByID(_CurSelectTabId, 0);
|
|
if (tab != null)
|
|
{
|
|
_CurClassSpecialPropId = tab.SpecialPropID;
|
|
_Prop.text = TableManager.GetRankProStrByID(tab.SpecialPropID, 0).ProStr;
|
|
_SelfProp.text = TableManager.GetRankProStrByID(tab.SpecialPropID, 0).ProStr + ":";
|
|
}
|
|
else
|
|
{
|
|
LogModule.ErrorLog("找不到RankInfoTab");
|
|
}
|
|
}
|
|
|
|
public void OnSortProfBtn()
|
|
{
|
|
if (!_ProfessionSortPanel.isActiveAndEnabled)
|
|
_ProfessionSortPanel.gameObject.SetActive(true);
|
|
}
|
|
|
|
public string GetModifiedStr(long num)
|
|
{
|
|
if (num >= 100000)
|
|
{
|
|
return StrDictionary.GetClientDictionaryString("#{2224}", ((float)num / 10000).ToString("F2"));
|
|
}
|
|
else
|
|
{
|
|
return num + "";
|
|
}
|
|
}
|
|
|
|
private List<NewRankInfoItemStruct> _AllRnakInfoList;
|
|
private Dictionary<int, List<NewRankInfoItemStruct>> _AllProfSortDic;
|
|
public void OnPacket(GC_RET_RANK_LIST packet)
|
|
{
|
|
_AllRnakInfoList = new List<NewRankInfoItemStruct>();
|
|
_AllProfSortDic = new Dictionary<int, List<NewRankInfoItemStruct>>();
|
|
|
|
var hasFindSelf = false;
|
|
for(int index = 0; index < packet.ranklistCount; index++)
|
|
{
|
|
var info = new NewRankInfoItemStruct(packet.ranklistList[index], index + 1);
|
|
var prof = RankWindowNew.Instance.GetProValueInt((int)RankWindowNew.RankPropID.UserProf, packet.GetRanklist(index));
|
|
var guid = RankWindowNew.Instance.GetProValueInt((int)RankWindowNew.RankPropID.UserGuid, packet.GetRanklist(index));
|
|
|
|
if((ulong)guid == GameManager.gameManager.PlayerDataPool.MainPlayerBaseAttr.Guid)
|
|
{
|
|
hasFindSelf = true;
|
|
_SelfRank.text = (index + 1) + "";
|
|
//switch (_CurSelectTabId)
|
|
//{
|
|
// case (int)RankWindowNew.RankType_T.Advance_0:
|
|
// {
|
|
// var _AdvanceGrade = RankWindowNew.Instance.GetProValueInt((int)RankWindowNew.RankPropID.UserAdvanceGrade, packet.ranklistList[index]);
|
|
// var _AdvanceStar = RankWindowNew.Instance.GetProValueInt((int)RankWindowNew.RankPropID.UserAdvanceStar, packet.ranklistList[index]);
|
|
// _SlefPropVal.text = StrDictionary.GetClientDictionaryString("#{43045}", _AdvanceGrade == -1 ? 0 : _AdvanceGrade, _AdvanceStar == -1 ? 0 : _AdvanceStar);
|
|
// }
|
|
// break;
|
|
// case (int)RankWindowNew.RankType_T.Advance_1:
|
|
// case (int)RankWindowNew.RankType_T.Advance_2:
|
|
// case (int)RankWindowNew.RankType_T.Advance_3:
|
|
// case (int)RankWindowNew.RankType_T.Advance_4:
|
|
// case (int)RankWindowNew.RankType_T.Advance_5:
|
|
// case (int)RankWindowNew.RankType_T.Advance_6:
|
|
// {
|
|
// var _AdvanceGrade = RankWindowNew.Instance.GetProValueInt((int)RankWindowNew.RankPropID.UserAdvanceGrade, packet.ranklistList[index]);
|
|
// _SlefPropVal.text = StrDictionary.GetClientDictionaryString("#{46518}", _AdvanceGrade == -1 ? 0 : _AdvanceGrade);
|
|
// }
|
|
// break;
|
|
// default:
|
|
// {
|
|
// if (!RankWindowNew.Instance.GetProValueStr(_CurClassSpecialPropId, packet.ranklistList[index]).Equals(""))
|
|
// {
|
|
// _SlefPropVal.text = RankWindowNew.Instance.GetProValueStr(_CurClassSpecialPropId, packet.ranklistList[index]);
|
|
// }
|
|
// else
|
|
// {
|
|
// _SlefPropVal.text = NewRankRoot.Instance.GetModifiedStr(RankWindowNew.Instance.GetProValueInt(_CurClassSpecialPropId, packet.ranklistList[index])) + "";
|
|
// }
|
|
// }
|
|
// break;
|
|
//}
|
|
if (!RankWindowNew.Instance.GetProValueStr(_CurClassSpecialPropId, packet.ranklistList[index]).Equals(""))
|
|
{
|
|
_SlefPropVal.text = RankWindowNew.Instance.GetProValueStr(_CurClassSpecialPropId, packet.ranklistList[index]);
|
|
}
|
|
else
|
|
{
|
|
_SlefPropVal.text = NewRankRoot.Instance.GetModifiedStr(RankWindowNew.Instance.GetProValueInt(_CurClassSpecialPropId, packet.ranklistList[index])) + "";
|
|
}
|
|
}
|
|
if (_AllProfSortDic.ContainsKey((int)prof))
|
|
{
|
|
_AllProfSortDic[(int)prof].Add(info);
|
|
}
|
|
else
|
|
{
|
|
List<NewRankInfoItemStruct> profList = new List<NewRankInfoItemStruct>();
|
|
profList.Add(info);
|
|
_AllProfSortDic.Add((int)prof, profList);
|
|
}
|
|
_AllRnakInfoList.Add(info);
|
|
}
|
|
|
|
if(!hasFindSelf)
|
|
{
|
|
_SelfRank.text = StrDictionary.GetClientDictionaryString("#{2049}");
|
|
//switch (_CurSelectTabId)
|
|
//{
|
|
// case (int)RankWindowNew.RankType_T.Advance_0:
|
|
// {
|
|
// var _AdvanceGrade = RankWindowNew.Instance.GetProValueInt((int)RankWindowNew.RankPropID.UserAdvanceGrade, packet.Myrankinfo);
|
|
// var _AdvanceStar = RankWindowNew.Instance.GetProValueInt((int)RankWindowNew.RankPropID.UserAdvanceStar, packet.Myrankinfo);
|
|
// _SlefPropVal.text = StrDictionary.GetClientDictionaryString("#{43045}", _AdvanceGrade, _AdvanceStar);
|
|
// }
|
|
// break;
|
|
// case (int)RankWindowNew.RankType_T.Advance_1:
|
|
// case (int)RankWindowNew.RankType_T.Advance_2:
|
|
// case (int)RankWindowNew.RankType_T.Advance_3:
|
|
// case (int)RankWindowNew.RankType_T.Advance_4:
|
|
// case (int)RankWindowNew.RankType_T.Advance_5:
|
|
// case (int)RankWindowNew.RankType_T.Advance_6:
|
|
// {
|
|
// var _AdvanceGrade = RankWindowNew.Instance.GetProValueInt((int)RankWindowNew.RankPropID.UserAdvanceGrade, packet.Myrankinfo);
|
|
// _SlefPropVal.text = StrDictionary.GetClientDictionaryString("#{46518}", _AdvanceGrade);
|
|
// }
|
|
// break;
|
|
// default:
|
|
// {
|
|
// if (!RankWindowNew.Instance.GetProValueStr(_CurClassSpecialPropId, packet.Myrankinfo).Equals(""))
|
|
// {
|
|
// _SlefPropVal.text = RankWindowNew.Instance.GetProValueStr(_CurClassSpecialPropId, packet.Myrankinfo);
|
|
// }
|
|
// else
|
|
// {
|
|
// _SlefPropVal.text = NewRankRoot.Instance.GetModifiedStr(RankWindowNew.Instance.GetProValueInt(_CurClassSpecialPropId, packet.Myrankinfo)) + "";
|
|
// }
|
|
// }
|
|
// break;
|
|
//}
|
|
|
|
if (!RankWindowNew.Instance.GetProValueStr(_CurClassSpecialPropId, packet.Myrankinfo).Equals(""))
|
|
{
|
|
_SlefPropVal.text = RankWindowNew.Instance.GetProValueStr(_CurClassSpecialPropId, packet.Myrankinfo);
|
|
}
|
|
else
|
|
{
|
|
_SlefPropVal.text = NewRankRoot.Instance.GetModifiedStr(RankWindowNew.Instance.GetProValueInt(_CurClassSpecialPropId, packet.Myrankinfo)) + "";
|
|
}
|
|
}
|
|
|
|
_RankInfoItemContainer.InitContentItem(_AllRnakInfoList);
|
|
|
|
if (_AllRnakInfoList.Count > 0)
|
|
{
|
|
_RankInfoItemContainer.ForeachActiveItem<NewRanlnfoItem>((item) =>
|
|
{
|
|
if (item._RankNum == 1)
|
|
{
|
|
item.OnItemClick();
|
|
return;
|
|
}
|
|
});
|
|
}else
|
|
{
|
|
//ShowFake
|
|
ShowFakeImage();
|
|
//switch(_CurSelectTabId)
|
|
// {
|
|
// case (int)RankWindowNew.RankType_T.Advance_0:
|
|
// case (int)RankWindowNew.RankType_T.Advance_0_Prof0:
|
|
// case (int)RankWindowNew.RankType_T.Advance_0_Prof1:
|
|
// case (int)RankWindowNew.RankType_T.Advance_0_Prof2:
|
|
// case (int)RankWindowNew.RankType_T.Advance_0_Prof3:
|
|
// {
|
|
// ShowFakeImage((int)AdvanceBase.AdvanceType.Ride);
|
|
// }
|
|
// break;
|
|
// case (int)RankWindowNew.RankType_T.Advance_2:
|
|
// case (int)RankWindowNew.RankType_T.Advance_2_Prof0:
|
|
// case (int)RankWindowNew.RankType_T.Advance_2_Prof1:
|
|
// case (int)RankWindowNew.RankType_T.Advance_2_Prof2:
|
|
// case (int)RankWindowNew.RankType_T.Advance_2_Prof3:
|
|
// {
|
|
// ShowFakeImage((int)AdvanceBase.AdvanceType.Wing);
|
|
// }
|
|
// break;
|
|
// case (int)RankWindowNew.RankType_T.Advance_1:
|
|
// case (int)RankWindowNew.RankType_T.Advance_1_Prof0:
|
|
// case (int)RankWindowNew.RankType_T.Advance_1_Prof1:
|
|
// case (int)RankWindowNew.RankType_T.Advance_1_Prof2:
|
|
// case (int)RankWindowNew.RankType_T.Advance_1_Prof3:
|
|
// case (int)RankWindowNew.RankType_T.Advance_3:
|
|
// case (int)RankWindowNew.RankType_T.Advance_3_Prof0:
|
|
// case (int)RankWindowNew.RankType_T.Advance_3_Prof1:
|
|
// case (int)RankWindowNew.RankType_T.Advance_3_Prof2:
|
|
// case (int)RankWindowNew.RankType_T.Advance_3_Prof3:
|
|
// case (int)RankWindowNew.RankType_T.Advance_4:
|
|
// case (int)RankWindowNew.RankType_T.Advance_4_Prof0:
|
|
// case (int)RankWindowNew.RankType_T.Advance_4_Prof1:
|
|
// case (int)RankWindowNew.RankType_T.Advance_4_Prof2:
|
|
// case (int)RankWindowNew.RankType_T.Advance_4_Prof3:
|
|
// case (int)RankWindowNew.RankType_T.Advance_5:
|
|
// case (int)RankWindowNew.RankType_T.Advance_5_Prof0:
|
|
// case (int)RankWindowNew.RankType_T.Advance_5_Prof1:
|
|
// case (int)RankWindowNew.RankType_T.Advance_5_Prof2:
|
|
// case (int)RankWindowNew.RankType_T.Advance_5_Prof3:
|
|
// case (int)RankWindowNew.RankType_T.Advance_6:
|
|
// case (int)RankWindowNew.RankType_T.Advance_6_Prof0:
|
|
// case (int)RankWindowNew.RankType_T.Advance_6_Prof1:
|
|
// case (int)RankWindowNew.RankType_T.Advance_6_Prof2:
|
|
// case (int)RankWindowNew.RankType_T.Advance_6_Prof3:
|
|
// {
|
|
// ShowFakeImage(_CurSelectTabId - 70);
|
|
// }
|
|
// break;
|
|
// case (int)RankWindowNew.RankType_T.PetScoreComposite:
|
|
// case (int)RankWindowNew.RankType_T.PetScoreProf0:
|
|
// case (int)RankWindowNew.RankType_T.PetScoreProf1:
|
|
// case (int)RankWindowNew.RankType_T.PetScoreProf2:
|
|
// case (int)RankWindowNew.RankType_T.PetScoreProf3:
|
|
// {
|
|
// ShowFakeImage(7);
|
|
// }
|
|
// break;
|
|
// default:
|
|
// {
|
|
// ShowFakeImage(8);
|
|
// }
|
|
// break;
|
|
// }
|
|
}
|
|
}
|
|
|
|
private RankElemStruct _ClickItemInfo;
|
|
public void OnItemClick(RankElemStruct info)
|
|
{
|
|
_ClickItemInfo = info;
|
|
InitModelCamera();
|
|
InitSelectRoleInfo();
|
|
|
|
_RankInfoItemContainer.ForeachActiveItem<NewRanlnfoItem>((item) => {
|
|
item.ShowMarkIcon(info == item.info);
|
|
});
|
|
}
|
|
|
|
public void InitSelectRoleInfo()
|
|
{
|
|
var guildName = RankWindowNew.Instance.GetProValueStr((int)RankWindowNew.RankPropID.GuildName, _ClickItemInfo);
|
|
if (!guildName.Equals(""))
|
|
{
|
|
_SelectRoleGuildName.text = guildName;
|
|
}
|
|
else
|
|
{
|
|
_SelectRoleGuildName.text = StrDictionary.GetClientDictionaryString("#{1965}");
|
|
}
|
|
|
|
switch(_CurSelectTabId)
|
|
{
|
|
case (int)RankWindowNew.RankType_T.Advance_0:
|
|
case (int)RankWindowNew.RankType_T.Advance_1:
|
|
case (int)RankWindowNew.RankType_T.Advance_2:
|
|
case (int)RankWindowNew.RankType_T.Advance_3:
|
|
case (int)RankWindowNew.RankType_T.Advance_4:
|
|
case (int)RankWindowNew.RankType_T.Advance_5:
|
|
case (int)RankWindowNew.RankType_T.Advance_6:
|
|
{
|
|
_SelectRoleCombat.text = RankWindowNew.Instance.GetProValueInt((int)RankWindowNew.RankPropID.AdvanceCombatValue, _ClickItemInfo).ToString();
|
|
}
|
|
break;
|
|
case (int)RankWindowNew.RankType_T.PetScoreComposite:
|
|
{
|
|
_SelectRoleCombat.text = RankWindowNew.Instance.GetProValueInt((int)RankWindowNew.RankPropID.UserPetScore, _ClickItemInfo).ToString();
|
|
}
|
|
break;
|
|
default:
|
|
{
|
|
_SelectRoleCombat.text = RankWindowNew.Instance.GetProValueInt((int)RankWindowNew.RankPropID.UserBattlePoint, _ClickItemInfo).ToString();
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
public void ShowFakeImage()
|
|
{
|
|
_ModelCamera.gameObject.transform.localPosition = new Vector3(999, 999, 0);
|
|
_PetUICameraTexture.gameObject.transform.localPosition = new Vector3(999, 999, 0);
|
|
_CombatValObj.SetActive(false);
|
|
_FakeImage.gameObject.SetActive(true);
|
|
|
|
var rankTab = TableManager.GetRankInfoByID(_CurSelectTabId, 0);
|
|
if(rankTab == null)
|
|
{
|
|
LogModule.ErrorLog("rankTab is null");
|
|
return;
|
|
}
|
|
LoadAssetBundle.Instance.SetImageSprite(_FakeImage, rankTab.FakeImg, (bool bSucess, GameObject obj) => {
|
|
_FakeImage.SetNativeSize();
|
|
});
|
|
}
|
|
|
|
public void InitModelCamera()
|
|
{
|
|
_CombatValObj.SetActive(true);
|
|
_ModelCamera.RemoveModel();
|
|
_PetUICameraTexture.RemoveModel();
|
|
//if(_ModelCamera._FakeObj != null)
|
|
//{
|
|
// _ModelCamera._FakeObj.Disable();
|
|
// _ModelCamera._FakeObj.Enable();
|
|
//}
|
|
_FakeImage.gameObject.SetActive(false);
|
|
switch (_CurSelectTabId)
|
|
{
|
|
case (int)RankWindowNew.RankType_T.Advance_0:
|
|
{
|
|
_ModelCamera.gameObject.transform.localPosition = Vector3.zero;
|
|
_PetUICameraTexture.gameObject.transform.localPosition = new Vector3(999, 999, 999);
|
|
_GuildNameObj.SetActive(false);
|
|
var _CurAdvanceGrade = RankWindowNew.Instance.GetProValueInt((int)RankWindowNew.RankPropID.UserAdvanceGrade, _ClickItemInfo);
|
|
if(_CurAdvanceGrade <= 0)
|
|
{
|
|
ShowFakeImage();
|
|
return;
|
|
}
|
|
//进阶坐骑MountBase
|
|
foreach(var tab in TableManager.GetAdvanceBase().Values)
|
|
{
|
|
var advanceType = (tab.Id - tab.Level) / 1000 - 1;
|
|
if(advanceType == (int)AdvanceBase.AdvanceType.Ride && tab.Grade == _CurAdvanceGrade)
|
|
{
|
|
var mountBase = TableManager.GetMountBaseByID(tab.ModelId, 0);
|
|
if(mountBase == null)
|
|
{
|
|
LogModule.ErrorLog("MoutnBase is null");
|
|
return;
|
|
}
|
|
|
|
var charMount = TableManager.GetCharMountByID(mountBase.ModelID, 0);
|
|
if(charMount == null)
|
|
{
|
|
LogModule.ErrorLog("CharMount is null");
|
|
return;
|
|
}
|
|
|
|
var sizeScale = float.Parse((charMount.BodyPos.Split(';')[2])) * 0.6f;
|
|
|
|
_ModelCamera.InitMountModelPath(charMount, delegate() {
|
|
_ModelCamera._FakeObj.renderCamera.orthographicSize = sizeScale;
|
|
});
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
case (int)RankWindowNew.RankType_T.Advance_2:
|
|
{
|
|
_ModelCamera.gameObject.transform.localPosition = Vector3.zero;
|
|
_PetUICameraTexture.gameObject.transform.localPosition = new Vector3(999, 999, 999);
|
|
_GuildNameObj.SetActive(false);
|
|
//进阶翅膀AuraConfig
|
|
var _CurAdvanceGrade = RankWindowNew.Instance.GetProValueInt((int)RankWindowNew.RankPropID.UserAdvanceGrade, _ClickItemInfo);
|
|
var profession = RankWindowNew.Instance.GetProValueInt((int)RankWindowNew.RankPropID.UserProf, _ClickItemInfo);
|
|
if (_CurAdvanceGrade <= 0)
|
|
{
|
|
ShowFakeImage();
|
|
return;
|
|
}
|
|
foreach (var tab in TableManager.GetAdvanceBase().Values)
|
|
{
|
|
var advanceType = (tab.Id - tab.Level) / 1000 - 1;
|
|
if(advanceType == (int)AdvanceBase.AdvanceType.Wing && tab.Grade == _CurAdvanceGrade)
|
|
{
|
|
_ModelCamera.InitWingModelPath(tab, null, ()=> {
|
|
|
|
//var auraConfig = TableManager.GetAuraConfigByID(tab.Value[0].ModelId, 0);
|
|
//if (auraConfig == null)
|
|
// return;
|
|
|
|
//var charModel = TableManager.GetCharModelByID(auraConfig.TianJiWingModelId, 0);
|
|
//if (charModel == null)
|
|
// return;
|
|
|
|
//var sizeScale = float.Parse((charModel.BodyPos.Split(';')[2])) * 0.8f; //其实我觉得1.3f就可以
|
|
|
|
_ModelCamera._FakeObj.renderCamera.orthographicSize = 1.3f;
|
|
});
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
case (int)RankWindowNew.RankType_T.Advance_1:
|
|
case (int)RankWindowNew.RankType_T.Advance_3:
|
|
case (int)RankWindowNew.RankType_T.Advance_4:
|
|
case (int)RankWindowNew.RankType_T.Advance_5:
|
|
case (int)RankWindowNew.RankType_T.Advance_6:
|
|
{
|
|
_ModelCamera.gameObject.transform.localPosition = Vector3.zero;
|
|
_PetUICameraTexture.gameObject.transform.localPosition = new Vector3(999, 999, 999);
|
|
_GuildNameObj.SetActive(false);
|
|
//其它进阶CharModel表
|
|
var _CurAdvanceGrade = RankWindowNew.Instance.GetProValueInt((int)RankWindowNew.RankPropID.UserAdvanceGrade, _ClickItemInfo);
|
|
if (_CurAdvanceGrade <= 0)
|
|
{
|
|
ShowFakeImage();
|
|
return;
|
|
}
|
|
|
|
var _CurAdvanceType = _CurSelectTabId - 71;
|
|
foreach (var tab in TableManager.GetAdvanceBase().Values)
|
|
{
|
|
var advanceType = (tab.Id - tab.Level) / 1000 - 1;
|
|
if (advanceType == _CurAdvanceType && tab.Grade == _CurAdvanceGrade)
|
|
{
|
|
var charModel = TableManager.GetCharModelByID(tab.ModelId, 0);
|
|
if(charModel == null)
|
|
{
|
|
LogModule.ErrorLog("charModel is null");
|
|
return;
|
|
}
|
|
|
|
var sizeScale = float.Parse((charModel.BodyPos.Split(';')[2])) * 0.7f;
|
|
_ModelCamera.InitModelPath(charModel.ResPath, charModel, LoadAssetBundle.BUNDLE_PATH_MODEL, true, delegate() {
|
|
_ModelCamera._FakeObj.renderCamera.orthographicSize = sizeScale;
|
|
}, true);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
case (int)RankWindowNew.RankType_T.PetScoreComposite:
|
|
case (int)RankWindowNew.RankType_T.PetScoreProf0:
|
|
case (int)RankWindowNew.RankType_T.PetScoreProf1:
|
|
case (int)RankWindowNew.RankType_T.PetScoreProf2:
|
|
case (int)RankWindowNew.RankType_T.PetScoreProf3:
|
|
{
|
|
_ModelCamera.gameObject.transform.localPosition = new Vector3(999, 999, 999);
|
|
_PetUICameraTexture.gameObject.transform.localPosition = Vector3.zero;
|
|
_GuildNameObj.SetActive(false);
|
|
//宠物表
|
|
var fellowBaseId = RankWindowNew.Instance.GetProValueInt((int)RankWindowNew.RankPropID.FellowId, _ClickItemInfo);
|
|
var fellowBase = TableManager.GetFellowBaseByID((int)fellowBaseId, 0);
|
|
if(fellowBase == null)
|
|
{
|
|
LogModule.ErrorLog("fellowBase is null");
|
|
return;
|
|
}
|
|
var charModel = TableManager.GetCharModelByID((int)fellowBase.ModelId, 0);
|
|
if (charModel == null)
|
|
return;
|
|
|
|
var sizeScale = float.Parse(charModel.BodyPos.Split(';')[2]) * 0.65f;
|
|
_PetUICameraTexture.InitModelPath(charModel.ResPath, charModel, LoadAssetBundle.BUNDLE_PATH_PET, true);
|
|
//delegate ()
|
|
//{
|
|
// _ModelCamera._FakeObj.FakeObj.transform.localPosition = new Vector3(_ModelCamera._FakeObj.FakeObj.transform.localPosition.x,
|
|
// _ModelCamera._FakeObj.FakeObj.transform.localPosition.y * 0.8f, _ModelCamera._FakeObj.FakeObj.transform.localPosition.z);
|
|
// _ModelCamera._FakeObj.renderCamera.orthographicSize = sizeScale;
|
|
//}, true
|
|
}
|
|
break;
|
|
default:
|
|
{
|
|
_ModelCamera.gameObject.transform.localPosition = Vector3.zero;
|
|
_PetUICameraTexture.gameObject.transform.localPosition = new Vector3(999, 999, 999);
|
|
_GuildNameObj.SetActive(true);
|
|
_GuildName.text = RankWindowNew.Instance.GetProValueStr((int)RankWindowNew.RankPropID.GuildName, _ClickItemInfo);
|
|
//人物模型
|
|
var profession = RankWindowNew.Instance.GetProValueInt((int)RankWindowNew.RankPropID.UserProf, _ClickItemInfo);
|
|
var advanceWingId = RankWindowNew.Instance.GetProValueInt((int)RankWindowNew.RankPropID.Wing, _ClickItemInfo);
|
|
var modelId = GlobalData.GetCharModelId((int)profession, (int)RankWindowNew.Instance.GetProValueInt((int)RankWindowNew.RankPropID.FashionId, _ClickItemInfo));
|
|
var weaponFashionId = RankWindowNew.Instance.GetProValueInt((int)RankWindowNew.RankPropID.WeaponId, _ClickItemInfo);
|
|
var auraWingId = RankWindowNew.Instance.GetProValueInt((int)RankWindowNew.RankPropID.AuraWingId, _ClickItemInfo);
|
|
var effectId = RankWindowNew.Instance.GetProValueInt((int)RankWindowNew.RankPropID.EffectId, _ClickItemInfo);
|
|
_ModelCamera.InitModel((int)profession, modelId, (int)weaponFashionId, (int)auraWingId, -1, (int)effectId, (int)advanceWingId);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
public int isShowType = -1;
|
|
public void ShowMenuItem(int type)
|
|
{
|
|
isShowType = type;
|
|
foreach (var subMenu in _MenuItemContainer.SubBtns)
|
|
{
|
|
RankClassMenuItem rankItem1 = subMenu.Key as RankClassMenuItem;
|
|
if (rankItem1.MenuObj.Equals(type))
|
|
{
|
|
_MenuItemContainer.ShowMenu(type);
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
foreach (var subMenu2 in subMenu.Value)
|
|
{
|
|
RankSubClassMenuItem rankItem2 = subMenu2 as RankSubClassMenuItem;
|
|
if (rankItem2.MenuObj.Equals(type))
|
|
{
|
|
_MenuItemContainer.ShowMenu(rankItem1.MenuObj, type);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//if (_AllRankDic[_CurSelectPanelIndex].ContainsKey(type))
|
|
//{
|
|
// _MenuItemContainer.ShowMenu(type);
|
|
//}
|
|
//else
|
|
//{
|
|
// int mainType = -1;
|
|
// foreach (var typePair in _AllRankDic[_CurSelectPanelIndex])
|
|
// {
|
|
// for (int i = 0; i < typePair.Value.Count; ++i)
|
|
// {
|
|
// if (typePair.Value[i] == type)
|
|
// {
|
|
// mainType = typePair.Key;
|
|
// break;
|
|
// }
|
|
// }
|
|
// if (mainType > 0)
|
|
// break;
|
|
// }
|
|
// if (mainType > 0)
|
|
// _MenuItemContainer.ShowMenu(-1, type);
|
|
//}
|
|
//isShowType = -1;
|
|
}
|
|
}
|