//--------------------------------------------------------
|
// [Author]: 第二世界
|
// [ Date ]: Monday, January 28, 2019
|
//--------------------------------------------------------
|
|
using System;
|
using UnityEngine;
|
using UnityEngine.UI;
|
using vnxbqy.UI;
|
using System.Collections.Generic;
|
using LitJson;
|
|
public class CrossServerQualifyingHallOfFameCell : ILBehaviour
|
{
|
RawImage rawPlayer;
|
Text familyName;
|
Text playerName;
|
ButtonEx worshipButton;
|
Text count;
|
Transform doubleObj;
|
|
RoleParticularModel model { get { return ModelCenter.Instance.GetModel<RoleParticularModel>(); } }
|
protected override void Awake()
|
{
|
rawPlayer = proxy.GetWidgtEx<RawImage>("Raw_Player");
|
familyName = proxy.GetWidgtEx<Text>("Txt_FairyName");
|
playerName = proxy.GetWidgtEx<Text>("Txt_PlayerName");
|
worshipButton = proxy.GetWidgtEx<ButtonEx>("worshipButton");
|
count = proxy.GetWidgtEx<Text>("count");
|
doubleObj = proxy.GetWidgtEx<Transform>("double");
|
}
|
|
public void Display(int id)
|
{
|
var offcialInfo = CrossServerQualifyingModel.Instance.rankOfficialDict[id];
|
var playerID = CrossServerQualifyingModel.Instance.GetOfficialPlayer(id).PlayerID;
|
count.text = Language.Get("CrossServerQualifying66") + " " + offcialInfo.WorshipCount;
|
|
if (offcialInfo.WorshipDouble == 1 && TimeUtility.ServerNow.Hour == CrossServerQualifyingModel.Instance.doubleTimeArr[0][0])
|
{
|
doubleObj.SetActiveIL(true);
|
}
|
else
|
{
|
doubleObj.SetActiveIL(false);
|
}
|
worshipButton.SetActiveIL(true);
|
worshipButton.interactable = CrossServerQualifyingModel.Instance.worshipCntToday < CrossServerQualifyingModel.Instance.worshipMaxCnt;
|
worshipButton.SetListener(()=> {
|
if (CrossServerQualifyingModel.Instance.worshipCntToday >= CrossServerQualifyingModel.Instance.worshipMaxCnt)
|
return;
|
var pack = new IL_CC123_tagCMChampionshipWorship();
|
pack.ZoneID = (byte)CrossServerQualifyingModel.Instance.officialZoneID;
|
pack.PlayerID = playerID;
|
GameNetSystem.Instance.SendInfo(pack);
|
});
|
|
var viewPlayerData = model.GetViewPlayerData((int)playerID);
|
|
if (viewPlayerData != null)
|
{
|
//var realmLv = viewPlayerData.rolePropData.RealmLV;
|
//realmImg.SetActive(false);
|
//if (realmLv > 0)
|
//{
|
// RealmConfig realmConfig = RealmConfig.Get(realmLv);
|
// if (realmConfig != null)
|
// {
|
// realmImg.SetSprite(realmConfig.Img);
|
// }
|
//}
|
playerName.text = StringUtility.Contact(viewPlayerData.rolePropData.Name, "Lv. ", viewPlayerData.rolePropData.LV);
|
|
if (viewPlayerData.rolePropData.FamilyID == 0)
|
{
|
familyName.SetActive(false);
|
}
|
else
|
{
|
familyName.SetActive(true);
|
familyName.text = StringUtility.Contact(Language.Get("RoleParticularWin_1"),
|
viewPlayerData.rolePropData.FamilyName);
|
}
|
|
int _suitLevel = (int)(viewPlayerData.rolePropData.EquipShowSwitch % 10);
|
int clothes = viewPlayerData.GetItemId(RoleEquipType.Clothes);
|
int weapon = viewPlayerData.GetItemId(RoleEquipType.Weapon);
|
int wing = viewPlayerData.GetItemId(RoleEquipType.Wing);
|
int weapon2 = viewPlayerData.GetItemId(RoleEquipType.Weapon2);
|
int fashionClothes = viewPlayerData.GetItemId(RoleEquipType.FashionClothes);
|
int fashionWeapon = viewPlayerData.GetItemId(RoleEquipType.FashionWeapon);
|
int fashionWeapon2 = viewPlayerData.GetItemId(RoleEquipType.FashionWeapon2);
|
var reikiRootEffectId = viewPlayerData.rolePropData.EquipShowSwitch / 1000 % 1000;
|
|
var data = new UI3DPlayerExhibitionData
|
{
|
job = viewPlayerData.rolePropData.Job,
|
fashionClothesId = fashionClothes,
|
fashionWeaponId = fashionWeapon,
|
fashionSecondaryId = fashionWeapon2,
|
clothesId = clothes,
|
suitLevel = _suitLevel,
|
weaponId = weapon,
|
wingsId = wing,
|
secondaryId = weapon2,
|
reikiRootEffectId = (int)reikiRootEffectId,
|
isDialogue = false,
|
equipLevel = (int)viewPlayerData.rolePropData.EquipShowSwitch / 10 % 100,
|
titleID = viewPlayerData.rolePropData.TitleID,
|
};
|
|
rawPlayer.SetActive(true);
|
if (id == 1)
|
{
|
UI3DModelExhibition.Instance.ShowPlayer(rawPlayer, data);
|
}
|
else if (id == 2)
|
{
|
UI3DModelExhibition.InstanceClone1.ShowPlayer(rawPlayer, data);
|
}
|
else if (id == 3)
|
{
|
UI3DModelExhibition.InstanceClone2.ShowPlayer(rawPlayer, data);
|
}
|
else if (id == 4)
|
{
|
UI3DModelExhibition.InstanceClone3.ShowPlayer(rawPlayer, data);
|
}
|
else if (id == 5)
|
{
|
UI3DModelExhibition.InstanceClone4.ShowPlayer(rawPlayer, data);
|
}
|
else if (id == 6)
|
{
|
UI3DModelExhibition.InstanceClone5.ShowPlayer(rawPlayer, data);
|
}
|
else if (id == 7)
|
{
|
UI3DModelExhibition.InstanceClone6.ShowPlayer(rawPlayer, data);
|
}
|
else if (id == 8)
|
{
|
UI3DModelExhibition.InstanceClone7.ShowPlayer(rawPlayer, data);
|
}
|
rawPlayer.raycastTarget = false;
|
}
|
else
|
{
|
//CrossServerQualifyingModel.Instance.QueryKaiKingInfo(playerID);
|
//Debug.Log("名人堂单独查询");
|
playerName.text = string.Empty;
|
familyName.text = string.Empty;
|
worshipButton.SetActiveIL(false);
|
rawPlayer.SetActiveIL(false);
|
count.text = string.Empty;
|
doubleObj.SetActiveIL(false);
|
}
|
}
|
|
}
|