备份CatanBuilding瘦身独立工程
This commit is contained in:
46
Assets/Scripts/Duel/UI/FishStatisticsPlayerInfo.cs
Normal file
46
Assets/Scripts/Duel/UI/FishStatisticsPlayerInfo.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
|
||||
using DG.Tweening;
|
||||
using TMPro;
|
||||
|
||||
public class FishStatisticsPlayerInfo : FishPlayerInfo
|
||||
{
|
||||
TMP_Text num_my;
|
||||
TMP_Text num_enemy;
|
||||
int oldSelfValue;
|
||||
int oldEnermyValue;
|
||||
public void SetNumShow(bool higher)
|
||||
{
|
||||
text_num.SetValue("0", higher);
|
||||
text_num_enemy.SetValue("0", !higher);
|
||||
if (higher)
|
||||
{
|
||||
num_my = text_num.text_num_higher;
|
||||
num_enemy = text_num_enemy.text_num;
|
||||
}
|
||||
else
|
||||
{
|
||||
num_my = text_num.text_num;
|
||||
num_enemy = text_num_enemy.text_num_higher;
|
||||
}
|
||||
}
|
||||
public void SetNum(int selfValue, int enermyValue, float time)
|
||||
{
|
||||
DOTween.Kill("SetNumInfo");
|
||||
if (selfValue > 0 && num_my != null)
|
||||
{
|
||||
DOTween.To(() => oldSelfValue, x => oldSelfValue = x, selfValue, time).OnUpdate(() =>
|
||||
{
|
||||
num_my.text = oldSelfValue.ToString();
|
||||
}).SetId("SetNumInfo");
|
||||
//num_my.text = selfValue.ToString();
|
||||
}
|
||||
if (enermyValue > 0 && num_enemy != null)
|
||||
{
|
||||
DOTween.To(() => oldEnermyValue, x => oldEnermyValue = x, enermyValue, time).OnUpdate(() =>
|
||||
{
|
||||
num_enemy.text = oldEnermyValue.ToString();
|
||||
}).SetId("SetNumInfo");
|
||||
//num_enemy.text = enermyValue.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user