//--------------------------------------------------------
|
// [Author]: 第二世界
|
// [ Date ]: Friday, January 05, 2018
|
//--------------------------------------------------------
|
|
using Snxxz.UI;
|
using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
using UnityEngine.UI;
|
//坐骑面板
|
namespace Snxxz.UI
|
{
|
|
public class MountWin : Window
|
{
|
[SerializeField] ScrollerController m_ScrollerController;
|
[SerializeField] Button m_MountHunBtn;//坐骑兽魂按钮
|
[SerializeField] Button m_DeblockingBtton;//解锁按钮
|
[SerializeField] Button m_TrainBtn_1;//坐骑驯养1颗
|
[SerializeField] Button m_AutoTrainBtn;//自动驯养
|
[SerializeField] Button m_StopDomesticateBtn;//停止驯养
|
|
[SerializeField] MountPanelAssignment m_MountPanelAssignment;
|
[SerializeField] UIEffect m_UieffectLVUp;//坐骑升级
|
[SerializeField] PositionTween m_PositionTweenLVUp;
|
[SerializeField] Text m_MountName;//被选中的坐骑名
|
|
[SerializeField] Button m_PropertyButton1;//坐骑属性按钮
|
[SerializeField] Button m_PropertyButton2;//坐骑属性按钮
|
List<HorseConfig> sortMountlist = new List<HorseConfig>();//坐骑顺序排列
|
public int signHorseID = 0;//用来标记坐骑ID
|
private int mountDanId = 0;//消耗品坐骑丹ID
|
private int mountDanExp = 0;//消耗品坐骑丹经验值
|
public bool Ismultiplicity = false;//是否多倍
|
public bool IsFairyJade = false;
|
public AchievementGuideEffect AchievementGuideEffect1;
|
public AchievementGuideEffect AchievementGuideEffect2;
|
private int MountLv = 0;
|
List<HorseSkillClass> MountSkills = new List<HorseSkillClass>();
|
[SerializeField] Vector3 m_Vector3 = new Vector3(1.8f, 1.8f, 1.8f);
|
|
private float LatencyTime = 0;//等待时间
|
|
#region Built-in
|
|
PackModel _playerPack;
|
PackModel playerPack { get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PackModel>()); } }
|
MountModel m_MountModel;
|
MountModel mountModel { get { return m_MountModel ?? (m_MountModel = ModelCenter.Instance.GetModel<MountModel>()); } }
|
RidingAndPetActivationModel ridingAndPetActivationModel { get { return ModelCenter.Instance.GetModel<RidingAndPetActivationModel>(); } }
|
|
public static event Action RedPointMountDan;
|
static int StringToHash = Animator.StringToHash("Action");
|
protected override void BindController()
|
{
|
var config = FuncConfigConfig.Get("HorseUpItem");
|
mountDanId = int.Parse(config.Numerical1);
|
mountDanExp = int.Parse(config.Numerical2);
|
}
|
|
protected override void AddListeners()
|
{
|
m_MountHunBtn.AddListener(OnClickMountHunButton);
|
m_DeblockingBtton.AddListener(OnClickDeblockingBtton);
|
m_TrainBtn_1.AddListener(OnClickTrainBtn);
|
m_AutoTrainBtn.AddListener(OnClickAutoTrainBtn);
|
m_StopDomesticateBtn.AddListener(OnClickStopDomesticateBtn);
|
m_PropertyButton1.AddListener(OnClickPropertyButton);
|
m_PropertyButton2.AddListener(OnClickPropertyButton);
|
}
|
|
|
protected override void OnPreOpen()
|
{
|
mountModel.Wait = true;
|
MountModel.Event_MountAlteration += OnMountAlteration;
|
MountModel.Event_MountHA301U += OnMountUpdate;
|
MountModel.Event_MountHA301A += OnMountAdd;
|
MountModel.OnMountUieffectUpLv += OnMountUieffectUpLv;
|
RidingAndPetActivationWin.FairyJadeDEvent += FairyJadeDEvent;
|
FlySkillIconWin.FairyJadeDEvent += FairyJadeDEvent;
|
m_ScrollerController.OnRefreshCell += OnRefreshGridCell;
|
ToAddSorting();
|
DefaultOption();
|
SetHorseID();
|
OnCreateGridLineCell(m_ScrollerController);
|
m_ScrollerController.JumpIndex(JumpIndex());
|
}
|
protected override void OnActived()
|
{
|
base.OnActived();
|
}
|
protected override void OnAfterOpen()
|
{
|
HandleAchievement();
|
}
|
|
protected override void OnPreClose()
|
{
|
AchievementGoto.achievementType = 0;
|
MountModel.Event_MountAlteration -= OnMountAlteration;
|
MountModel.Event_MountHA301U -= OnMountUpdate;
|
MountModel.Event_MountHA301A -= OnMountAdd;
|
m_ScrollerController.OnRefreshCell -= OnRefreshGridCell;
|
MountModel.OnMountUieffectUpLv -= OnMountUieffectUpLv;
|
RidingAndPetActivationWin.FairyJadeDEvent -= FairyJadeDEvent;
|
FlySkillIconWin.FairyJadeDEvent -= FairyJadeDEvent;
|
OnClickStopDomesticateBtn();
|
UI3DModelExhibition.Instance.StopShow();
|
}
|
|
protected override void LateUpdate()
|
{
|
base.LateUpdate();
|
}
|
private void FairyJadeDEvent()
|
{
|
FairyJadeDomesticate();
|
}
|
|
protected override void OnAfterClose()
|
{
|
if (PlayerDatas.Instance.baseData.LV >= 1500 && RedPointMountDan != null)
|
{
|
RedPointMountDan();
|
}
|
if (ItemOperateUtility.Instance.useItemModel != null)//跳轉選中
|
{
|
ItemOperateUtility.Instance.useItemModel = null;
|
}
|
}
|
|
public void SetHorseID()
|
{
|
if (ItemOperateUtility.Instance.useItemModel != null)//坐骑单
|
{
|
int ItemId = ItemOperateUtility.Instance.useItemModel.itemId;
|
if (ItemId == 181)
|
{
|
int MountID= mountModel.GetMinExpMount();
|
if (MountID != 0)
|
{
|
signHorseID = MountID;
|
return;
|
}
|
}
|
}
|
|
if (ItemOperateUtility.Instance.useItemModel != null)//跳轉選中(碎片)
|
{
|
int ItemId = ItemOperateUtility.Instance.useItemModel.itemId;
|
|
for (int i = 0; i < sortMountlist.Count; i++)
|
{
|
if (sortMountlist[i].UnlockItemID == ItemId)
|
{
|
signHorseID = sortMountlist[i].HorseID;
|
return;
|
}
|
}
|
}
|
for (int i = 0; i < sortMountlist.Count; i++)//未解鎖選中
|
{
|
if (!mountModel._DicHorse.ContainsKey(sortMountlist[i].HorseID))
|
{
|
int MaterialNumber = playerPack.GetItemCountByID(PackType.Item, sortMountlist[i].UnlockItemID);//获取背包解锁材料的数量
|
if (MaterialNumber != 0)
|
{
|
signHorseID = sortMountlist[i].HorseID;
|
return;
|
}
|
}
|
}
|
foreach (var key in mountModel.mountRedpoint.Keys)
|
{
|
if (mountModel.mountRedpoint[key].state == RedPointState.Simple)
|
{
|
signHorseID = key;
|
return;
|
}
|
}
|
for (int i = 0; i < sortMountlist.Count; i++)
|
{
|
if (sortMountlist[i].HorseID == mountModel.HorseIDNow)
|
{
|
signHorseID = sortMountlist[i].HorseID;
|
return;
|
}
|
}
|
signHorseID = sortMountlist[0].HorseID;
|
}
|
|
private int JumpIndex(int HorseID = 0)
|
{
|
int Index = 0;
|
Index = sortMountlist.FindIndex((x) =>
|
{
|
return x.HorseID == signHorseID;
|
});
|
if (Index == -1)
|
{
|
Index = 0;
|
}
|
return JumpSelect(Index);
|
}
|
|
void OnCreateGridLineCell(ScrollerController gridCtrl)
|
{
|
gridCtrl.Refresh();
|
for (int i = 0; i < sortMountlist.Count; i++)
|
{
|
gridCtrl.AddCell(ScrollerDataType.Header, sortMountlist[i].HorseID);
|
}
|
gridCtrl.Restart();
|
}
|
private void OnRefreshGridCell(ScrollerDataType type, CellView cell)
|
{
|
SelectThemount selectThemount = cell.GetComponent<SelectThemount>();
|
int horseID = cell.index;
|
var horseConfig = HorseConfig.Get(horseID);
|
selectThemount.QualityTxt1.text = ProductOrder(horseConfig.Quality.ToString());
|
selectThemount.MountNameTxt.text = horseConfig.Name;
|
selectThemount.HidingTipstext.text = Language.Get("Petwin8");
|
selectThemount.HidingTipstext_A.text = Language.Get("Petwin8");
|
if (mountModel._DicHorse.ContainsKey(horseID))
|
{
|
selectThemount.MountLvText.gameObject.SetActive(true);
|
selectThemount.MountLvActivation.SetActive(false);
|
|
if (mountModel._DicHorse[horseID].Lv >= horseConfig.MaxLV)
|
{
|
selectThemount.MountLvText.text = string.Format(Language.Get("Horse_MaxLv"), mountModel._DicHorse[horseID].Lv);
|
}
|
else
|
{
|
selectThemount.MountLvText.text = string.Format(Language.Get("Horse_lv"), mountModel._DicHorse[horseID].Lv);
|
}
|
}
|
else
|
{
|
selectThemount.MountLvText.gameObject.SetActive(false);
|
selectThemount.MountLvActivation.SetActive(true);
|
selectThemount.MountLvActivation.GetComponent<Text>().text = Language.Get("Petwin6");
|
}
|
if (horseID == signHorseID)
|
{
|
if (mountModel._DicHorse.ContainsKey(signHorseID))
|
{
|
MountLv = mountModel._DicHorse[signHorseID].Lv;
|
}
|
else
|
{
|
MountLv = 0;
|
}
|
selectThemount.ChoosenImg.SetActive(false);
|
selectThemount.DarkImage.SetActive(true);
|
if (MountLv > 0 && mountModel.HorseIDNow != horseID)
|
{
|
var config = HorseConfig.Get(signHorseID);
|
if (MountLv >= config.UseNeedRank)
|
{
|
selectThemount.PlayedEquipText.text = Language.Get("MountText2");
|
}
|
else
|
{
|
selectThemount.PlayedEquipText.text = string.Format(Language.Get("MountText1"), config.UseNeedRank);
|
}
|
selectThemount.PlayedEquipBtn.gameObject.SetActive(true);
|
selectThemount.PlayedEquipBtn.RemoveAllListeners();
|
selectThemount.PlayedEquipBtn.AddListener(() =>
|
{
|
int useNeedRank = config.UseNeedRank;
|
if (mountModel._DicHorse[signHorseID].Lv < useNeedRank)
|
{
|
ScrollTip.ShowTip(Language.Get("AppearanceMount_Z"));//未达到外观切换条件
|
return;
|
}
|
OnClickStopDomesticateBtn();
|
mountModel.AppearanceSwitch(signHorseID);
|
ScrollTip.ShowTip(Language.Get("Z1062"));//外观切换成功
|
});
|
}
|
else
|
{
|
selectThemount.PlayedEquipBtn.gameObject.SetActive(false);
|
}
|
m_MountName.text = horseConfig.Name;
|
if (mountModel._HorseIDNow != string.Empty && int.Parse(mountModel._HorseIDNow) == horseID)
|
{
|
selectThemount.HidingTips.SetActive(true);
|
|
}
|
else
|
{
|
selectThemount.HidingTips.SetActive(false);
|
}
|
}
|
else
|
{
|
selectThemount.ChoosenImg.SetActive(true);
|
selectThemount.DarkImage.SetActive(false);
|
selectThemount.PlayedEquipBtn.gameObject.SetActive(false);
|
if (mountModel._HorseIDNow != string.Empty && int.Parse(mountModel._HorseIDNow) == horseID)
|
{
|
|
selectThemount.HidingTips_A.SetActive(true);
|
}
|
else
|
{
|
selectThemount.HidingTips_A.SetActive(false);
|
}
|
}
|
selectThemount.RedPoint.redpointId = mountModel.mountRedpoint[horseID].id;
|
if (selectThemount.DarkImage.activeSelf)
|
{
|
m_MountPanelAssignment.PanelAssignment(horseID);
|
}
|
selectThemount.MountButton.RemoveAllListeners();
|
selectThemount.MountButton.AddListener(() =>
|
{
|
if (horseID != signHorseID)
|
{
|
OnClickStopDomesticateBtn();
|
StartCoroutine(SwitchDelay(horseID));
|
}
|
});
|
}
|
|
IEnumerator SwitchDelay( int horseId)
|
{
|
yield return new WaitForSeconds(0.2f);
|
signHorseID = horseId;
|
m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
}
|
private void DefaultOption()//默认选择
|
{
|
if (mountModel._HorseIDNow == string.Empty)
|
{
|
signHorseID = sortMountlist[0].HorseID;
|
}
|
else
|
{
|
signHorseID = int.Parse(mountModel._HorseIDNow);
|
}
|
}
|
private void OnClickMountHunButton()
|
{
|
OnClickStopDomesticateBtn();
|
WindowCenter.Instance.Open<MountStoneTipsWin>();
|
}
|
private void OnClickDeblockingBtton()//解锁按钮
|
{
|
HorseConfig horsefig = HorseConfig.Get(signHorseID);
|
int MaterialNumber = playerPack.GetItemCountByID(PackType.Item, horsefig.UnlockItemID);//获取背包解锁材料的数量
|
if (MaterialNumber >= horsefig.UnlockItemCnt)
|
{
|
CA501_tagPlayerActivateHorse _tagA501 = new CA501_tagPlayerActivateHorse();
|
_tagA501.HorseID = (uint)signHorseID;
|
GameNetSystem.Instance.SendInfo(_tagA501);
|
|
}
|
else
|
{
|
ScrollTip.ShowTip(Language.Get("Z1063"));//所需材料不足
|
}
|
}
|
private void OnClickTrainBtn()//驯养1颗
|
{
|
OnClickStopDomesticateBtn();
|
if (ExecuteJudgment(signHorseID))
|
{
|
if (playerPack.GetItemCountByID(PackType.Item, mountDanId) <= 0)//如果背包中没有坐骑丹结束方法
|
{
|
FuncConfigConfig _tagfun = FuncConfigConfig.Get("HorseUpItem");
|
ItemConfig _tagchine = ItemConfig.Get(int.Parse(_tagfun.Numerical1));
|
if (!WindowCenter.Instance.IsOpen<RidingAndPetActivationWin>())
|
{
|
ItemTipUtility.Show(_tagchine.ID);
|
}
|
return;
|
}
|
SingleUseMountDan(1);
|
}
|
else
|
{
|
ServerTipDetails.DisplayNormalTip(Language.Get("Z1028"));//当前坐骑升阶满级
|
}
|
}
|
private void SingleUseMountDan(int MountDanNumber)//单次使用坐骑丹
|
{
|
mountModel.MountDanUse(signHorseID, MountDanNumber);//向服务端发包坐骑经验单
|
}
|
public void OnClickAutoTrainBtn()//自动驯养
|
{
|
OnClickStopDomesticateBtn();
|
if (ExecuteJudgment(signHorseID))
|
{
|
|
if (playerPack.GetItemCountByID(PackType.Item, mountDanId) <= 0)//仙玉驯养面板
|
{
|
WindowCenter.Instance.Open<AutoTrainTipsWin>();
|
}
|
else
|
{
|
m_AutoTrainBtn.gameObject.SetActive(false);
|
m_StopDomesticateBtn.gameObject.SetActive(true);
|
StartCoroutine("AutomaticDomesticated");
|
}
|
}
|
else
|
{
|
ServerTipDetails.DisplayNormalTip(Language.Get("Z1028"));//当前坐骑升阶满级
|
}
|
}
|
IEnumerator AutomaticDomesticated()//自动驯养
|
{
|
while (ExecuteJudgment(signHorseID))
|
{
|
if (playerPack.GetItemCountByID(PackType.Item, mountDanId) <= 0)//如果背包中没有坐骑丹结束方法
|
{
|
m_AutoTrainBtn.gameObject.SetActive(true);
|
m_StopDomesticateBtn.gameObject.SetActive(false);
|
//ScrollTip.ShowTip(Language.Get("HorseDan5_text"));
|
yield break;
|
}
|
else if (WindowCenter.Instance.IsOpen<RidingAndPetActivationWin>())//打开骑宠激活界面结束方法
|
{
|
m_AutoTrainBtn.gameObject.SetActive(true);
|
m_StopDomesticateBtn.gameObject.SetActive(false);
|
yield break;
|
}
|
else
|
{
|
if (mountModel.Wait)
|
{
|
if (mountModel._DicHorse.ContainsKey(signHorseID))
|
{
|
int exp=HorseUpConfig.GetHorseIDAndLV(signHorseID, mountModel._DicHorse[signHorseID].Lv).NeedExp;
|
int NeedNum= ridingAndPetActivationModel.PetAndHorseNeedDanNum(exp);
|
int NumNow = playerPack.GetItemCountByID(PackType.Item, mountDanId);
|
if (NumNow >= NeedNum)
|
{
|
mountModel.MountDanUse(signHorseID, NeedNum);//向服务端发包坐骑经验单
|
mountModel.Wait = false;
|
}
|
else
|
{
|
mountModel.MountDanUse(signHorseID, NumNow);//向服务端发包坐骑经验单
|
mountModel.Wait = false;
|
}
|
}
|
}
|
yield return null;
|
}
|
}
|
m_AutoTrainBtn.gameObject.SetActive(true);
|
m_StopDomesticateBtn.gameObject.SetActive(false);
|
ServerTipDetails.DisplayNormalTip(Language.Get("Z1028"));//当前坐骑升阶满级;
|
yield break;
|
}
|
|
public void FairyJadeDomesticate()
|
{
|
int NumberLv = AutoTrainTipsWin._Lvnumber;//等级所需的等级
|
if (NumberLv > mountModel._DicHorse[signHorseID].Lv && !WindowCenter.Instance.IsOpen<RidingAndPetActivationWin>() && AutoTrainTipsWin.IsFairy)
|
{
|
m_AutoTrainBtn.gameObject.SetActive(false);
|
m_StopDomesticateBtn.gameObject.SetActive(true);
|
StartCoroutine("FairyJadeD");
|
}
|
|
}
|
IEnumerator FairyJadeD()//仙玉驯养
|
{
|
int number = AutoTrainTipsWin.DomesticateNumber;//所需的颗数
|
int NumberLv = AutoTrainTipsWin._Lvnumber;//等级所需的等级
|
while (NumberLv > mountModel._DicHorse[signHorseID].Lv)
|
{
|
if (WindowCenter.Instance.IsOpen<RidingAndPetActivationWin>())
|
{
|
m_AutoTrainBtn.gameObject.SetActive(true);
|
m_StopDomesticateBtn.gameObject.SetActive(false);
|
StopCoroutine("FairyJadeD");
|
yield break;
|
}
|
if (mountModel.Wait)
|
{
|
int exp = HorseUpConfig.GetHorseIDAndLV(signHorseID, mountModel._DicHorse[signHorseID].Lv).NeedExp;
|
int NeedNum = ridingAndPetActivationModel.PetAndHorseNeedDanNum(exp);
|
mountModel.MountDanUse(signHorseID, NeedNum, true);//向服务端发包坐骑经验单
|
mountModel.Wait = false;
|
}
|
yield return null;
|
}
|
if (!m_AutoTrainBtn.gameObject.activeSelf)
|
{
|
AutoTrainTipsWin.IsFairy = false;
|
m_AutoTrainBtn.gameObject.SetActive(true);
|
m_StopDomesticateBtn.gameObject.SetActive(false);
|
StopCoroutine("FairyJadeD");
|
yield break;
|
}
|
yield break;
|
}
|
public void OnClickStopDomesticateBtn()
|
{
|
if (!m_AutoTrainBtn.gameObject.activeSelf)
|
{
|
m_AutoTrainBtn.gameObject.SetActive(true);
|
m_StopDomesticateBtn.gameObject.SetActive(false);
|
StopCoroutine("AutomaticDomesticated");
|
StopCoroutine("FairyJadeD");
|
}
|
}
|
private void OnMountUieffectUpLv()
|
{
|
if (!m_UieffectLVUp.IsPlaying)
|
{
|
m_UieffectLVUp.Play();
|
m_PositionTweenLVUp.Play();
|
}
|
}
|
private void OnMountAdd(int _HorseID)//坐骑添加
|
{
|
m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
ridingAndPetActivationModel.RidingAndPetActivationSet(RidingAndPetActivation.MountActivation, _HorseID);
|
}
|
private void OnMountUpdate(int _HorseID)//坐骑刷新
|
{
|
mountModel.Wait = true;
|
MountSkills.Clear();
|
foreach (var key in mountModel.GetMountSkillAndItem.Keys)
|
{
|
if (mountModel.GetMountSkillAndItem[key].HorseID == _HorseID)
|
{
|
MountSkills.Add(mountModel.GetMountSkillAndItem[key]);
|
}
|
}
|
if (m_MountModel._DicHorse[_HorseID].Lv > MountLv)
|
{
|
for (int i = 0; i < MountSkills.Count; i++)
|
{
|
if (MountSkills[i].HorseLV == m_MountModel._DicHorse[_HorseID].Lv)
|
{
|
ridingAndPetActivationModel.RidingAndPetActivationSet(RidingAndPetActivation.MountSkillActivates, _HorseID, MountSkills[i].SkillID, MountSkills[i].HorseLV);
|
}
|
}
|
}
|
m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
}
|
private void OnMountAlteration(string NowMount)//坐骑外观变化时调用
|
{
|
m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
}
|
#endregion
|
bool ExecuteJudgment(int horeseID)//判断是否满阶可否继续使用的执行判断条件
|
{
|
bool _bool = false;
|
int _NoweLv = mountModel._DicHorse[horeseID].Lv;
|
|
int _MaxLv = HorseConfig.Get(horeseID).MaxLV;
|
if (_MaxLv > _NoweLv)
|
{
|
_bool = true;
|
return _bool;
|
}
|
else
|
{
|
_bool = false;
|
return _bool;
|
}
|
}
|
void ToAddSorting()//坐骑的列表排序
|
{
|
// sortMountlist.Clear();
|
if (sortMountlist.Count <= 0)
|
{
|
sortMountlist = HorseConfig.GetValues();
|
}
|
sortMountlist.Sort(Compare);
|
}
|
int Compare(HorseConfig x, HorseConfig y)//数组排列
|
{
|
bool havex = IsNoFullLv(x.HorseID);
|
bool havey = IsNoFullLv(y.HorseID);
|
bool have_x = IsFullLv(x.HorseID);
|
bool have_y = IsFullLv(y.HorseID);
|
if (havex.CompareTo(havey) != 0)
|
{
|
return -havex.CompareTo(havey);
|
}
|
if (have_x.CompareTo(have_y) != 0)
|
{
|
return -have_x.CompareTo(have_y);
|
}
|
if (x.Sort.CompareTo(y.Sort) != 0)
|
{
|
return x.Sort.CompareTo(y.Sort);
|
}
|
return 1;
|
}
|
private bool IsNoFullLv(int mountID)//未满街
|
{
|
HorseConfig HorseConfig = HorseConfig.Get(mountID);
|
if (mountModel._DicHorse.ContainsKey(mountID))
|
{
|
if (HorseConfig.MaxLV > mountModel._DicHorse[mountID].Lv)
|
{
|
return true;
|
}
|
else
|
{
|
return false;
|
}
|
}
|
return false;
|
}
|
private bool IsFullLv(int mountID)//满阶
|
{
|
HorseConfig HorseConfig = HorseConfig.Get(mountID);
|
if (mountModel._DicHorse.ContainsKey(mountID))
|
{
|
if (HorseConfig.MaxLV <= mountModel._DicHorse[mountID].Lv)
|
{
|
return true;
|
}
|
else
|
{
|
return false;
|
}
|
}
|
return false;
|
}
|
private void HandleAchievement()
|
{
|
if (AchievementGoto.achievementType == AchievementGoto.MountDomesticated)//坐骑培养
|
{
|
AchievementGoto.achievementType = 0;
|
SuccessConfig successConfig = SuccessConfig.Get(AchievementGoto.guideAchievementId);
|
int[] HorseId = successConfig.Condition;
|
signHorseID = HorseId[0];
|
m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
m_ScrollerController.JumpIndex(JumpIndex());
|
int MaterialNumber = playerPack.GetItemCountByID(PackType.Item, 181);
|
if (mountModel._DicHorse.ContainsKey(signHorseID))
|
{
|
if (MaterialNumber > 0)
|
{
|
AchievementGuideEffect2 = AchievementGuideEffectPool.Require(1);
|
AchievementGuideEffect2.transform.SetParentEx(m_TrainBtn_1.transform, Vector3.zero, Vector3.zero, Vector3.one);
|
}
|
else
|
{
|
SysNotifyMgr.Instance.ShowTip("HorseShowTipAchievement2");
|
}
|
}
|
else
|
{
|
SysNotifyMgr.Instance.ShowTip("HorseShowTipAchievement1");
|
}
|
AchievementGoto.achievementType = 0;
|
}
|
}
|
|
private void OnClickPropertyButton()
|
{
|
ridingAndPetActivationModel.property = PropertyTip.Mount;
|
ridingAndPetActivationModel.RidingId = signHorseID;
|
WindowCenter.Instance.Open<TargetPetAttrWin>();
|
}
|
|
string ProductOrder(string _petProductOrder)//坐骑品质
|
{
|
FuncConfigConfig _PetQuality = FuncConfigConfig.Get("PetQuality");
|
string[] _productlist = _PetQuality.Numerical1.Split('|');
|
for (int i = 0; i < _productlist.Length; i++)
|
{
|
if (_petProductOrder == _productlist[i])
|
{
|
string[] _productText = _PetQuality.Numerical2.Split('|');
|
string str = _productText[i];
|
return str;
|
}
|
}
|
return null;
|
}
|
private int JumpSelect(int Index)
|
{
|
if (Index <= 4)
|
{
|
return 0;
|
}
|
return Index;
|
}
|
}
|
}
|
|
|
|
|