You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
535 B
C#
21 lines
535 B
C#
6 months ago
|
using System;
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
|
||
|
namespace Autohand.Demo{
|
||
|
public class LeverTextChanger : MonoBehaviour{
|
||
|
public TMPro.TextMeshPro text;
|
||
|
public PhysicsGadgetHingeAngleReader sliderReader;
|
||
|
|
||
|
float lastValue = 0;
|
||
|
void Update(){
|
||
|
var value = sliderReader.GetValue();
|
||
|
if(value != lastValue) {
|
||
|
lastValue = value;
|
||
|
text.text = Math.Round(value, 2).ToString();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|