|
@@ -1,5 +1,6 @@
|
|
|
using System.Linq;
|
|
|
using Core.Language;
|
|
|
+using Core.UI.UTool;
|
|
|
using Excel2Json;
|
|
|
using Fort23.UTool;
|
|
|
using GameLogic.Bag;
|
|
@@ -11,6 +12,9 @@ namespace Fort23.Mono
|
|
|
[UIBinding(prefab = "WidgetItemType2")]
|
|
|
public partial class WidgetItemType2 : UIComponent
|
|
|
{
|
|
|
+ ItemInfo itemInfo;
|
|
|
+ private int count;
|
|
|
+
|
|
|
private void Init()
|
|
|
{
|
|
|
}
|
|
@@ -27,8 +31,22 @@ namespace Fort23.Mono
|
|
|
{
|
|
|
}
|
|
|
|
|
|
+ public void Play(float bl)
|
|
|
+ {
|
|
|
+ // long count = itemInfo.count.Value;
|
|
|
+ AccumulatorUtility.StartAccumulation(
|
|
|
+ (int)(count * bl), 0.2f, 20,
|
|
|
+ current =>
|
|
|
+ {
|
|
|
+ count += current;
|
|
|
+ Text_Count.text = $"x{count}";
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
public void InitWidget(ItemInfo itemInfo)
|
|
|
{
|
|
|
+ this.itemInfo = itemInfo;
|
|
|
ItemConfig itemConfig = itemInfo.config;
|
|
|
Icon_New.gameObject.SetActive(false);
|
|
|
//法宝
|
|
@@ -42,7 +60,8 @@ namespace Fort23.Mono
|
|
|
{
|
|
|
itemConfig = ConfigComponent.Instance.Get<ItemConfig>(itemInfo.config.associateVlaue[0]);
|
|
|
Icon_SuiPian.gameObject.SetActive(true);
|
|
|
- Text_Count.text = $"x{itemInfo.config.associateVlaue[2]}";
|
|
|
+ count = itemInfo.config.associateVlaue[2];
|
|
|
+ Text_Count.text = $"x{count}";
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -61,7 +80,9 @@ namespace Fort23.Mono
|
|
|
{
|
|
|
itemConfig = ConfigComponent.Instance.Get<ItemConfig>(itemInfo.config.associateVlaue[0]);
|
|
|
Icon_SuiPian.gameObject.SetActive(true);
|
|
|
- Text_Count.text = $"x{itemInfo.config.associateVlaue[2]}";
|
|
|
+ count = itemInfo.config.associateVlaue[2];
|
|
|
+ Text_Count.text = $"x{count}";
|
|
|
+ // Text_Count.text = $"x{itemInfo.config.associateVlaue[2]}";
|
|
|
// Icon_New.gameObject.SetActive(true);
|
|
|
}
|
|
|
else
|
|
@@ -73,7 +94,8 @@ namespace Fort23.Mono
|
|
|
else
|
|
|
{
|
|
|
Icon_SuiPian.gameObject.SetActive(false);
|
|
|
- Text_Count.text = $"x{itemInfo.count}";
|
|
|
+ count = (int)(itemInfo.count.Value);
|
|
|
+ Text_Count.text = $"x{count}";
|
|
|
csc.ChangeState(0);
|
|
|
}
|
|
|
|