1
This commit is contained in:
parent
0f6e312f01
commit
3dce727aed
@ -70,7 +70,7 @@ Material:
|
||||
- _OutlineSoftness: 0
|
||||
- _OutlineUVSpeedX: 0
|
||||
- _OutlineUVSpeedY: 0
|
||||
- _OutlineWidth: 0
|
||||
- _OutlineWidth: 0.02
|
||||
- _PerspectiveFilter: 0.875
|
||||
- _Reflectivity: 10
|
||||
- _ScaleRatioA: 0.8333333
|
||||
|
@ -278,18 +278,20 @@ namespace GameLogic
|
||||
|
||||
m_IsFillAnimPlaying = true;
|
||||
|
||||
// AlignCarWithFillAmount();
|
||||
|
||||
// 给进度条一个缩减回弹效果
|
||||
float originalFill = m_CurrentFillAmount;
|
||||
float shrinkTo = Mathf.Max(0.1f, originalFill - 0.4f); // 缩到原值-0.2,最小0.1
|
||||
DOTween.To(
|
||||
() => m_imgValue.fillAmount,
|
||||
x => m_imgValue.fillAmount = x,
|
||||
x => { m_imgValue.fillAmount = x; OnFillAmountChanged(x); },
|
||||
shrinkTo, 0.15f
|
||||
).SetEase(Ease.InQuad).OnComplete(() =>
|
||||
{
|
||||
DOTween.To(
|
||||
() => m_imgValue.fillAmount,
|
||||
x => m_imgValue.fillAmount = x,
|
||||
x => { m_imgValue.fillAmount = x; OnFillAmountChanged(x); },
|
||||
originalFill, 0.35f
|
||||
).SetEase(Ease.OutElastic)
|
||||
.OnComplete(() =>
|
||||
@ -748,6 +750,9 @@ namespace GameLogic
|
||||
/// 计算百分比大小值
|
||||
/// </summary>
|
||||
public void UpdateScale()
|
||||
{
|
||||
|
||||
if (!m_IsFillAnimPlaying)
|
||||
{
|
||||
var teamList = DataGameSceneManager.Instance.m_TeamSortList;
|
||||
if (teamList.Count <= 0)
|
||||
@ -781,10 +786,11 @@ namespace GameLogic
|
||||
|
||||
m_tmpValue.gameObject.SetActive(m_imgValue.fillAmount < 0.3f);
|
||||
m_tmpValue.gameObject.SetActive(m_imgValue.fillAmount > 0.3f);
|
||||
|
||||
AlignCarWithFillAmount();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新图片位置
|
||||
/// </summary>
|
||||
@ -812,6 +818,7 @@ namespace GameLogic
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 加载动图
|
||||
/// </summary>
|
||||
@ -835,5 +842,30 @@ namespace GameLogic
|
||||
|
||||
m_rectCar.transform.GetChild(key).gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
// 新增回调方法
|
||||
private void OnFillAmountChanged(float newValue)
|
||||
{
|
||||
// 这里写你需要执行的逻辑,比如同步UI、特效等
|
||||
if (m_imgValue == null || m_rectCar == null)
|
||||
return;
|
||||
|
||||
// 获取 m_imgValue 的 RectTransform
|
||||
RectTransform imgRectTransform = m_imgValue.GetComponent<RectTransform>();
|
||||
|
||||
if (imgRectTransform == null)
|
||||
return;
|
||||
|
||||
// 获取 m_imgValue 的宽度
|
||||
float imgWidth = imgRectTransform.rect.width;
|
||||
|
||||
// 计算裁剪后的 X 坐标
|
||||
float targetX = imgWidth * newValue;
|
||||
|
||||
// 更新 m_rectCar 的位置
|
||||
Vector3 localPosition = m_rectCar.localPosition;
|
||||
localPosition.x = targetX - (imgWidth / 2); // 调整为相对于中心点的位置
|
||||
m_rectCar.localPosition = localPosition;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -875,7 +875,7 @@ namespace GameLogic
|
||||
eGo.transform.localScale = Vector3.one * 0.5f;
|
||||
|
||||
// 移动特效
|
||||
eGo.transform.DOLocalMoveX(-1, 45f).OnComplete(() =>
|
||||
eGo.transform.DOLocalMoveX(-1, 15f).OnComplete(() =>
|
||||
{
|
||||
GameObject.Destroy(eGo);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user