mirror of
https://github.com/xiaopeng12138/MaiDXR.git
synced 2024-12-18 03:45:55 +01:00
update config panel
This commit is contained in:
parent
ff8a0032f0
commit
48708adbf4
File diff suppressed because it is too large
Load Diff
36
Assets/Scripts/ValueManager.cs
Normal file
36
Assets/Scripts/ValueManager.cs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
using TMPro;
|
||||||
|
|
||||||
|
public class ValueManager : MonoBehaviour
|
||||||
|
{
|
||||||
|
TMP_Text tmp;
|
||||||
|
float Value;
|
||||||
|
float tempValue;
|
||||||
|
public bool isPointerDown = false;
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
tmp = GetComponent<TMP_Text>();
|
||||||
|
}
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
if (isPointerDown)
|
||||||
|
{
|
||||||
|
ChangeValue(tempValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ChangeValue(float value)
|
||||||
|
{
|
||||||
|
tempValue = value;
|
||||||
|
Value += value;
|
||||||
|
tmp.text = String.Format("{0:F2}", Value);
|
||||||
|
isPointerDown = true;
|
||||||
|
}
|
||||||
|
public void PointerState(bool state)
|
||||||
|
{
|
||||||
|
isPointerDown = state;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user