|
@@ -3,6 +3,7 @@ using UnityEngine;
|
|
|
using UI.Travel;
|
|
|
using ET;
|
|
|
using FairyGUI;
|
|
|
+using System.Collections.Generic;
|
|
|
|
|
|
namespace GFGGame
|
|
|
{
|
|
@@ -10,6 +11,7 @@ namespace GFGGame
|
|
|
{
|
|
|
private UI_TravelTimeDetailUI _ui;
|
|
|
private ValueBarController _valueBarController;
|
|
|
+ private const int spendItemID = 3000102;
|
|
|
|
|
|
public override void Dispose()
|
|
|
{
|
|
@@ -41,6 +43,10 @@ namespace GFGGame
|
|
|
_valueBarController = new ValueBarController(_ui.m_comValueBar);
|
|
|
_ui.m_btnFinish.onClick.Add(OnClickBtnFinish);
|
|
|
_ui.m_btnSpeedUp.onClick.Add(OnClickBtnSpeedUp);
|
|
|
+
|
|
|
+ ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(spendItemID);
|
|
|
+ _ui.m_iconFinishSpend.url = ResPathUtil.GetIconPath(itemCfg.res, "png");
|
|
|
+ _ui.m_iconSpeedUpSpend.url = _ui.m_iconFinishSpend.url;
|
|
|
}
|
|
|
|
|
|
protected override void OnShown()
|
|
@@ -48,6 +54,8 @@ namespace GFGGame
|
|
|
base.OnShown();
|
|
|
|
|
|
_valueBarController.OnShown();
|
|
|
+ _valueBarController.UpdateList(new List<int>() { spendItemID });
|
|
|
+
|
|
|
UpdateTime(null);
|
|
|
Timers.inst.Add(1, -1, UpdateTime);
|
|
|
}
|
|
@@ -91,11 +99,29 @@ namespace GFGGame
|
|
|
private void OnClickBtnFinish()
|
|
|
{
|
|
|
int spendNum = int.Parse(_ui.m_numFinishSpend.text);
|
|
|
+
|
|
|
+ List<ItemInfoProto> list = new List<ItemInfoProto>();
|
|
|
+ ItemInfoProto item = new ItemInfoProto
|
|
|
+ {
|
|
|
+ ConfigId = spendItemID,
|
|
|
+ Count = spendNum
|
|
|
+ };
|
|
|
+ list.Add(item);
|
|
|
+ TravelSProxy.ReqTravelSpeedUp(1, list);
|
|
|
}
|
|
|
|
|
|
private void OnClickBtnSpeedUp()
|
|
|
{
|
|
|
int spendNum = int.Parse(_ui.m_numSpeedUpSpend.text);
|
|
|
+
|
|
|
+ List<ItemInfoProto> list = new List<ItemInfoProto>();
|
|
|
+ ItemInfoProto item = new ItemInfoProto
|
|
|
+ {
|
|
|
+ ConfigId = spendItemID,
|
|
|
+ Count = spendNum
|
|
|
+ };
|
|
|
+ list.Add(item);
|
|
|
+ TravelSProxy.ReqTravelSpeedUp(2, list);
|
|
|
}
|
|
|
}
|
|
|
}
|