SpeedLinearEditor.cs 588 B

123456789101112131415161718192021222324252627
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. using Valve.VR.InteractionSystem;
  6. public class SpeedLinearEditor : MonoBehaviour
  7. {
  8. public float speed;
  9. public float maxSpeed = 3;
  10. public Text speedText;
  11. public LinearMapping linearMapping;
  12. // Start is called before the first frame update
  13. void Start()
  14. {
  15. }
  16. // Update is called once per frame
  17. void Update()
  18. {
  19. speed = maxSpeed * linearMapping.value;
  20. speedText.text = (linearMapping.value).ToString();
  21. }
  22. }