fix ipc touch not working bug;
fix player height text not updating bug
This commit is contained in:
xpeng
2022-10-07 17:12:42 +02:00
parent 92a1395c79
commit 390c807f6c
15 changed files with 267 additions and 36 deletions
+17 -7
View File
@@ -8,7 +8,19 @@ using TMPro;
public class ValueManager : MonoBehaviour
{
TMP_Text tmp;
public float Value;
public float Value
{
get
{
return _value;
}
set
{
_value = value;
onValueChanged?.Invoke();
}
}
private float _value;
float tempValue;
public bool isPointerDown = false;
public UnityEvent onValueChanged = new UnityEvent();
@@ -25,12 +37,11 @@ public class ValueManager : MonoBehaviour
ChangeValueContinue(tempValue);
}
}
public void ChangeValueContinue(float _value)
public void ChangeValueContinue(float __value)
{
tempValue = _value;
Value += Time.deltaTime * _value;
tempValue = __value;
Value += Time.deltaTime * __value;
isPointerDown = true;
onValueChanged?.Invoke();
}
public void PointerState(bool state)
{
@@ -39,10 +50,9 @@ public class ValueManager : MonoBehaviour
public void ResetValue()
{
Value = 0;
onValueChanged?.Invoke();
}
public void UpdateText()
{
tmp.text = String.Format("{0:F2}", Value);
tmp.text = String.Format("{0:F2}", _value);
}
}