阶段性完成
This commit is contained in:
@@ -2,7 +2,6 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using DG.Tweening;
|
||||
using I2.Loc;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
@@ -27,13 +26,13 @@ namespace Ichni.UI
|
||||
public string suffix;
|
||||
public bool showPositiveMark;
|
||||
|
||||
public void SetUp(int initialValue, int step, string title = "")
|
||||
public void SetUp(int initialValue, int step)
|
||||
{
|
||||
intStep = step;
|
||||
intMin = int.MinValue;
|
||||
intMax = int.MaxValue;
|
||||
|
||||
base.SetUp(title);
|
||||
base.SetUp();
|
||||
|
||||
increaseButton.SetUpButton(IncreaseValue, IncreaseValue);
|
||||
decreaseButton.SetUpButton(DecreaseValue, DecreaseValue);
|
||||
@@ -94,7 +93,7 @@ namespace Ichni.UI
|
||||
{
|
||||
|
||||
valueText.text = prefix + (showPositiveMark && intValue > 0 ? "+" : "") + intValue.ToString() + suffix;
|
||||
var target = new Vector2((float)(intValue - intMin) / (intMax - intMin) * 660, 20);
|
||||
var target = new Vector2((float)(intValue - intMin) / (intMax - intMin) * 560, 20);
|
||||
barImage.rectTransform.sizeDelta = target;
|
||||
updateValueAction?.Invoke();
|
||||
}
|
||||
@@ -106,7 +105,7 @@ namespace Ichni.UI
|
||||
if (LastValue == intValue) return;
|
||||
tween?.Complete();
|
||||
valueText.text = prefix + (showPositiveMark && intValue > 0 ? "+" : "") + intValue.ToString() + suffix;
|
||||
var target = new Vector2((float)(intValue - intMin) / (intMax - intMin) * 660, 20);
|
||||
var target = new Vector2((float)(intValue - intMin) / (intMax - intMin) * 560, 20);
|
||||
tween = barImage.rectTransform.DOSizeDelta(target, 0.2f).SetEase(Ease.OutExpo).Play();
|
||||
LastValue = intValue;
|
||||
updateValueAction?.Invoke();
|
||||
@@ -117,4 +116,4 @@ namespace Ichni.UI
|
||||
return intValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user